13 #include <boost/program_options.hpp>
15 #include <stdair/stdair_basic_types.hpp>
16 #include <stdair/basic/ProgressStatusSet.hpp>
17 #include <stdair/bom/EventStruct.hpp>
18 #include <stdair/bom/BomDisplay.hpp>
19 #include <stdair/service/Logger.hpp>
20 #include <stdair/bom/BookingRequestStruct.hpp>
21 #include <stdair/bom/BookingRequestTypes.hpp>
22 #include <stdair/bom/EventStruct.hpp>
25 #include <sevmgr/config/sevmgr-paths.hpp>
38 stdair::Filename_T& ioLogFilename) {
41 boost::program_options::options_description
generic (
"Generic options");
43 (
"prefix",
"print installation prefix")
44 (
"version,v",
"print version string")
45 (
"help,h",
"produce help message");
49 boost::program_options::options_description config (
"Configuration");
53 "Filepath for the logs")
58 boost::program_options::options_description hidden (
"Hidden options");
61 boost::program_options::value< std::vector<std::string> >(),
62 "Show the copyright (license)");
64 boost::program_options::options_description cmdline_options;
65 cmdline_options.add(
generic).add(config).add(hidden);
67 boost::program_options::options_description config_file_options;
68 config_file_options.add(config).add(hidden);
70 boost::program_options::options_description visible (
"Allowed options");
71 visible.add(
generic).add(config);
73 boost::program_options::positional_options_description p;
74 p.add (
"copyright", -1);
76 boost::program_options::variables_map vm;
77 boost::program_options::
78 store (boost::program_options::command_line_parser (argc, argv).
79 options (cmdline_options).positional(p).run(), vm);
81 std::ifstream ifs (
"sevmgr.cfg");
82 boost::program_options::store (parse_config_file (ifs, config_file_options),
84 boost::program_options::notify (vm);
86 if (vm.count (
"help")) {
87 std::cout << visible << std::endl;
91 if (vm.count (
"version")) {
96 if (vm.count (
"prefix")) {
97 std::cout <<
"Installation prefix: " <<
PREFIXDIR << std::endl;
101 if (vm.count (
"log")) {
102 ioLogFilename = vm[
"log"].as< std::string >();
103 std::cout <<
"Log filename is: " << ioLogFilename << std::endl;
111 int main (
int argc,
char* argv[]) {
114 stdair::Filename_T lLogFilename;
124 std::ofstream logOutputFile;
126 logOutputFile.open (lLogFilename.c_str());
127 logOutputFile.clear();
130 const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
138 STDAIR_LOG_DEBUG (
"Build the default sample queue.");
147 stdair::Count_T idx = 1;
151 stdair::EventStruct lEventStruct;
152 const stdair::ProgressStatusSet lPPS =
153 sevmgrService.
popEvent (lEventStruct);
156 STDAIR_LOG_DEBUG (
"Poped event "<< idx <<
": '"
157 << lEventStruct.describe() <<
"'.");
158 STDAIR_LOG_DEBUG (
"Progresss status: " << lPPS.describe());
165 STDAIR_LOG_DEBUG (
"End of the simulation");
168 logOutputFile.close();