SimFQT Logo  0.1.3
C++ Simulated Fare Quote System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
SIMFQT_Service.hpp
Go to the documentation of this file.
1 #ifndef __SIMFQT_SVC_SIMFQT_SERVICE_HPP
2 #define __SIMFQT_SVC_SIMFQT_SERVICE_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // StdAir
8 #include <stdair/stdair_basic_types.hpp>
9 #include <stdair/stdair_service_types.hpp>
10 #include <stdair/bom/TravelSolutionTypes.hpp>
11 // SimFQT
12 #include <simfqt/SIMFQT_Types.hpp>
13 
15 namespace stdair {
16  class STDAIR_Service;
17  struct BookingRequestStruct;
18  struct BasLogParams;
19  struct BasDBParams;
20 }
21 
22 namespace SIMFQT {
23 
25  class SIMFQT_ServiceContext;
26 
27 
32  public:
33 
34  // ////////////////// Constructors and Destructors //////////////////
46  SIMFQT_Service (const stdair::BasLogParams&);
47 
60  SIMFQT_Service (const stdair::BasLogParams&, const stdair::BasDBParams&);
61 
77  SIMFQT_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr);
78 
87  void parseAndLoad (const FareFilePath& iFareFilename);
88 
93 
94 
95  public:
96  // /////////// Business Methods /////////////
108  void buildSampleBom();
109 
116  stdair::BookingRequestStruct buildBookingRequest(const bool isForCRS = false);
117 
135  void buildSampleTravelSolutions (stdair::TravelSolutionList_T&);
136 
146  void quotePrices (const stdair::BookingRequestStruct&,
147  stdair::TravelSolutionList_T&);
148 
149 
150  public:
151  // //////////////// Display support methods /////////////////
159  std::string csvDisplay() const;
160 
168  std::string csvDisplay (const stdair::TravelSolutionList_T&) const;
169 
182  std::string csvDisplay (const stdair::AirportCode_T& ioOrigin,
183  const stdair::AirportCode_T& ioDestination,
184  const stdair::Date_T& ioDepartureDate) const;
185 
194  std::string list() const;
195 
208  bool check (const stdair::AirportCode_T& ioOrigin,
209  const stdair::AirportCode_T& ioDestination,
210  const stdair::Date_T& ioDepartureDate) const;
211 
212  private:
213  // /////// Construction and Destruction helper methods ///////
217  SIMFQT_Service();
218 
223 
233  stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&,
234  const stdair::BasDBParams&);
235 
244  stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&);
245 
254  void addStdAirService (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
255  const bool iOwnStdairService);
256 
261  void initServiceContext();
262 
269  void initSimfqtService();
270 
279  void initSimfqtService (const FareFilePath& iFareFilename);
280 
284  void finalise();
285 
286 
287  private:
288  // ///////// Service Context /////////
292  SIMFQT_ServiceContext* _simfqtServiceContext;
293  };
294 }
295 #endif // __SIMFQT_SVC_SIMFQT_SERVICE_HPP