$treeview $search $mathjax
SimCRS Logo  1.01.1
$projectbrief
$projectbrief
$searchbox

SIMCRS_ServiceContext.hpp

Go to the documentation of this file.
00001 #ifndef __SIMCRS_SVC_SIMCRSSERVICECONTEXT_HPP
00002 #define __SIMCRS_SVC_SIMCRSSERVICECONTEXT_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <string>
00009 #include <map>
00010 // Boost
00011 #include <boost/shared_ptr.hpp>
00012 // StdAir
00013 #include <stdair/stdair_basic_types.hpp>
00014 #include <stdair/stdair_service_types.hpp>
00015 // SEvMgr
00016 #include <sevmgr/SEVMGR_Types.hpp>
00017 // AirInv
00018 #include <airinv/AIRINV_Types.hpp>
00019 // AirTSP
00020 #include <airtsp/AIRTSP_Types.hpp>
00021 // SimFQT
00022 #include <simfqt/SIMFQT_Types.hpp>
00023 // SimCRS
00024 #include <simcrs/SIMCRS_Types.hpp>
00025 #include <simcrs/service/ServiceAbstract.hpp>
00026 
00027 namespace SIMCRS {
00028 
00032   class SIMCRS_ServiceContext : public ServiceAbstract {
00038     friend class SIMCRS_Service;
00039     friend class FacSimcrsServiceContext;
00040     
00041   private:
00042     // ///////////////// Getters ///////////////////
00048     const CRSCode_T& getCRSCode() const {
00049       return _CRSCode;
00050     }
00051 
00055     stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
00056       return _stdairService;
00057     }
00058 
00062     stdair::STDAIR_Service& getSTDAIR_Service() const {
00063       assert (_stdairService != NULL);
00064       return *_stdairService;
00065     }
00066 
00070     const bool getOwnStdairServiceFlag() const {
00071       return _ownStdairService;
00072     }  
00073 
00077     SEVMGR::SEVMGR_ServicePtr_T getSEVMGR_ServicePtr() const {
00078       return _sevmgrService;
00079     }
00080 
00084     SEVMGR::SEVMGR_Service& getSEVMGR_Service() const {
00085       assert (_sevmgrService != NULL);
00086       return *_sevmgrService;
00087     } 
00088 
00092     const bool getOwnSEVMGRServiceFlag() const {
00093       return _ownSEVMGRService;
00094     }  
00095 
00099     AIRINV::AIRINV_Master_Service& getAIRINV_Service() const {
00100       assert (_airinvService != NULL);
00101       return *_airinvService;
00102     }
00103 
00107     AIRTSP::AIRTSP_Service& getAIRTSP_Service() const {
00108       assert (_airtspService != NULL);
00109       return *_airtspService;
00110     }
00111 
00115     SIMFQT::SIMFQT_Service& getSIMFQT_Service() const {
00116       assert (_simfqtService != NULL);
00117       return *_simfqtService;
00118     }
00119 
00120 
00121   private:
00122     // ///////////////// Setters ///////////////////
00126     void setCRSCode (const CRSCode_T& iCRSCode) {
00127       _CRSCode = iCRSCode;
00128     }
00129 
00133     void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
00134                             const bool iOwnStdairService) {
00135       _stdairService = ioSTDAIR_ServicePtr;
00136       _ownStdairService = iOwnStdairService;
00137     }
00138 
00142     void setSEVMGR_Service (SEVMGR::SEVMGR_ServicePtr_T ioSEVMGR_ServicePtr,
00143                             const bool iOwnSEVMGRService) {
00144       _sevmgrService = ioSEVMGR_ServicePtr;
00145       _ownSEVMGRService = iOwnSEVMGRService;
00146     }
00147     
00151     void setAIRINV_Service (AIRINV::AIRINV_Master_ServicePtr_T ioServicePtr) {
00152       _airinvService = ioServicePtr;
00153     }
00154     
00158     void setAIRTSP_Service (AIRTSP::AIRTSP_ServicePtr_T ioServicePtr) {
00159       _airtspService = ioServicePtr;
00160     }
00161     
00165     void setSIMFQT_Service (SIMFQT::SIMFQT_ServicePtr_T ioServicePtr) {
00166       _simfqtService = ioServicePtr;
00167     }
00168     
00169 
00170   private:
00171     // //////////////////// Display Methods /////////////////////
00175     const std::string shortDisplay() const;
00176     
00180     const std::string display() const;
00181     
00185     const std::string describe() const;
00186 
00187 
00188   private:
00190 
00193     SIMCRS_ServiceContext (const CRSCode_T& iCRSCode);
00197     SIMCRS_ServiceContext();
00201     SIMCRS_ServiceContext (const SIMCRS_ServiceContext&);
00202 
00206     ~SIMCRS_ServiceContext();
00207 
00211     void reset();
00212 
00213 
00214   private:
00218     stdair::STDAIR_ServicePtr_T _stdairService;
00219 
00223     bool _ownStdairService;   
00224 
00228     SEVMGR::SEVMGR_ServicePtr_T _sevmgrService;  
00229 
00233     bool _ownSEVMGRService;   
00234 
00238     AIRTSP::AIRTSP_ServicePtr_T _airtspService;
00239 
00243     AIRINV::AIRINV_Master_ServicePtr_T _airinvService;
00244 
00248     SIMFQT::SIMFQT_ServicePtr_T _simfqtService;
00249 
00250     
00251   private:
00252     // /////////////// Attributes //////////////////
00258     CRSCode_T _CRSCode;
00259   };
00260   
00261 }
00262 #endif // __SIMCRS_SVC_SIMCRSSERVICECONTEXT_HPP