$treeview $search $mathjax
TraDemGen Logo  1.00.2
$projectbrief
$projectbrief
$searchbox

TRADEMGEN_ServiceContext.hpp

Go to the documentation of this file.
00001 #ifndef __TRADEMGEN_SVC_TRADEMGENSERVICECONTEXT_HPP
00002 #define __TRADEMGEN_SVC_TRADEMGENSERVICECONTEXT_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <string>
00009 // Boost
00010 #include <boost/shared_ptr.hpp>
00011 // StdAir
00012 #include <stdair/stdair_basic_types.hpp>
00013 #include <stdair/stdair_service_types.hpp>
00014 #include <stdair/basic/RandomGeneration.hpp>
00015 #include <stdair/bom/BookingRequestTypes.hpp>
00016 #include <stdair/service/ServiceAbstract.hpp>
00017 // SEvMgr
00018 #include <sevmgr/SEVMGR_Types.hpp>
00019 // TraDemGen
00020 #include <trademgen/TRADEMGEN_Types.hpp>
00021 #include <trademgen/basic/DemandCharacteristicsTypes.hpp>
00022 
00023 // Forward declarations
00024 namespace stdair {
00025   struct DemandCharacteristics;
00026   struct DemandDistribution;
00027 }
00028   
00029 namespace TRADEMGEN {
00030 
00034   class TRADEMGEN_ServiceContext : public stdair::ServiceAbstract {
00040     friend class TRADEMGEN_Service;
00041     friend class FacTRADEMGENServiceContext;
00042     
00043   private:
00044     // ///////// Getters //////////
00048     stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
00049       return _stdairService;
00050     }
00051 
00055     stdair::STDAIR_Service& getSTDAIR_Service() const {
00056       assert (_stdairService != NULL);
00057       return *_stdairService;
00058     }
00059 
00063     const bool getOwnStdairServiceFlag() const {
00064       return _ownStdairService;
00065     }
00066 
00070     stdair::RandomGeneration& getUniformGenerator() {
00071       return _uniformGenerator;
00072     }
00073 
00077     const POSProbabilityMass_T& getPOSProbabilityMass() const {
00078       return _posProbabilityMass;
00079     }
00080 
00084     SEVMGR::SEVMGR_ServicePtr_T getSEVMGR_ServicePtr() const {
00085       return _sevmgrService;
00086     }
00087 
00091     SEVMGR::SEVMGR_Service& getSEVMGR_Service() const {
00092       assert (_sevmgrService != NULL);
00093       return *_sevmgrService;
00094     }
00095 
00096     
00097   private:
00098     // ///////// Setters //////////
00102     void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
00103                             const bool iOwnStdairService) {
00104       _stdairService = ioSTDAIR_ServicePtr;
00105       _ownStdairService = iOwnStdairService;
00106     }
00107 
00111     void setSEVMGR_Service (SEVMGR::SEVMGR_ServicePtr_T ioSEVMGR_ServicePtr) {
00112       _sevmgrService = ioSEVMGR_ServicePtr;
00113     }
00114 
00115     
00116   private:
00117     // ///////// Display Methods //////////
00121     const std::string shortDisplay() const;
00122     
00126     const std::string display() const;
00127     
00131     const std::string describe() const;
00132 
00133     
00134   private:
00136 
00139     TRADEMGEN_ServiceContext (const stdair::RandomSeed_T&);
00143     TRADEMGEN_ServiceContext();
00147     TRADEMGEN_ServiceContext (const TRADEMGEN_ServiceContext&);
00148 
00152     ~TRADEMGEN_ServiceContext();
00153 
00157     void reset();
00158 
00159     
00160   private:
00161     // /////////////// Children ///////////////
00165     stdair::STDAIR_ServicePtr_T _stdairService;
00166 
00170     SEVMGR::SEVMGR_ServicePtr_T _sevmgrService;
00171 
00175     bool _ownStdairService;
00176 
00177 
00178   private:
00179     // ////////////// Attributes ////////////////
00186     stdair::RandomGeneration _uniformGenerator;
00187 
00191     const POSProbabilityMass_T _posProbabilityMass;
00192   };
00193 
00194 }
00195 #endif // __TRADEMGEN_SVC_TRADEMGENSERVICECONTEXT_HPP