Blame view

src/Info/DataSetInfo.hh 4.29 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
 * DataSetInfo.hh
 *
 *  Created on: Oct 6, 2014
 *      Author: m.mazel
 */

#ifndef DATASETINFO_HH_
#define DATASETINFO_HH_

#include <iostream>
#include <sstream>
#include <map>
c2fa3b5d   Benjamin Renard   Rework of legend ...
14
#include <algorithm>
fbe3c2bb   Benjamin Renard   First commit
15
#include <boost/shared_ptr.hpp>
46ca92d0   Elena.Budnik   add / move header...
16
17
#include <utility>
#include <vector>
fbe3c2bb   Benjamin Renard   First commit
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

namespace AMDA {
namespace Info {

//Info keys for dataset
#define DATASET_ID              "DATASET_ID"
#define DATASET_NAME            "DATASET_NAME"
#define DATASET_DESC            "DATASET_DESCRIPTION"
#define DATASET_SOURCE          "DATASET_SOURCE"
#define DATASET_START           "DATASET_GLOBAL_START"
#define DATASET_STOP            "DATASET_GLOBAL_STOP"
#define DATASET_MIN_SAMP        "DATASET_MIN_SAMPLING"
#define DATASET_MAX_SAMP        "DATASET_MAX_SAMPLING"
#define DATASET_CAVEATS         "DATASET_CAVEATS"
#define DATASET_ACKNOWLEDGEMENT "DATASET_ACKNOWLEDGEMENT"

/**
 * @class DataSetInfo
 * @brief Information about a dataset.
 * @details
 */
class DataSetInfo {
public:
	DataSetInfo () :
		_id(""),
		_name(""),
		_description(""),
		_source(""),
		_globalStart(""),
		_globalStop(""),
		_minSampling(-1),
		_maxSampling(-1),
		_caveats(""),
		_acknowledgement(""),
		_instrumentId("")
	{}

	friend std::ostream& operator<<(std::ostream& out_, const DataSetInfo& dsi);

	/*
	 * @brief Get dataset id
	 */
	const std::string& getId() const {
		return _id;
	}

	/*
	 * @brief Set dataset id
	 */
	void setId(const std::string& id) {
		_id = id;
	}

	/*
fbe3c2bb   Benjamin Renard   First commit
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
	 * @brief Get dataset name
	 */
	const std::string& getName() const {
		return _name;
	}

	/*
	 * @brief Set dataset name
	 */
	void setName(const std::string& name) {
		_name = name;
	}

	/*
	 * @brief Get dataset description
	 */
	const std::string& getDescription() const {
		return _description;
	}

	/*
	 * @brief Set dataset description
	 */
	void setDescription(const std::string& description) {
		_description = description;
	}

	/*
	 * @brief Get dataset source
	 */
	const std::string& getSource() const {
		return _source;
	}

	/*
	 * @brief Set dataset source
	 */
	void setSource(const std::string& source) {
		_source = source;
	}

	/*
	 * @brief Get dataset global start
	 */
	const std::string& getGlobalStart() const {
		return _globalStart;
	}

	/*
	 * @brief Set dataset global start
	 */
	void setGlobalStart(const std::string& globalStart) {
		_globalStart = globalStart;
	}

	/*
	 * @brief Get dataset global stop
	 */
	const std::string& getGlobalStop() const {
		return _globalStop;
	}

	/*
	 * @brief Set dataset global stop
	 */
	void setGlobalStop(const std::string& globalStop) {
		_globalStop = globalStop;
	}

	/*
	 * @brief Get datset max sampling
	 */
	int getMaxSampling() const {
		return _maxSampling;
	}

	/*
	 * @brief Set dataset max sampling
	 */
	void setMaxSampling(int maxSampling) {
		_maxSampling = maxSampling;
	}

	/*
	 * @brief Get dataset min sampling
	 */
	int getMinSampling() const {
		return _minSampling;
	}

	/*
	 * @brief Set dataset min sampling
	 */
	void setMinSampling(int minSampling) {
		_minSampling = minSampling;
	}

	/*
	 * @brief Get datsqet caveats
	 */
	const std::string& getCaveats() const {
		return _caveats;
	}

	/*
	 * @brief Set dataset caveats
	 */
	void setCaveats(const std::string& caveats) {
		_caveats = caveats;
	}

	/*
	 * @brief Get dataset acknowledgement
	 */
	const std::string& getAcknowledgement() const {
		return _acknowledgement;
	}

	/*
	 * @brief Set dataset acknwoledgement
	 */
	void setAcknowledgement(const std::string& acknowledgement) {
		_acknowledgement = acknowledgement;
	}

	/*
	 * @brief Get dataset associated instrument id
	 */
	const std::string& getInstrumentId() const {
		return _instrumentId;
	}

	/*
	 * @brief Set dataset associated instrument id
	 */
	void setInstrumentId(const std::string& instrumentId) {
		_instrumentId = instrumentId;
	}

	/*
	 * @brief Get a map of dataset info
	 */
	std::vector<std::pair<std::string,std::string>> getInfoMap();

protected:
	std::string	_id;

	std::string _name;
	std::string _description;
	std::string _source;
	std::string _globalStart;
	std::string _globalStop;
	int	_minSampling;
	int _maxSampling;
	std::string _caveats;
	std::string _acknowledgement;

	std::string _instrumentId;
};

typedef boost::shared_ptr<DataSetInfo> DataSetInfoSPtr;
typedef std::map<std::string,DataSetInfoSPtr> DataSetInfoMap;

} /* namespace Info */
} /* namespace AMDA */


#endif /* DATASETINFO_HH_ */