DownloadProperties.hh
2.64 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
107
108
109
110
111
112
113
114
115
/*
* DownLoadProperties.hh
*
* Created on: Oct 1, 2014
* Author: m.mazel
*/
#ifndef DOWNLOADPROPERTIES_HH_
#define DOWNLOADPROPERTIES_HH_
#include <string>
#include "OutputFormatTime.hh"
#include "ParamProperties.hh"
namespace AMDA {
namespace ParamOutputImpl {
namespace Download {
enum OutputFileFormat {
ASCII_FILE_FORMAT,
CDF_FILE_FORMAT,
NETCDF_FILE_FORMAT,
JSON_FILE_FORMAT,
VOT_FILE_FORMAT
};
enum OutputStructure {
ONE_FILE,
ONE_FILE_REFPARAM,
ONE_FILE_PER_INTERVAL,
ONE_FILE_PER_INTERVAL_REFPARAM,
ONE_FILE_PER_PARAMETER_PER_INTERVAL
};
static std::map<OutputStructure,std::string> ouputStructureToStr = {
{OutputStructure::ONE_FILE, "all-in-one-file"},
{OutputStructure::ONE_FILE_REFPARAM, "all-in-one-file-refparam"},
{OutputStructure::ONE_FILE_PER_INTERVAL, "one-file-per-interval"},
{OutputStructure::ONE_FILE_PER_INTERVAL_REFPARAM, "one-file-per-interval-refparam"},
{OutputStructure::ONE_FILE_PER_PARAMETER_PER_INTERVAL, "one-file-per-parameter-per-interval"}
};
typedef std::vector<ParamProperties *> ParamPropertiesList;
/**
* @class DownloadProperties
* @brief Properties of a download request.
* @details
*/
class DownloadProperties {
public:
DownloadProperties();
virtual ~DownloadProperties();
OutputFileFormat getFileFormat() const;
void setFileFormat(OutputFileFormat fileFormat);
const std::string& getFileName() const;
void setFileName(const std::string& fileName);
OutputStructure getOutputStructure() const;
void setOutputStructure(OutputStructure outputStructure);
OutputFormatTime getTimeFormat() const;
void setTimeFormat(OutputFormatTime timeFormat);
int getTimeResolution() const;
void setTimeResolution(int timeResolution);
ParamPropertiesList& getParamPropertiesList();
ParamProperties* getParamPropertiesFromOriginalId(std::string originalId);
ParamProperties* getParamPropertiesFromOutputId(std::string outputId);
void addParamProperties(ParamProperties *paramProperties);
bool getPrecision(void) const;
void setPrecision(bool precision);
private:
/**
* format of time
*/
OutputFormatTime _timeFormat;
/**
* File format (see OutputFileFormat for supported format definition)
*/
OutputFileFormat _fileFormat;
/**
* File name
*/
std::string _fileName;
/**
* Parameter properties list
*/
ParamPropertiesList _paramPropertiesList;
/**
* Time resolution
*/
int _timeResolution;
/**
* Output structure :
* - One file
* - One file per interval
*/
OutputStructure _outputStructure;
/*
* Increase precision in output file
*/
bool _precision;
};
} // namespace Download
} // namespace ParamOutputImpl
} // namespace AMDA
#endif /* DOWNLOADPROPERTIES_HH_ */