AirRAC Logo  0.2.3
C++ Simulated Revenue Accounting (RAC) System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
AIRRAC_Service.hpp
Go to the documentation of this file.
1 #ifndef __AIRRAC_SVC_AIRRAC_SERVICE_HPP
2 #define __AIRRAC_SVC_AIRRAC_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 // AirRAC
12 #include <airrac/AIRRAC_Types.hpp>
13 
14 // Forward declarations.
15 namespace stdair {
16  class STDAIR_Service;
17  struct BasLogParams;
18  struct BasDBParams;
19 }
20 
21 namespace AIRRAC {
22 
25 
29  class AIRRAC_Service {
30  public:
31  // ////////////////// Constructors and Destructors //////////////////
32 
44  AIRRAC_Service (const stdair::BasLogParams&);
45 
58  AIRRAC_Service (const stdair::BasLogParams&, const stdair::BasDBParams&);
59 
75  AIRRAC_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr);
76 
85  void parseAndLoad (const YieldFilePath& iYieldFilename);
86 
87 
92 
93 
94  public:
95  // /////////// Business Methods /////////////
99  void calculateYields (stdair::TravelSolutionList_T&);
100 
104  void updateYields();
105 
112  void buildSampleBom();
113 
131  void buildSampleTravelSolutions (stdair::TravelSolutionList_T&);
132 
133 
134  public:
135  // //////////////// Display support methods /////////////////
143  std::string csvDisplay() const;
144 
152  std::string csvDisplay (const stdair::TravelSolutionList_T&) const;
153 
154 
155  private:
156  // /////// Construction and Destruction helper methods ///////
160  AIRRAC_Service();
161 
166 
171  void initServiceContext();
172 
182  stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&,
183  const stdair::BasDBParams&);
184 
193  stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&);
194 
203  void addStdAirService (stdair::STDAIR_ServicePtr_T,
204  const bool iOwnStdairService);
205 
212  void initAirracService();
213 
222  void initAirracService (const YieldFilePath& iYieldFilename);
223 
227  void finalise();
228 
229 
230  private:
231  // ///////// Service Context /////////
235  AIRRAC_ServiceContext* _airracServiceContext;
236  };
237 }
238 #endif // __AIRRAC_SVC_AIRRAC_SERVICE_HPP