34 #include <drain/Log.h>
35 #include <drain/Type.h>
41 #include <drain/util/ReferenceMap.h>
43 #include <drain/util/Range.h>
44 #include "EncodingODIM.h"
53 class Quantity :
public std::map<char,EncodingODIM> {
57 typedef std::map<char,EncodingODIM> map_t;
58 typedef std::list<EncodingODIM> list_t;
85 physicalRange(quantity.physicalRange),
94 const list_t & l = {},
95 double undetectValue = std::numeric_limits<double>::signaling_NaN());
103 EncodingODIM &
set(
char typecode);
113 const const_iterator it = find(typecode);
133 throw (std::runtime_error(t+
" <= illegal std::string, "+ __FUNCTION__));
159 void setZero(
const std::string & value);
164 undetectValue = std::numeric_limits<double>::signaling_NaN();
177 physicalRange.set(min, max);
181 std::ostream &
toStream(std::ostream & ostr)
const;
187 std::ostream & operator<<(std::ostream & ostr,
const Quantity & q){
188 return q.toStream(ostr);
Structure for data storage type, scaling and marker codes. Does not contain quantity.
Definition: EncodingODIM.h:75
Structure for defining.
Definition: Quantity.h:53
const EncodingODIM & get(char typecode='\0') const
Retrieve the scaling for a given storage type.
Definition: Quantity.h:108
void setZero(double value)
Set a value to be used like a real measurement, for example in interpolation.
Definition: Quantity.h:151
Quantity()
Default constructor.
Definition: Quantity.h:76
void setPhysicalRange(double min, double max=std::numeric_limits< double >::max())
Sets absolute or typical range of this quantity.
Definition: Quantity.h:173
Quantity(const Quantity &quantity)
Copy constructor.
Definition: Quantity.h:81
double undetectValue
A physical value corresponding a very small (unmeasurable) value has been defined.
Definition: Quantity.h:71
const EncodingODIM & get(const std::string &t) const
Retrieve the scaling for a given storage type.
Definition: Quantity.h:130
bool hasUndetectValue() const
True, if a value corresponding a very small (unmeasurable) value has been defined.
Definition: Quantity.h:140
std::ostream & toStream(std::ostream &ostr) const
Print declared encodings (storage types and scalings)
Definition: Quantity.cpp:103
void unsetZero()
Confirm that no value should be used as a substitute of undetected value.
Definition: Quantity.h:163
char defaultType
Default storage type.
Definition: Quantity.h:63
EncodingODIM & set(char typecode)
Declare encoding (a storage type and scaling) for this quantity.
Definition: Quantity.cpp:87
Definition: DataSelector.cpp:44