AirInv Logo  0.1.2
C++ Simulated Airline Inventory Management System library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScheduleParser.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 #include <sstream>
7 // StdAir
8 #include <stdair/basic/BasFileMgr.hpp>
9 #include <stdair/bom/BomRoot.hpp>
10 #include <stdair/service/Logger.hpp>
11 // Airinv
15 
16 namespace AIRINV {
17 
18  // //////////////////////////////////////////////////////////////////////
19  void ScheduleParser::
20  generateInventories (const stdair::Filename_T& iScheduleFilename,
21  stdair::BomRoot& ioBomRoot) {
22 
23  // Check that the file path given as input corresponds to an actual file
24  bool doesExistAndIsReadable =
25  stdair::BasFileMgr::doesExistAndIsReadable (iScheduleFilename);
26  if (doesExistAndIsReadable == false) {
27  std::ostringstream oMessage;
28  oMessage << "The schedule input file, '" << iScheduleFilename
29  << "', can not be retrieved on the file-system";
30  STDAIR_LOG_ERROR (oMessage.str());
31  throw ScheduleInputFileNotFoundException (oMessage.str());
32  }
33 
34  // Initialise the Flight-Period file parser.
35  FlightPeriodFileParser lFlightPeriodParser (ioBomRoot, iScheduleFilename);
36 
37  // Parse the CSV-formatted schedule input file, and generate the
38  // corresponding Inventories for the airlines.
39  lFlightPeriodParser.generateInventories ();
40 
41  // Complete the BomRoot BOM building
42  // Create the routings for all the inventories.
44 
45  // Build the similar flight-date sets and the corresponding guillotine
46  // blocks.
48 
49  // Bid price vector initialisation
51 
52  }
53 
54 }