TimeInterval.hh
1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* TimeInterval.h
*
* Created on: 5 août 2013
* Author: CS
*/
#ifndef TIMEINTERVAL_H_
#define TIMEINTERVAL_H_
#include <string>
#include <vector>
#include <map>
namespace TimeTableCatalog {
/**
* Time Table interval.
*/
class TimeInterval {
public:
TimeInterval(double pstartTime, double pstopTime, int pindex = 0, std::string pttPath = "", std::string pttName = "", int pttTotalIntervals = 0);
virtual ~TimeInterval();
TimeInterval(const TimeInterval& pCopy);
friend bool operator <(const TimeInterval& lhs, const TimeInterval& rhs) {
return (lhs._startTime < rhs._startTime? true : false);
}
friend bool operator ==(const TimeInterval& lhs, const TimeInterval& rhs) {
return (lhs._startTime == rhs._startTime && lhs._stopTime == rhs._stopTime ? true : false);
}
friend std::ostream& operator <<(std::ostream& os, const TimeInterval& interval);
/**
* Adds a parameter data to the interval
*/
void addParameterData (const std::string ¶mKey, const std::vector<std::string> ¶mValues);
/**
* Retrieve value associated with a parameter key
*/
std::vector<std::string> & getParameterData (const std::string ¶mKey);
std::map<std::string, std::vector<std::string>> getAllParameterData() const;
/**
* Retrievenumber of parameter data associated with the interval
*/
int getParameterDataCount ();
/**
* Interval start time
*/
double _startTime;
/**
* Interval stop time
*/
double _stopTime;
/**
* Interval index - Set only during the load of a TT to retrieve original index
*/
int _index;
/**
* Interval TT origin path
*/
std::string _ttPath;
/**
* Interval TT origin name
*/
std::string _ttName;
/**
* Nb intervals in TT origin
*/
int _ttTotalIntervals;
private :
/**
* Additional parameters data, these data must be described in the catalog
* they are not used in time tables
*/
std::map<std::string, std::vector<std::string>> _parametersData;
};
} /* namespace TimeTableCatalog */
#endif /* TIMEINTERVAL_H_ */