Blame view

server/kernel/src/DataRecord/DataRecord.h 1.85 KB
346b85c6   Benjamin Renard   First commit with...
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
#ifndef DATARECORD_H
#define DATARECORD_H

#include <string>
#include <map>

#include "../Common/TREPSTypes.h"

using namespace std;
using namespace TREPS::Common;

namespace TREPS
{
	namespace DataRecord
	{
		class DataRecordClass
		{
			public :
				DataRecordClass(void);
				
				~DataRecordClass(void);

				//set a value by key
				void setValue(const char *key, const char *val);

				//get a value by key
				string getValue(const char *key);

				//get a string that's contained nbParts values separate by a space
				//firstKey represent the first value to use
				string getMultiValues(const char *firstKey, int nbParts);

				//get double value by key
				double getDoubleValue(const char *key);

				//get float value by key
				float getFloatValue(const char *key);

				//get int value by key
				int getIntValue(const char *key);

				//get long value by key
				long getLongValue(const char *key);

				//get long long value by key
				long long getLongLongValue(const char *key);

				//get short value by key
				short getShortValue(const char *key);

				//get full record values
				map<string,string> getValuesMap(void);

				//test if a value exist by key
				bool valueExist(const char *key);

				//set record time
				void setTime(t_Time t);

				//get record time
				t_Time getTime(void);

				//set record tag
				void setTag(long int tag);

				//get record tag
				long int getTag(void);

				//set the pointer to the next record
				void setNextRecord(DataRecordClass *nextRecord);

				//get the pointer to the next record
				DataRecordClass *getNextRecord(void);
			
			private:
				long int tag;

				t_Time time;
	
				map<string,string> values;

				//use to retrieve the data order
				list<string> keysOrder;

				DataRecordClass *nextRecord;
		};
	}
}

#endif