$treeview $search $mathjax
00001 #ifndef __SIMCRS_SVC_SIMCRS_SERVICE_HPP 00002 #define __SIMCRS_SVC_SIMCRS_SERVICE_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // StdAir 00008 #include <stdair/stdair_basic_types.hpp> 00009 #include <stdair/stdair_file.hpp> 00010 #include <stdair/stdair_service_types.hpp> 00011 #include <stdair/bom/TravelSolutionTypes.hpp> 00012 // SEvMgr 00013 #include <sevmgr/SEVMGR_Types.hpp> 00014 // SimFQT 00015 #include <simfqt/SIMFQT_Types.hpp> 00016 // AIRRAC 00017 #include <airrac/AIRRAC_Types.hpp> 00018 // SimCRS 00019 #include <simcrs/SIMCRS_Types.hpp> 00020 00022 namespace stdair { 00023 class BomRoot; 00024 struct BasLogParams; 00025 struct BasDBParams; 00026 struct BookingRequestStruct; 00027 struct CancellationStruct; 00028 struct SnapshotStruct; 00029 struct RMEventStruct; 00030 class JSONString; 00031 } 00032 00033 namespace SIMCRS { 00034 00036 class SIMCRS_ServiceContext; 00037 00038 00042 class SIMCRS_Service { 00043 public: 00044 // ////////////////// Constructors and Destructors ////////////////// 00061 SIMCRS_Service (const stdair::BasLogParams&, const stdair::BasDBParams&, 00062 const CRSCode_T&); 00063 00076 SIMCRS_Service (const stdair::BasLogParams&, const CRSCode_T&); 00077 00096 SIMCRS_Service (stdair::STDAIR_ServicePtr_T, SEVMGR::SEVMGR_ServicePtr_T, 00097 const CRSCode_T&); 00098 00099 00113 void parseAndLoad (const stdair::ScheduleFilePath&, 00114 const stdair::ODFilePath&, 00115 const stdair::FRAT5FilePath&, 00116 const stdair::FFDisutilityFilePath&, 00117 const AIRRAC::YieldFilePath&, 00118 const SIMFQT::FareFilePath&); 00119 00126 void initSnapshotAndRMEvents (const stdair::Date_T& iStartDate, 00127 const stdair::Date_T& iEndDate); 00128 00132 ~SIMCRS_Service(); 00133 00134 00135 public: 00136 // /////////////// Business Methods ///////////////// 00141 stdair::TravelSolutionList_T 00142 calculateSegmentPathList (const stdair::BookingRequestStruct&); 00143 00147 void fareQuote (const stdair::BookingRequestStruct&, 00148 stdair::TravelSolutionList_T&); 00149 00153 void calculateAvailability (stdair::TravelSolutionList_T&); 00154 00158 bool sell (const stdair::TravelSolutionStruct&, const stdair::PartySize_T&); 00159 00163 void takeSnapshots (const stdair::SnapshotStruct&); 00164 00168 bool playCancellation (const stdair::CancellationStruct&); 00169 00173 void optimise (const stdair::RMEventStruct&); 00174 00183 bool sell (const std::string& iSegmentDateKey, const stdair::ClassCode_T&, 00184 const stdair::PartySize_T&); 00185 00195 void buildSampleBom (); 00196 00200 void clonePersistentBom (); 00201 00206 void buildComplementaryLinks (stdair::BomRoot&); 00207 00227 void buildSampleTravelSolutions (stdair::TravelSolutionList_T&); 00228 00259 stdair::BookingRequestStruct 00260 buildSampleBookingRequest (const bool isForCRS = false); 00261 00262 00263 public: 00264 // //////////////// Export support methods ///////////////// 00274 std::string jsonHandler (const stdair::JSONString&) const; 00275 00276 public: 00277 // //////////////// Display support methods ///////////////// 00285 std::string csvDisplay() const; 00286 00294 std::string csvDisplay (const stdair::TravelSolutionList_T&) const; 00295 00309 std::string list (const stdair::AirlineCode_T& iAirlineCode = "all", 00310 const stdair::FlightNumber_T& iFlightNumber = 0) const; 00311 00323 std::string csvDisplay (const stdair::AirlineCode_T&, 00324 const stdair::FlightNumber_T&, 00325 const stdair::Date_T& iDepartureDate) const; 00326 00327 00328 private: 00329 // /////// Construction and Destruction helper methods /////// 00333 SIMCRS_Service(); 00334 00338 SIMCRS_Service (const SIMCRS_Service&); 00339 00349 stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&, 00350 const stdair::BasDBParams&); 00351 00361 stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&); 00362 00366 void initAIRSCHEDService(); 00367 00371 void initSIMFQTService(); 00372 00376 void initAIRINVService(); 00377 00386 void addStdAirService (stdair::STDAIR_ServicePtr_T, 00387 const bool iOwnStdairService); 00388 00394 void addSEVMGRService (SEVMGR::SEVMGR_ServicePtr_T, 00395 const bool iOwnSEVMGRService); 00396 00403 void initServiceContext (const CRSCode_T&); 00404 00409 void initSimcrsService(); 00410 00414 void finalise(); 00415 00416 00417 private: 00418 // ///////// Service Context ///////// 00422 SIMCRS_ServiceContext* _simcrsServiceContext; 00423 }; 00424 } 00425 #endif // __SIMCRS_SVC_SIMCRS_SERVICE_HPP