class holding the services related to Travel Demand Generation. More...
#include <sevmgr/SEVMGR_Service.hpp>
Public Member Functions | |
SEVMGR_Service (const stdair::BasLogParams &, const stdair::BasDBParams &) | |
Constructor. | |
SEVMGR_Service (const stdair::BasLogParams &) | |
SEVMGR_Service (stdair::STDAIR_ServicePtr_T) | |
~SEVMGR_Service () | |
void | buildSampleQueue () |
stdair::BookingRequestStruct | buildSampleBookingRequest (const bool isForCRS=false) |
stdair::ProgressStatusSet | popEvent (stdair::EventStruct &) const |
void | run (stdair::EventStruct &) const |
bool | select (stdair::EventStruct &, const stdair::DateTime_T &) const |
template<class EventGenerator > | |
void | addEventGenerator (EventGenerator &iEventGenerator) const |
void | addEvent (stdair::EventStruct &) const |
void | reset () const |
void | updateStatus (const stdair::EventType::EN_EventType &, const stdair::Count_T &) const |
void | addStatus (const stdair::EventType::EN_EventType &, const stdair::Count_T &) const |
bool | isQueueDone () const |
bool | hasProgressStatus (const stdair::EventType::EN_EventType &) const |
EventQueue & | getEventQueue () const |
const stdair::Count_T & | getQueueSize () const |
template<class EventGenerator , class Key > | |
EventGenerator & | getEventGenerator (const Key &iKey) const |
template<class EventGenerator , class Key > | |
bool | hasEventGenerator (const Key &iKey) const |
template<class EventGenerator > | |
const std::list< EventGenerator * > | getEventGeneratorList () const |
template<class EventGenerator > | |
bool | hasEventGeneratorList () const |
const stdair::Count_T & | getExpectedTotalNumberOfEventsToBeGenerated () const |
const stdair::Count_T & | getExpectedTotalNumberOfEventsToBeGenerated (const stdair::EventType::EN_EventType &) const |
const stdair::Count_T & | getActualTotalNumberOfEventsToBeGenerated () const |
const stdair::Count_T & | getActualTotalNumberOfEventsToBeGenerated (const stdair::EventType::EN_EventType &) const |
const stdair::ProgressStatus & | getStatus () const |
const stdair::ProgressStatus & | getStatus (const stdair::EventType::EN_EventType &) const |
std::string | describeKey () const |
std::string | list () const |
std::string | list (const stdair::EventType::EN_EventType &) const |
std::string | jsonHandler (const stdair::JSONString &) const |
std::string | jsonExportEventQueue (const stdair::EventType::EN_EventType &=stdair::EventType::LAST_VALUE) const |
std::string | jsonExportEvent (const stdair::EventStruct &) const |
class holding the services related to Travel Demand Generation.
Definition at line 32 of file SEVMGR_Service.hpp.
SEVMGR::SEVMGR_Service::SEVMGR_Service | ( | const stdair::BasLogParams & | iLogParams, |
const stdair::BasDBParams & | iDBParams | ||
) |
Constructor.
The initSevmgrService() method is called; see the corresponding documentation for more details.
A reference on an output stream is given, so that log outputs can be directed onto that stream.
Moreover, database connection parameters are given, so that a session can be created on the corresponding database.
const | stdair::BasLogParams& Parameters for the output log stream. |
const | stdair::BasDBParams& Parameters for the database access. |
Definition at line 43 of file SEVMGR_Service.cpp.
SEVMGR::SEVMGR_Service::SEVMGR_Service | ( | const stdair::BasLogParams & | iLogParams | ) |
Constructor.
The initSevmgrService() method is called; see the corresponding documentation for more details.
A reference on an output stream is given, so that log outputs can be directed onto that stream.
const | stdair::BasLogParams& Parameters for the output log stream. |
Definition at line 64 of file SEVMGR_Service.cpp.
SEVMGR::SEVMGR_Service::SEVMGR_Service | ( | stdair::STDAIR_ServicePtr_T | ioSTDAIR_Service_ptr | ) |
Constructor.
The initSevmgrService() method is called; see the corresponding documentation for more details.
Moreover, as no reference on any output stream is given, neither any database access parameter is given, it is assumed that the StdAir log service has already been initialised with the proper log output stream by some other methods in the calling chain (for instance, when the SEVMGR_Service is itself being initialised by another library service such as TVLSIM_Service).
stdair::STDAIR_ServicePtr_T | Handler on the STDAIR_Service. |
Definition at line 85 of file SEVMGR_Service.cpp.
SEVMGR::SEVMGR_Service::~SEVMGR_Service | ( | ) |
Destructor.
Definition at line 101 of file SEVMGR_Service.cpp.
void SEVMGR::SEVMGR_Service::buildSampleQueue | ( | ) |
Build a sample event queue.
Definition at line 175 of file SEVMGR_Service.cpp.
Referenced by main().
stdair::BookingRequestStruct SEVMGR::SEVMGR_Service::buildSampleBookingRequest | ( | const bool | isForCRS = false | ) |
Build a sample booking request structure.
As of now (March 2011), the sample booking request is made of the following parameters:
As of now (March 2011), the CRS-related booking request is made of the following parameters:
const | bool isForCRS Whether the sample booking request is for CRS. |
Definition at line 200 of file SEVMGR_Service.cpp.
stdair::ProgressStatusSet SEVMGR::SEVMGR_Service::popEvent | ( | stdair::EventStruct & | iEventStruct | ) | const |
Pop the next coming (in time) event, and remove it from the event queue.
Definition at line 398 of file SEVMGR_Service.cpp.
Referenced by main().
void SEVMGR::SEVMGR_Service::run | ( | stdair::EventStruct & | iEventStruct | ) | const |
Played all events and stopped when the first break point was encountered.
Definition at line 417 of file SEVMGR_Service.cpp.
bool SEVMGR::SEVMGR_Service::select | ( | stdair::EventStruct & | iEventStruct, |
const stdair::DateTime_T & | iEventDateTime | ||
) | const |
Selected the event with the given date time, if such event existed.
const | stdair::DateTime_T Date time of the event to be returned. |
/Note All events occuring before the selected one are played. Thus, the copy returned is the copy of the current first event of the queue.
Definition at line 437 of file SEVMGR_Service.cpp.
void SEVMGR::SEVMGR_Service::addEventGenerator | ( | EventGenerator & | iEventGenerator | ) | const |
Add an event generator to the map holding the children of the queue. Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.
void SEVMGR::SEVMGR_Service::addEvent | ( | stdair::EventStruct & | iEventStruct | ) | const |
Add an event to the queue.
Definition at line 596 of file SEVMGR_Service.cpp.
void SEVMGR::SEVMGR_Service::reset | ( | ) | const |
Reset the context of the event generators for another event generation without having to reparse the demand input file.
Definition at line 561 of file SEVMGR_Service.cpp.
void SEVMGR::SEVMGR_Service::updateStatus | ( | const stdair::EventType::EN_EventType & | iEventType, |
const stdair::Count_T & | iEventCount | ||
) | const |
Update the progress status for the given event type (e.g., booking request, optimisation notification, schedule change, break point).
const | stdair::EventType::EN_EventType& Type of the events for which the actual total count is updated. |
Definition at line 458 of file SEVMGR_Service.cpp.
void SEVMGR::SEVMGR_Service::addStatus | ( | const stdair::EventType::EN_EventType & | iEventType, |
const stdair::Count_T & | iEventCount | ||
) | const |
Initialise the progress statuses for the given event type (e.g., request, snapshot).
const | stdair::EventType::EN_EventType& Type of the events for which the actual total count is updated. |
Definition at line 478 of file SEVMGR_Service.cpp.
bool SEVMGR::SEVMGR_Service::isQueueDone | ( | ) | const |
States whether the event queue has reached the end.
For now, that method states whether the event queue is empty.
Definition at line 497 of file SEVMGR_Service.cpp.
Referenced by main().
bool SEVMGR::SEVMGR_Service::hasProgressStatus | ( | const stdair::EventType::EN_EventType & | iEventType | ) | const |
Check if the event queue has already a progress status for the given event type
Definition at line 519 of file SEVMGR_Service.cpp.
EventQueue & SEVMGR::SEVMGR_Service::getEventQueue | ( | ) | const |
Definition at line 580 of file SEVMGR_Service.cpp.
const stdair::Count_T & SEVMGR::SEVMGR_Service::getQueueSize | ( | ) | const |
Get the size of the queue.
Definition at line 542 of file SEVMGR_Service.cpp.
EventGenerator& SEVMGR::SEVMGR_Service::getEventGenerator | ( | const Key & | iKey | ) | const |
Extract an event generator from the map holding the children of the queue. Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.
bool SEVMGR::SEVMGR_Service::hasEventGenerator | ( | const Key & | iKey | ) | const |
Check whether the event generator object with the given key exists.
Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.
const std::list<EventGenerator*> SEVMGR::SEVMGR_Service::getEventGeneratorList | ( | ) | const |
Extract the event generator list from the map holding the children of the queue. Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.
bool SEVMGR::SEVMGR_Service::hasEventGeneratorList | ( | ) | const |
Check whether there are event generator objects.
Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.
const stdair::Count_T & SEVMGR::SEVMGR_Service::getExpectedTotalNumberOfEventsToBeGenerated | ( | ) | const |
Get the expected number of events to be generated.
The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.
Definition at line 616 of file SEVMGR_Service.cpp.
Referenced by getExpectedTotalNumberOfEventsToBeGenerated().
const stdair::Count_T & SEVMGR::SEVMGR_Service::getExpectedTotalNumberOfEventsToBeGenerated | ( | const stdair::EventType::EN_EventType & | iEventType | ) | const |
Get the expected number of events to be generated for the given event type.
The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.
const | EventType_T& Event type for which the number is calculated. |
Definition at line 636 of file SEVMGR_Service.cpp.
References getExpectedTotalNumberOfEventsToBeGenerated().
const stdair::Count_T & SEVMGR::SEVMGR_Service::getActualTotalNumberOfEventsToBeGenerated | ( | ) | const |
Get the actual number of events to be generated for all the event generators.
The getActualTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.
Definition at line 657 of file SEVMGR_Service.cpp.
Referenced by getActualTotalNumberOfEventsToBeGenerated().
const stdair::Count_T & SEVMGR::SEVMGR_Service::getActualTotalNumberOfEventsToBeGenerated | ( | const stdair::EventType::EN_EventType & | iEventType | ) | const |
Get the expected number of events to be generated for the given event type.
The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.
const | EventType_T& Event type for which the number is calculated. |
Definition at line 678 of file SEVMGR_Service.cpp.
References getActualTotalNumberOfEventsToBeGenerated().
const stdair::ProgressStatus & SEVMGR::SEVMGR_Service::getStatus | ( | ) | const |
Get the overall progress status (for the whole event queue).
Definition at line 715 of file SEVMGR_Service.cpp.
Referenced by getStatus().
const stdair::ProgressStatus & SEVMGR::SEVMGR_Service::getStatus | ( | const stdair::EventType::EN_EventType & | iEventType | ) | const |
Get the progress status for the given event type (e.g., booking request, optimisation notification, schedule change, break point).
Definition at line 736 of file SEVMGR_Service.cpp.
References getStatus().
std::string SEVMGR::SEVMGR_Service::describeKey | ( | ) | const |
Display (dump in the returned string) the key of the event queue.
Definition at line 224 of file SEVMGR_Service.cpp.
std::string SEVMGR::SEVMGR_Service::list | ( | ) | const |
Display (dump in the returned string) the event list of the event queue.
Definition at line 243 of file SEVMGR_Service.cpp.
Referenced by list().
std::string SEVMGR::SEVMGR_Service::list | ( | const stdair::EventType::EN_EventType & | iEventType | ) | const |
Display (dump in the returned string) the event list for the given event type (e.g., booking request, optimisation notification, schedule change, break point).
const | EventType_T& Event type for which the events are displayed |
Definition at line 263 of file SEVMGR_Service.cpp.
References list().
std::string SEVMGR::SEVMGR_Service::jsonHandler | ( | const stdair::JSONString & | iJSONString | ) | const |
Dispatch the JSon command string to the corresponding service.
const | stdair::JSONString& Input string which contained the JSon command string. |
Definition at line 283 of file SEVMGR_Service.cpp.
References jsonExportEventQueue().
std::string SEVMGR::SEVMGR_Service::jsonExportEventQueue | ( | const stdair::EventType::EN_EventType & | iEventType = stdair::EventType::LAST_VALUE | ) | const |
Dump in the returned string and in JSON format the whole list of events queue.
Definition at line 342 of file SEVMGR_Service.cpp.
Referenced by jsonHandler().
std::string SEVMGR::SEVMGR_Service::jsonExportEvent | ( | const stdair::EventStruct & | iEvent | ) | const |
Dump in the returned string and in JSON format the given event.
Definition at line 372 of file SEVMGR_Service.cpp.