Blame view

src/TimeTableCatalog/TimeInterval.hh 1.9 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * 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:

897858c8   Benjamin Renard   Support multi TT ...
23
	TimeInterval(double pstartTime, double pstopTime, int pindex = 0, std::string pttPath = "", std::string pttName = "", int pttTotalIntervals = 0);
fbe3c2bb   Benjamin Renard   First commit
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

	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 &paramKey, const std::vector<std::string> &paramValues);

	/**
	 * Retrieve value associated with a parameter key
	 */
	std::vector<std::string> & getParameterData (const std::string &paramKey);

	/**
	 * 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;

897858c8   Benjamin Renard   Support multi TT ...
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
	/**
	 * Interval TT origin path
	 */
	std::string _ttPath;

	/**
	 * Interval TT origin name
	 */
	std::string _ttName;

	/**
	 * Nb intervals in TT origin
	 */
	int _ttTotalIntervals;

fbe3c2bb   Benjamin Renard   First commit
83
84
85
86
87
88
89
90
91
92
93
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_ */