DataRecord.h 1.85 KB
#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