StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STDAIR_Service.hpp
Go to the documentation of this file.
1 
12 #ifndef __STDAIR_STDAIR_HPP
13 #define __STDAIR_STDAIR_HPP
14 
15 // //////////////////////////////////////////////////////////////////////
16 // Import section
17 // //////////////////////////////////////////////////////////////////////
18 // STL
19 #include <string>
20 // StdAir
28 
29 namespace stdair {
30 
32  class BomRoot;
33  class EventQueue;
34  class EventStruct;
35  struct ProgressStatusSet;
36  struct BookingRequestStruct;
37  class STDAIR_ServiceContext;
38 
39 
44  public:
45  // ////////// Constructors and destructors //////////
50 
63 
79  STDAIR_Service (const BasLogParams&, const BasDBParams&);
80 
85 
86 
87  public:
88  // ////////////////// Business support methods //////////////////
108  void buildSampleBom();
109 
131  void buildDummyInventory (const CabinCapacity_T& iCabinCapacity);
132 
148 
167 
196  BookingRequestStruct buildSampleBookingRequest (const bool isForCRS = false);
197 
213 
230  const Count_T&
232 
246 
260  const Count_T&
262 
280 
286  bool isQueueDone() const;
287 
292  void reset() const;
293 
294 
295  public:
296  // //////////////// Export support methods /////////////////
306  std::string jsonExport (const AirlineCode_T&, const FlightNumber_T&,
307  const Date_T& iDepartureDate) const;
308 
309 
310  public:
311  // //////////////// Display support methods /////////////////
325  std::string list (const AirlineCode_T& iAirlineCode = "all",
326  const FlightNumber_T& iFlightNumber = 0) const;
327 
334  std::string listAirportPairDateRange () const;
335 
345  bool check (const AirlineCode_T&, const FlightNumber_T&,
346  const Date_T& iDepartureDate) const;
347 
360  bool check (const AirportCode_T&, const AirportCode_T&,
361  const Date_T& iDepartureDate) const;
362 
370  std::string csvDisplay() const;
371 
381  std::string csvDisplay (const AirlineCode_T&, const FlightNumber_T&,
382  const Date_T& iDepartureDate) const;
383 
391  std::string csvDisplay (const TravelSolutionList_T&) const;
392 
403  std::string csvDisplay (const AirportCode_T&, const AirportCode_T&,
404  const Date_T& iDepartureDate) const;
405 
406 
407  public:
408  // ///////////////// Getters ///////////////////
417  BomRoot& getBomRoot() const;
418 
427  EventQueue& getEventQueue() const;
428 
434  BasLogParams getLogParams() const;
435 
442  const BasDBParams& getDBParams() const;
443 
453 
454 
455  private:
456  // /////// Construction and Destruction helper methods ///////
464 
469  void initServiceContext();
470 
488  void logInit (const BasLogParams&);
489 
495  void dbInit (const BasDBParams&);
496 
512  void init();
513 
517  void finalise();
518 
519 
520  private:
521  // ///////// Service Context /////////
525  STDAIR_ServiceContext* _stdairServiceContext;
526  };
527 }
528 #endif // __STDAIR_STDAIR_HPP