Go to the documentation of this file.00001 #ifndef __TRADEMGEN_SVC_TRADEMGENSERVICECONTEXT_HPP
00002 #define __TRADEMGEN_SVC_TRADEMGENSERVICECONTEXT_HPP
00003
00004
00005
00006
00007
00008 #include <string>
00009
00010 #include <stdair/stdair_basic_types.hpp>
00011 #include <stdair/stdair_service_types.hpp>
00012 #include <stdair/basic/RandomGeneration.hpp>
00013 #include <stdair/bom/BookingRequestTypes.hpp>
00014 #include <stdair/service/ServiceAbstract.hpp>
00015
00016 #include <trademgen/TRADEMGEN_Types.hpp>
00017 #include <trademgen/basic/DemandCharacteristicsTypes.hpp>
00018
00019
00020 namespace stdair {
00021 struct DemandCharacteristics;
00022 struct DemandDistribution;
00023 }
00024
00025 namespace TRADEMGEN {
00026
00030 class TRADEMGEN_ServiceContext : public stdair::ServiceAbstract {
00036 friend class TRADEMGEN_Service;
00037 friend class FacTRADEMGENServiceContext;
00038
00039 private:
00040
00044 stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
00045 return _stdairService;
00046 }
00047
00051 stdair::STDAIR_Service& getSTDAIR_Service() const {
00052 assert (_stdairService != NULL);
00053 return *_stdairService;
00054 }
00055
00059 const bool getOwnStdairServiceFlag() const {
00060 return _ownStdairService;
00061 }
00062
00066 stdair::RandomGeneration& getUniformGenerator() {
00067 return _uniformGenerator;
00068 }
00069
00073 const POSProbabilityMass_T& getPOSProbabilityMass() const {
00074 return _posProbabilityMass;
00075 }
00076
00077
00078 private:
00079
00083 void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
00084 const bool iOwnStdairService) {
00085 _stdairService = ioSTDAIR_ServicePtr;
00086 _ownStdairService = iOwnStdairService;
00087 }
00088
00089
00090 private:
00091
00095 const std::string shortDisplay() const;
00096
00100 const std::string display() const;
00101
00105 const std::string describe() const;
00106
00107
00108 private:
00110
00113 TRADEMGEN_ServiceContext (const stdair::RandomSeed_T&);
00117 TRADEMGEN_ServiceContext();
00121 TRADEMGEN_ServiceContext (const TRADEMGEN_ServiceContext&);
00122
00126 ~TRADEMGEN_ServiceContext();
00127
00131 void reset();
00132
00133
00134 private:
00135
00139 stdair::STDAIR_ServicePtr_T _stdairService;
00140
00144 bool _ownStdairService;
00145
00146
00147 private:
00148
00155 stdair::RandomGeneration _uniformGenerator;
00156
00160 const POSProbabilityMass_T _posProbabilityMass;
00161 };
00162
00163 }
00164 #endif // __TRADEMGEN_SVC_TRADEMGENSERVICECONTEXT_HPP