$treeview $search $mathjax
AirRAC Logo  1.00.0
$projectbrief
$projectbrief
$searchbox

AIRRAC_Service.hpp

Go to the documentation of this file.
00001 #ifndef __AIRRAC_SVC_AIRRAC_SERVICE_HPP
00002 #define __AIRRAC_SVC_AIRRAC_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 // AirRAC
00012 #include <airrac/AIRRAC_Types.hpp>
00013 
00014 // Forward declarations.
00015 namespace stdair {
00016   class STDAIR_Service; 
00017   class BomRoot;
00018   struct BasLogParams;
00019   struct BasDBParams;
00020 }
00021 
00022 namespace AIRRAC {
00023 
00025   class AIRRAC_ServiceContext;
00026 
00030   class AIRRAC_Service {  
00031   public:
00032     // ////////////////// Constructors and Destructors //////////////////
00033 
00045     AIRRAC_Service (const stdair::BasLogParams&);
00046     
00059     AIRRAC_Service (const stdair::BasLogParams&, const stdair::BasDBParams&);
00060     
00076     AIRRAC_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr);
00077 
00086     void parseAndLoad (const YieldFilePath& iYieldFilename);
00087 
00088 
00092     ~AIRRAC_Service();
00093 
00094 
00095   public:
00096     // /////////// Business Methods /////////////
00100     void calculateYields (stdair::TravelSolutionList_T&);
00101 
00105     void updateYields(stdair::BomRoot&);
00106 
00113     void buildSampleBom();   
00114 
00118     void clonePersistentBom();  
00119 
00124     void buildComplementaryLinks (stdair::BomRoot&);
00125 
00143     void buildSampleTravelSolutions (stdair::TravelSolutionList_T&);
00144 
00145 
00146   public:
00147     // //////////////// Display support methods /////////////////
00155     std::string csvDisplay() const;
00156 
00164     std::string csvDisplay (const stdair::TravelSolutionList_T&) const;
00165 
00166 
00167   private:
00168     // /////// Construction and Destruction helper methods ///////
00172     AIRRAC_Service();
00173 
00177     AIRRAC_Service (const AIRRAC_Service&);
00178 
00183     void initServiceContext();
00184 
00194     stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&,
00195                                                    const stdair::BasDBParams&);
00196     
00205     stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&);
00206 
00215     void addStdAirService (stdair::STDAIR_ServicePtr_T,
00216                            const bool iOwnStdairService);
00217     
00224     void initAirracService();
00225 
00234     void initAirracService (const YieldFilePath& iYieldFilename);
00235 
00239     void finalise();
00240     
00241 
00242   private:
00243     // ///////// Service Context /////////
00247     AIRRAC_ServiceContext* _airracServiceContext;
00248   };
00249 }
00250 #endif // __AIRRAC_SVC_AIRRAC_SERVICE_HPP