StdAir Logo  1.00.12
C++ Standard Airline IT Object Library
TimePeriodKey.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <ostream>
6#include <sstream>
7// STDAIR
10
11namespace stdair {
12
13 // ////////////////////////////////////////////////////////////////////
14 TimePeriodKey::TimePeriodKey ()
15 : _timeRangeStart (DEFAULT_EPSILON_DURATION),
16 _timeRangeEnd (DEFAULT_EPSILON_DURATION) {
17 assert (false);
18 }
19
20 // ////////////////////////////////////////////////////////////////////
21 TimePeriodKey::TimePeriodKey (const Time_T& iTimeRangeStart,
22 const Time_T& iTimeRangeEnd)
23 : _timeRangeStart(iTimeRangeStart),
24 _timeRangeEnd(iTimeRangeEnd) {
25 }
26
27 // ////////////////////////////////////////////////////////////////////
28 TimePeriodKey::TimePeriodKey (const TimePeriodKey& iKey)
29 : _timeRangeStart(iKey.getTimeRangeStart()),
30 _timeRangeEnd(iKey.getTimeRangeEnd()) {
31 }
32
33 // ////////////////////////////////////////////////////////////////////
35 }
36
37 // ////////////////////////////////////////////////////////////////////
38 void TimePeriodKey::toStream (std::ostream& ioOut) const {
39 ioOut << "TimePeriodKey: " << toString() << std::endl;
40 }
41
42 // ////////////////////////////////////////////////////////////////////
43 void TimePeriodKey::fromStream (std::istream& ioIn) {
44 }
45
46 // ////////////////////////////////////////////////////////////////////
47 const std::string TimePeriodKey::toString() const {
48 std::ostringstream oStr;
49 oStr << _timeRangeStart << "-" << _timeRangeEnd;
50 return oStr.str();
51 }
52
53}
Handle on the StdAir library context.
boost::posix_time::time_duration Time_T
const Duration_T DEFAULT_EPSILON_DURATION
Key of time-period.
const std::string toString() const
void toStream(std::ostream &ioOut) const
void fromStream(std::istream &ioIn)