$treeview $search $mathjax
AirTSP Logo  1.01.2
$projectbrief
$projectbrief
$searchbox

AIRTSP_Service.hpp

Go to the documentation of this file.
00001 #ifndef __AIRTSP_SVC_AIRTSP_SERVICE_HPP
00002 #define __AIRTSP_SVC_AIRTSP_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/stdair_file.hpp>
00011 #include <stdair/bom/TravelSolutionTypes.hpp>
00012 
00014 namespace stdair {
00015   class STDAIR_Service;
00016   class BomRoot;
00017   struct BasLogParams;
00018   struct BasDBParams;
00019   struct BookingRequestStruct;
00020   struct TravelSolutionStruct;
00021 }
00022 
00023 namespace AIRTSP {
00024 
00026   class AIRTSP_ServiceContext;
00027 
00028   
00032   class AIRTSP_Service {
00033   public:
00034     // ////////////////// Constructors and Destructors //////////////////    
00050     AIRTSP_Service (const stdair::BasLogParams&, const stdair::BasDBParams&);  
00051     
00063     AIRTSP_Service (const stdair::BasLogParams&);
00064 
00080     AIRTSP_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr);
00081 
00090     void parseAndLoad (const stdair::ScheduleFilePath&);
00091 
00101     void parseAndLoad (const stdair::ScheduleFilePath&,
00102                        const stdair::ODFilePath&);
00103 
00107     ~AIRTSP_Service();
00108 
00109     
00110   public:
00111     // /////////// Business Methods /////////////
00119     void buildSampleBom(); 
00120 
00124     void clonePersistentBom (); 
00125 
00129     void buildComplementaryLinks (stdair::BomRoot&); 
00130 
00135     void buildSegmentPathList (stdair::TravelSolutionList_T&,
00136                                const stdair::BookingRequestStruct&);
00137 
00143     void simulate();
00144 
00145 
00146   public:
00147     // //////////////// Export support methods /////////////////
00159     std::string jsonExportFlightDateObjects (const stdair::AirlineCode_T&,
00160                                              const stdair::FlightNumber_T&,
00161                                              const stdair::Date_T& iDepartureDate) const;
00162 
00163 
00164   public:
00165     // //////////////// Display support methods /////////////////
00173     std::string csvDisplay() const;
00174 
00188     std::string csvDisplay (const stdair::AirlineCode_T&,
00189                             const stdair::FlightNumber_T&,
00190                             const stdair::Date_T& iDepartureDate) const;
00191 
00192 
00193   private:
00194     // /////// Construction and Destruction helper methods ///////
00198     AIRTSP_Service();
00199 
00203     AIRTSP_Service (const AIRTSP_Service&);
00204 
00214     stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&,
00215                                                    const stdair::BasDBParams&);
00216     
00225     stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&);
00226     
00235     void addStdAirService (stdair::STDAIR_ServicePtr_T,
00236                            const bool iOwnStdairService);
00237     
00242     void initServiceContext();
00243 
00250     void initAirtspService();
00251 
00255     void finalise();
00256 
00257     
00258   private:
00259     // ///////// Service Context /////////
00263     AIRTSP_ServiceContext* _airtspServiceContext;
00264   };
00265 }
00266 #endif // __AIRTSP_SVC_AIRTSP_SERVICE_HPP