$treeview $search $mathjax
00001 #ifndef __SEVMGR_SEVMGR_SERVICE_HPP 00002 #define __SEVMGR_SEVMGR_SERVICE_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // StdAir 00008 #include <stdair/stdair_basic_types.hpp> 00009 #include <stdair/stdair_json.hpp> 00010 #include <stdair/stdair_service_types.hpp> 00011 #include <stdair/bom/EventTypes.hpp> 00012 #include <stdair/bom/EventStruct.hpp> 00013 00014 // Forward declarations 00015 namespace stdair { 00016 struct ProgressStatusSet; 00017 struct BasLogParams; 00018 struct BasDBParams; 00019 struct BookingRequestStruct; 00020 } 00021 00022 namespace SEVMGR { 00023 00025 class SEVMGR_ServiceContext; 00026 class EventQueue; 00027 //struct EventStruct; 00028 00032 class SEVMGR_Service { 00033 public: 00034 // ////////////////// Constructors and Destructors ////////////////// 00050 SEVMGR_Service (const stdair::BasLogParams&, const stdair::BasDBParams&); 00051 00063 SEVMGR_Service (const stdair::BasLogParams&); 00064 00080 SEVMGR_Service (stdair::STDAIR_ServicePtr_T); 00081 00085 ~SEVMGR_Service(); 00086 00087 00088 public: 00089 // ////////////////// Business support methods ////////////////// 00093 void buildSampleQueue(); 00094 00125 stdair::BookingRequestStruct buildSampleBookingRequest(const bool isForCRS = false); 00126 00143 stdair::ProgressStatusSet popEvent (stdair::EventStruct&) const; 00144 00145 00153 void run (stdair::EventStruct&) const; 00154 00169 bool select (stdair::EventStruct&, 00170 const stdair::DateTime_T&) const; 00171 00180 template<class EventGenerator> 00181 void addEventGenerator(EventGenerator& iEventGenerator) const; 00182 00186 void addEvent(stdair::EventStruct&) const; 00187 00192 void reset() const; 00193 00203 void updateStatus (const stdair::EventType::EN_EventType&, 00204 const stdair::Count_T&) const; 00205 00215 void addStatus (const stdair::EventType::EN_EventType&, 00216 const stdair::Count_T&) const; 00217 00223 bool isQueueDone() const; 00224 00229 bool hasProgressStatus(const stdair::EventType::EN_EventType&) const; 00230 00231 /* @brief Get a reference on the EventQueue object. 00232 * 00233 * @return EventQueue& Reference on the EventQueue. 00234 */ 00235 EventQueue& getEventQueue() const; 00236 00240 const stdair::Count_T& getQueueSize() const; 00241 00251 template<class EventGenerator, class Key> 00252 EventGenerator& getEventGenerator(const Key& iKey) const; 00253 00263 template<class EventGenerator, class Key> 00264 bool hasEventGenerator(const Key& iKey) const; 00265 00275 template<class EventGenerator> 00276 const std::list<EventGenerator*> getEventGeneratorList() const; 00277 00287 template<class EventGenerator> 00288 bool hasEventGeneratorList() const; 00289 00304 const stdair::Count_T& getExpectedTotalNumberOfEventsToBeGenerated() const; 00305 00322 const stdair::Count_T& 00323 getExpectedTotalNumberOfEventsToBeGenerated(const stdair::EventType::EN_EventType&) const; 00324 00337 const stdair::Count_T& getActualTotalNumberOfEventsToBeGenerated() const; 00338 00355 const stdair::Count_T& 00356 getActualTotalNumberOfEventsToBeGenerated(const stdair::EventType::EN_EventType&) const; 00357 00361 const stdair::ProgressStatus& getStatus () const; 00362 00367 const stdair::ProgressStatus& getStatus (const stdair::EventType::EN_EventType&) const; 00368 00369 public: 00370 // //////////////// Display support methods ///////////////// 00371 00378 std::string describeKey() const; 00379 00386 std::string list () const; 00387 00397 std::string list (const stdair::EventType::EN_EventType&) const; 00398 00399 public: 00400 // //////////////// Export support methods ///////////////// 00409 std::string jsonHandler (const stdair::JSONString&) const; 00410 00415 std::string jsonExportEventQueue (const stdair::EventType::EN_EventType& = 00416 stdair::EventType::LAST_VALUE) const; 00417 00421 std::string jsonExportEvent (const stdair::EventStruct&) const; 00422 00423 private: 00424 // ////////////////// Constructors and Destructors ////////////////// 00428 SEVMGR_Service(); 00429 00433 SEVMGR_Service (const SEVMGR_Service&); 00434 00439 void initServiceContext(); 00440 00452 stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&, 00453 const stdair::BasDBParams&); 00454 00464 stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&); 00465 00474 void addStdAirService (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr, 00475 const bool iOwnStdairService); 00476 00483 void initSevmgrService(); 00484 00488 void finalise(); 00489 00490 private: 00491 // ////////////////// Getters ////////////////// 00498 const stdair::STDAIR_Service& getSTDAIR_Service() const; 00499 00500 private: 00501 // ///////// Service Context ///////// 00505 SEVMGR_ServiceContext* _sevmgrServiceContext; 00506 }; 00507 00508 } 00509 #endif // __SEVMGR_SEVMGR_SERVICE_HPP