7 #if BOOST_VERSION >= 103900
8 #include <boost/make_shared.hpp>
9 #else // BOOST_VERSION >= 103900
10 #include <boost/shared_ptr.hpp>
11 #endif // BOOST_VERSION >= 103900
27 : _eventType (
EventType::BKG_REQ), _eventTimeStamp (0) {
33 : _eventType (iEventType) {
36 assert (ioRequestPtr != NULL);
37 #if BOOST_VERSION >= 103900
38 _bookingRequest = boost::make_shared<BookingRequestStruct> (*ioRequestPtr);
39 #else // BOOST_VERSION >= 103900
40 _bookingRequest = ioRequestPtr;
41 #endif // BOOST_VERSION >= 103900
42 assert (_bookingRequest != NULL);
51 _eventTimeStamp = lDuration.total_milliseconds();
57 : _eventType (iEventType) {
60 assert (ioCancellationPtr != NULL);
61 #if BOOST_VERSION >= 103900
62 _cancellation = boost::make_shared<CancellationStruct> (*ioCancellationPtr);
63 #else // BOOST_VERSION >= 103900
64 _cancellation = ioCancellationPtr;
65 #endif // BOOST_VERSION >= 103900
66 assert (_cancellation != NULL);
75 _eventTimeStamp = lDuration.total_milliseconds();
83 : _eventType (iEventType) {
86 assert (ioOptimisationNotificationPtr != NULL);
87 #if BOOST_VERSION >= 103900
88 _optimisationNotification =
89 boost::make_shared<OptimisationNotificationStruct> (*ioOptimisationNotificationPtr);
90 #else // BOOST_VERSION >= 103900
91 _optimisationNotification = ioOptimisationNotificationPtr;
92 #endif // BOOST_VERSION >= 103900
93 assert (_optimisationNotification != NULL);
101 _eventTimeStamp = lDuration.total_milliseconds();
107 : _eventType (iEventType) {
110 assert (ioSnapshotPtr != NULL);
112 #if BOOST_VERSION >= 103900
113 _snapshot = boost::make_shared<SnapshotStruct> (*ioSnapshotPtr);
114 #else // BOOST_VERSION >= 103900
115 _snapshot = ioSnapshotPtr;
116 #endif // BOOST_VERSION >= 103900
117 assert (_snapshot != NULL);
126 _eventTimeStamp = lDuration.total_milliseconds();
132 : _eventType (iEventType) {
135 assert (ioRMEventPtr != NULL);
137 #if BOOST_VERSION >= 103900
138 _rmEvent = boost::make_shared<RMEventStruct> (*ioRMEventPtr);
139 #else // BOOST_VERSION >= 103900
140 _rmEvent = ioRMEventPtr;
141 #endif // BOOST_VERSION >= 103900
142 assert (_rmEvent != NULL);
151 _eventTimeStamp = lDuration.total_milliseconds();
157 : _eventType (iEventType) {
160 assert (ioBreakPointPtr != NULL);
162 #if BOOST_VERSION >= 103900
163 _breakPoint = boost::make_shared<BreakPointStruct> (*ioBreakPointPtr);
164 #else // BOOST_VERSION >= 103900
165 _breakPoint = ioBreakPointPtr;
166 #endif // BOOST_VERSION >= 103900
167 assert (_breakPoint != NULL);
176 _eventTimeStamp = lDuration.total_milliseconds();
181 : _eventType (iEventStruct._eventType),
182 _eventTimeStamp (iEventStruct._eventTimeStamp) {
185 if (iEventStruct._bookingRequest != NULL) {
186 #if BOOST_VERSION >= 103900
188 boost::make_shared<BookingRequestStruct>(*iEventStruct._bookingRequest);
189 #else // BOOST_VERSION >= 103900
190 _bookingRequest = iEventStruct._bookingRequest;
191 #endif // BOOST_VERSION >= 103900
195 if (iEventStruct._cancellation != NULL) {
196 #if BOOST_VERSION >= 103900
198 boost::make_shared<CancellationStruct>(*iEventStruct._cancellation);
199 #else // BOOST_VERSION >= 103900
200 _cancellation = iEventStruct._cancellation;
201 #endif // BOOST_VERSION >= 103900
205 if (iEventStruct._optimisationNotification != NULL) {
206 #if BOOST_VERSION >= 103900
207 _optimisationNotification =
208 boost::make_shared<OptimisationNotificationStruct> (*iEventStruct._optimisationNotification);
209 #else // BOOST_VERSION >= 103900
210 _optimisationNotification = iEventStruct._optimisationNotification;
211 #endif // BOOST_VERSION >= 103900
215 if (iEventStruct._snapshot != NULL) {
216 #if BOOST_VERSION >= 103900
217 _snapshot = boost::make_shared<SnapshotStruct> (*iEventStruct._snapshot);
218 #else // BOOST_VERSION >= 103900
219 _snapshot = iEventStruct._snapshot;
220 #endif // BOOST_VERSION >= 103900
224 if (iEventStruct._rmEvent != NULL) {
225 #if BOOST_VERSION >= 103900
226 _rmEvent = boost::make_shared<RMEventStruct> (*iEventStruct._rmEvent);
227 #else // BOOST_VERSION >= 103900
228 _rmEvent = iEventStruct._rmEvent;
229 #endif // BOOST_VERSION >= 103900
233 if (iEventStruct._breakPoint != NULL) {
234 #if BOOST_VERSION >= 103900
235 _breakPoint = boost::make_shared<BreakPointStruct> (*iEventStruct._breakPoint);
236 #else // BOOST_VERSION >= 103900
237 _breakPoint = iEventStruct._breakPoint;
238 #endif // BOOST_VERSION >= 103900
252 std::ostringstream oStr;
256 boost::posix_time::milliseconds (_eventTimeStamp);
258 + lEventDateTimeDelta);
260 oStr << lEventDateTime;
263 switch (_eventType) {
265 assert (_bookingRequest != NULL);
267 <<
", " << _bookingRequest->describe();
271 assert (_cancellation != NULL);
273 <<
", " << _cancellation->describe();
277 assert (_optimisationNotification != NULL);
279 <<
", " << _optimisationNotification->describe();
283 assert (_snapshot != NULL);
285 <<
", " << _snapshot->describe();
289 assert (_rmEvent != NULL);
291 <<
", " << _rmEvent->describe();
295 assert (_breakPoint != NULL);
297 <<
", " << _breakPoint->describe();
301 oStr <<
", " << _eventType <<
" (not yet recognised)";
315 switch (_eventType) {
317 assert (_bookingRequest != NULL);
318 return _bookingRequest->getRequestDateTime();
322 assert (_cancellation != NULL);
323 return _cancellation->getCancellationDateTime() ;
327 assert (_optimisationNotification != NULL);
328 return _optimisationNotification->getNotificationDateTime();
332 assert (_snapshot != NULL);
333 return _snapshot->getSnapshotTime();
337 assert (_rmEvent != NULL);
338 return _rmEvent->getRMEventTime();
342 assert (_breakPoint != NULL);
343 return _breakPoint->getBreakPointTime();