Blame view

src/ParamGetImpl/LocalFileInterface/FileReaderAbstract.hh 1.71 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
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
/*
 * FileReaderAbstract.hh
 *
 *  Created on: Nov 24, 2014
 *  Author: AKKA
 */

#ifndef FILEREADERABSTRACT_HH_
#define FILEREADERABSTRACT_HH_

#include "LocalParamData.hh"

#include <string>

namespace AMDA {
namespace LocalFileInterface {

/*
 * @brief Status for getParamPacketData function
 */
typedef enum
{
	//more data is needed (ie. the paket is full and must be proceed before to continue)
	FRS_MORE,
	//end of file
	FRS_EOF,
	//stop time is reached
	FRS_FINISH,
	//error detected
	FRS_ERROR
} FileReaderStatus;

/*
 * @brief Abstract class to define a FileReader
 */
class FileReaderAbstract
{
public:
	/*
	 * @brief Constructor
	 */
	FileReaderAbstract();

	/*
	 * @brief Destructor
	 */
	virtual ~FileReaderAbstract();

	/*
	 * @brief Open the file
	 */
	virtual bool open(std::string filePath) = 0;

	/*
	 * @brief Close the file
	 */
	virtual bool close(void) = 0;

	/*
	 * @brief Test if a file is currently opened
	 */
	virtual bool isOpened(void) = 0;

	/*
	 * @brief Get the id of the time param to use
	 */
	virtual std::string getTimeParamId(void) = 0;

	/*
	 * @brief Get a param type and a param size
	 */
	virtual bool getParamInfo(std::string& paramId, LocalParamType& paramType, int& dim1Size, int& dim2Size) = 0;

	/*
	 * @brief Get the index of the nearest record of time (the higher one)
	 */
	virtual int getRecordIndex(std::string& timeId, double time) = 0;

	/*
	 * @brief Get a param packet
	 */
	virtual FileReaderStatus getParamPacketData(std::string& timeId, std::string& paramId,
		int recordIndex, double stopTime, LocalParamDataPacket *packet) = 0;
f5c53312   Benjamin Renard   Get calib info in...
84
85
86
87
88

	/*
	 * @brief Get an information
	 */
	virtual bool getInfo(const char* pInfoName, std::vector<double>& res) = 0;
fbe3c2bb   Benjamin Renard   First commit
89
90
91
92
93
94
};

} /* LocalFileInterface */
} /* AMDA */

#endif