StdAir Logo  0.43.0
C++ Standard Airline IT Library
EventStruct.hpp
Go to the documentation of this file.
00001 #ifndef __STDAIR_BAS_EVENTSTRUCT_HPP
00002 #define __STDAIR_BAS_EVENTSTRUCT_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 // StdAir
00011 #include <stdair/stdair_basic_types.hpp>
00012 #include <stdair/stdair_date_time_types.hpp>
00013 #include <stdair/stdair_event_types.hpp>
00014 #include <stdair/basic/StructAbstract.hpp>
00015 #include <stdair/basic/EventType.hpp>
00016 #include <stdair/bom/EventTypes.hpp>
00017 #include <stdair/bom/BookingRequestTypes.hpp>
00018 #include <stdair/bom/OptimisationNotificationTypes.hpp>
00019 #include <stdair/bom/SnapshotTypes.hpp>
00020 #include <stdair/bom/CancellationTypes.hpp>
00021 #include <stdair/bom/RMEventTypes.hpp>
00022 
00023 namespace stdair {
00024 
00035   struct EventStruct : public StructAbstract {
00036     // Friend classes and structures
00037     friend struct EventQueue;
00038 
00039     // ///////////// Getters ///////////
00040   public:
00042     const EventType::EN_EventType& getEventType() const {
00043       return _eventType;
00044     }
00045 
00052     const BookingRequestStruct& getBookingRequest() const {
00053       assert (_bookingRequest != NULL);
00054       return *_bookingRequest;
00055     }
00056 
00063     const CancellationStruct& getCancellation() const {
00064       assert (_cancellation != NULL);
00065       return *_cancellation;
00066     }
00067 
00075     const OptimisationNotificationStruct&
00076     getOptimisationNotificationStruct() const {
00077       assert (_optimisationNotification != NULL);
00078       return *_optimisationNotification;
00079     }
00080     
00088     const SnapshotStruct& getSnapshotStruct() const {
00089       assert (_snapshot != NULL);
00090       return *_snapshot;
00091     }
00092     
00100     const RMEventStruct& getRMEvent() const {
00101       assert (_rmEvent != NULL);
00102       return *_rmEvent;
00103     }
00104 
00105     // ////////// Display methods //////////
00106   public:
00109     void fromStream (std::istream& ioIn);
00110 
00112     const std::string describe() const;
00113 
00114     
00115     // ////////// Constructors and destructors /////////
00116   public:
00118     EventStruct();
00120     EventStruct (const EventType::EN_EventType&, BookingRequestPtr_T);
00122     EventStruct (const EventType::EN_EventType&, CancellationPtr_T);
00124     EventStruct (const EventType::EN_EventType&, const DateTime_T& iDCPDate,
00125                  OptimisationNotificationPtr_T);
00127     EventStruct (const EventType::EN_EventType&, SnapshotPtr_T);
00129     EventStruct (const EventType::EN_EventType&, RMEventPtr_T);
00131     EventStruct (const EventStruct&);
00132 
00134     ~EventStruct();
00135 
00136     
00137     // ////////////////// Attributes //////////////////
00138   private:
00142     EventType::EN_EventType _eventType;
00143 
00149     LongDuration_T _eventTimeStamp;
00150     
00154     BookingRequestPtr_T _bookingRequest;
00155     
00159     CancellationPtr_T _cancellation;
00160 
00164     OptimisationNotificationPtr_T _optimisationNotification;
00165 
00169     SnapshotPtr_T _snapshot;
00170 
00174     RMEventPtr_T _rmEvent;
00175   };
00176 
00177 }
00178 #endif // __STDAIR_BAS_EVENTSTRUCT_HPP