ParamOutputIntervalTrueFile.hh
2.76 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**
* ParamOutputIntervalTrueFile.hh
*
* Created on: 18 oct. 2012
* Author: AKKA IS
*/
#ifndef ParamOutputIntervalTrueFile_HH_
#define ParamOutputIntervalTrueFile_HH_
#include <iostream>
#include <fstream>
#include <string>
#include "ParamOutput.hh"
#include "OutputFormatTime.hh"
namespace AMDA {
namespace Parameters {
class ParameterManager;
class ParamData;
template <typename Type>
class ParamDataSpec;
} // namespace Parameters
namespace ParamOutputImpl {
namespace Download {
class PrintIntervalTrue;
typedef boost::shared_ptr<PrintIntervalTrue> PrintIntervalTrueSPtr;
extern log4cxx::LoggerPtr gLogger;
/**
* AMDA::Parameters::ParamOutputIntervalTrueFile
*/
class ParamOutputIntervalTrueFile: public AMDA::Parameters::ParamOutput {
public:
typedef std::vector<unsigned int> IndexList;
typedef std::vector<std::string> InfoNammeList;
ParamOutputIntervalTrueFile(AMDA::Parameters::ParameterManager& pParameterManager);
virtual ~ParamOutputIntervalTrueFile();
// Getter methods
AMDA::Parameters::ParameterSPtr getParameter() { return _parameter; }
const std::string& getParamName() const { return _paramName; }
IndexList& getIndexList() { return _indexList; }
OutputFormatTime getTypeFormatTime() const { return _typeFormatTime; }
InfoNammeList& getCalibrationInfoNameList() { return _infoNameList; }
void addCalibrationName(std::string pName){ _infoNameList.push_back(pName); }
// Setter methods
void setParameter(AMDA::Parameters::ParameterSPtr parameter) { _parameter = parameter; }
void setTypeFormatTime(OutputFormatTime typeFormatTime) { _typeFormatTime = typeFormatTime; }
void setParamName(const std::string& paramName) { _paramName = paramName; }
void setCalibrationInfoNameList(const InfoNammeList& pInfoNameList) { _infoNameList.insert(_infoNameList.end(),pInfoNameList.begin(),pInfoNameList.end()); }
// Others methods
virtual void establishConnection();
protected:
/**
* @overload ParamOutput::init()
*/
virtual void init();
/**
* @overload ParamOutput::apply()
*/
virtual void apply();
/**
* @brief start print (create file)
*/
virtual void initOutput() ;
virtual void endOutput() ;
virtual void createCurrentfile();
//attributes
PrintIntervalTrueSPtr _printIntervalTrue;
AMDA::Parameters::ParameterSPtr _parameter;
std::ofstream _currentfile;
std::string _paramName;
OutputFormatTime _typeFormatTime;
/**
* @brief Indexes of _parameter ParamData to write into _currentfile.
*/
IndexList _indexList;
bool _firstVisit;
std::stringstream _lFileName;
/**
* @brief List of Calibration info to write into _currentfile.
*/
InfoNammeList _infoNameList;
};
} // namespace Download
} // namespace ParamOutputImpl
} /* namespace AMDA */
#endif /* ParamOutputIntervalTrueFile_HH_ */