ResamplingProperties.hh
1.68 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
/*
* ResamplingProperties.hh
*
* Created on: Aug 19, 2014
* Author: AKKA
*/
#ifndef RESAMPLINGPROPERTIES_HH_
#define RESAMPLINGPROPERTIES_HH_
#include <iostream>
#include <map>
#include <string>
namespace plot {
/**
* available resampling type to apply to a serie.
*/
enum class ResamplingType {
AUTO, XPARAM, YPARAM, MANUAL
};
/**
* string to enum translation. string values (cf. plot.xsd).
*/
static std::map<const std::string, ResamplingType> stoResamplingType = {
{"auto", ResamplingType::AUTO},
{"xparam", ResamplingType::XPARAM},
{"yparam", ResamplingType::YPARAM},
{"manual", ResamplingType::MANUAL}
};
/**
* Resampling properties. Defines type and value (if needed by type)
*/
class ResamplingProperties {
public:
friend std::ostream& operator<<(std::ostream& out_, const ResamplingProperties& lprop_);
/*
* Dumps properties for test.
*/
void dump(std::ostream& out_, std::string& prefix_);
ResamplingProperties() :
_type(ResamplingType::AUTO), _value(0) {
}
ResamplingProperties(const ResamplingProperties& pResamplingProperties_) :
_type(pResamplingProperties_._type), _value(pResamplingProperties_._value) {
}
ResamplingProperties& operator=(const ResamplingProperties& pResamplingProperties_) {
_type = pResamplingProperties_._type;
_value = pResamplingProperties_._value;
return *this;
}
virtual ~ResamplingProperties() {
}
ResamplingType getType() const {
return _type;
}
void setType(ResamplingType type) {
_type = type;
}
int getValue() const {
return _value;
}
void setValue(double value) {
_value = value;
}
private:
ResamplingType _type;
double _value;
};
} /* namespace plot */
#endif /* RESAMPLINGPROPERTIES_HH_ */