]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/serialization/example/demo_log.cpp
1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
5 // (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
6 // Use, modification and distribution is subject to the Boost Software
7 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
13 #include "demo_gps.hpp"
14 #include "log_archive.hpp"
16 int main(int argc
, char *argv
[]){
18 bus_schedule schedule
;
22 bus_stop
*bs0
= new bus_stop_corner(
23 gps_position(34, 135, 52.560f
),
24 gps_position(134, 22, 78.30f
),
25 "24th Street", "10th Avenue"
27 bus_stop
*bs1
= new bus_stop_corner(
28 gps_position(35, 137, 23.456f
),
29 gps_position(133, 35, 54.12f
),
30 "State street", "Cathedral Vista Lane"
32 bus_stop
*bs2
= new bus_stop_destination(
33 gps_position(35, 136, 15.456f
),
34 gps_position(133, 32, 15.300f
),
37 bus_stop
*bs3
= new bus_stop_destination(
38 gps_position(35, 134, 48.789f
),
39 gps_position(133, 32, 16.230f
),
49 // add trips to schedule
50 schedule
.append("bob", 6, 24, &route0
);
51 schedule
.append("bob", 9, 57, &route0
);
52 schedule
.append("alice", 11, 02, &route0
);
60 // add trips to schedule
61 schedule
.append("ted", 7, 17, &route1
);
62 schedule
.append("ted", 9, 38, &route1
);
63 schedule
.append("alice", 11, 47, &route1
);
65 // display the complete schedule
66 log_archive
oa(std::cout
);
67 oa
<< BOOST_SERIALIZATION_NVP(schedule
);