SimFQT Logo  0.1.3
C++ Simulated Fare Quote System Library
SIMFQT_Service.hpp
Go to the documentation of this file.
00001 #ifndef __SIMFQT_SVC_SIMFQT_SERVICE_HPP
00002 #define __SIMFQT_SVC_SIMFQT_SERVICE_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // StdAir
00008 #include <stdair/stdair_basic_types.hpp>
00009 #include <stdair/stdair_service_types.hpp>
00010 #include <stdair/bom/TravelSolutionTypes.hpp>
00011 // SimFQT
00012 #include <simfqt/SIMFQT_Types.hpp>
00013 
00015 namespace stdair {
00016   class STDAIR_Service;
00017   struct BookingRequestStruct;
00018   struct BasLogParams;
00019   struct BasDBParams;
00020 }
00021 
00022 namespace SIMFQT {
00023 
00025   class SIMFQT_ServiceContext;
00026 
00027   
00031   class SIMFQT_Service {
00032   public:
00033     
00034     // ////////////////// Constructors and Destructors //////////////////    
00046     SIMFQT_Service (const stdair::BasLogParams&);
00047     
00060     SIMFQT_Service (const stdair::BasLogParams&, const stdair::BasDBParams&);
00061 
00077     SIMFQT_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr);
00078 
00087     void parseAndLoad (const FareFilePath& iFareFilename);
00088 
00092     ~SIMFQT_Service();
00093 
00094 
00095   public:
00096     // /////////// Business Methods /////////////    
00108     void buildSampleBom();
00109 
00116     stdair::BookingRequestStruct buildBookingRequest(const bool isForCRS = false);
00117 
00135     void buildSampleTravelSolutions (stdair::TravelSolutionList_T&);
00136 
00146     void quotePrices (const stdair::BookingRequestStruct&,
00147                       stdair::TravelSolutionList_T&);
00148 
00149 
00150   public:
00151     // //////////////// Display support methods /////////////////
00159     std::string csvDisplay() const;
00160 
00168     std::string csvDisplay (const stdair::TravelSolutionList_T&) const;
00169 
00182     std::string csvDisplay (const stdair::AirportCode_T& ioOrigin,
00183                             const stdair::AirportCode_T& ioDestination,
00184                             const stdair::Date_T& ioDepartureDate) const;
00185 
00194     std::string list() const;
00195 
00208     bool check (const stdair::AirportCode_T& ioOrigin,
00209                 const stdair::AirportCode_T& ioDestination,
00210                 const stdair::Date_T& ioDepartureDate) const;
00211     
00212   private:
00213     // /////// Construction and Destruction helper methods ///////
00217     SIMFQT_Service();
00218 
00222     SIMFQT_Service (const SIMFQT_Service&);
00223 
00233     stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&,
00234                                                    const stdair::BasDBParams&);
00235     
00244     stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&);
00245     
00254     void addStdAirService (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
00255                            const bool iOwnStdairService);
00256     
00261     void initServiceContext();
00262 
00269     void initSimfqtService(); 
00270 
00279     void initSimfqtService (const FareFilePath& iFareFilename); 
00280 
00284     void finalise();
00285 
00286 
00287   private:
00288     // ///////// Service Context /////////
00292     SIMFQT_ServiceContext* _simfqtServiceContext;
00293   };
00294 }
00295 #endif // __SIMFQT_SVC_SIMFQT_SERVICE_HPP