7 #if BOOST_VERSION >= 104100
9 #include <boost/property_tree/ptree.hpp>
10 #include <boost/property_tree/json_parser.hpp>
11 #include <boost/regex.hpp>
12 #endif // BOOST_VERSION >= 104100
17 #if BOOST_VERSION >= 104100
18 namespace bpt = boost::property_tree;
19 #else // BOOST_VERSION >= 104100
23 #endif // BOOST_VERSION >= 104100
32 #if BOOST_VERSION >= 104100
41 ptSimulationStatus.put (
"state", lSimulationMode.
describe());
43 const stdair::Date_T& lStartDate =
45 ptSimulationStatus.put (
"start_date", lStartDate);
47 const stdair::Date_T& lEndDate =
49 ptSimulationStatus.put (
"end_date", lEndDate);
51 const stdair::Date_T& lCurrentDate =
53 ptSimulationStatus.put (
"current_date", lCurrentDate);
55 const stdair::NbOfBookings_T& lCurrentNumberOfBookings =
57 ptSimulationStatus.put (
"bks", lCurrentNumberOfBookings);
59 const double& lCurrentElapsedTime =
61 ptSimulationStatus.put (
"elapsed_time", lCurrentElapsedTime);
63 const double& lCurrentEstimatedRemainingTime =
65 ptSimulationStatus.put (
"remaining_time", lCurrentEstimatedRemainingTime);
67 const stdair::ProgressStatus& lCurrentProgressStatus =
70 const stdair::Count_T& lCurrentNumber =
71 lCurrentProgressStatus.getCurrentNb();
72 ptSimulationStatus.put (
"current_number", lCurrentNumber);
74 const stdair::Count_T& lActualNumber =
75 lCurrentProgressStatus.getActualNb();
76 ptSimulationStatus.put (
"actual_number", lActualNumber);
79 const SEVMGR::ProgressStatusMap_T& lProgressStatusMap =
82 for (SEVMGR::ProgressStatusMap_T::const_iterator itPS =
83 lProgressStatusMap.begin(); itPS != lProgressStatusMap.end(); itPS++) {
85 const stdair::EventType::EN_EventType& lEventType = itPS->first;
86 const stdair::ProgressStatus& lProgressStatus = itPS->second;
88 const std::string& lEventTypeStr =
89 stdair::EventType::getLabel(lEventType);
90 ptEventStatus.put (
"type", lEventTypeStr);
92 const stdair::Count_T& lCurrentNumber =
93 lProgressStatus.getCurrentNb();
94 ptEventStatus.put (
"current_number", lCurrentNumber);
96 const stdair::Count_T& lActualNumber =
97 lProgressStatus.getActualNb();
98 ptEventStatus.put (
"actual_number", lActualNumber);
101 ptEventStatusList.push_back(std::make_pair(
"", ptEventStatus));
105 ptSimulationStatus.add_child (
"specific_status", ptEventStatusList);
108 pt.add_child (
"status", ptSimulationStatus);
111 write_json (oStream, pt);
113 #endif // BOOST_VERSION >= 104100