Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Quantity Class Reference

Structure for defining quantity. More...

#include <Quantity.h>

Inheritance diagram for Quantity:
Inheritance graph
[legend]
Collaboration diagram for Quantity:
Collaboration graph
[legend]

Public Types

typedef std::map< char, EncodingODIMmap_t
 Container for default encodings.
 
typedef std::list< EncodingODIMlist_t
 List type applicable in constructors.
 

Public Member Functions

 Quantity (const std::string &name="", const QuantitySelector &compatibleVariants={}, const drain::Range< double > &range={}, char defaultType='\0', const list_t &l={}, double undetectValue=std::numeric_limits< double >::signaling_NaN())
 Default constructor.
 
 Quantity (const std::string &name, const QuantitySelector &compatibleVariants, char defaultType, const list_t &l={}, double undetectValue=std::numeric_limits< double >::signaling_NaN())
 Constructor without range (counters can be such)
 
 Quantity (const Quantity &quantity)
 Copy constructor.
 
EncodingODIMset (char typecode)
 Declare encoding (a storage type and scaling) for this quantity.
 
void addEncodings (const list_t &l)
 
const EncodingODIMget (char typecode='\0') const
 Retrieve the scaling for a given storage type.
 
const EncodingODIMget (const std::string &t) const
 Retrieve the scaling for a given storage type.
 
bool isApplicable (const std::string &key)
 
bool hasUndetectValue () const
 True, if a value corresponding a very small (unmeasurable) value has been defined.
 
void setZero (double value)
 Set a value to be used like a real measurement, for example in interpolation.
 
void setZero (const std::string &value)
 Set a value to be used like a real measurement, for example in interpolation.
 
void unsetZero ()
 Confirm that no value should be used as a substitute of undetected value.
 
void setPhysicalRange (double min, double max=std::numeric_limits< double >::max())
 Sets absolute or typical range of this quantity.
 
std::ostream & toStream (std::ostream &ostr) const
 Print declared encodings (storage types and scalings)
 

Public Attributes

std::string name
 Container supporting constructors.
 
QuantitySelector keySelector
 Collection of quantities that can be similarly scaled and encoded.
 
char defaultType = '\0'
 Default storage type.
 
drain::Range< double > physicalRange
 
double undetectValue = std::numeric_limits<double>::signaling_NaN()
 A physical value corresponding a very small (unmeasurable) value has been defined.
 

Detailed Description

Structure for defining quantity.

Constructor & Destructor Documentation

◆ Quantity()

Quantity ( const std::string &  name = "",
const QuantitySelector compatibleVariants = {},
const drain::Range< double > &  range = {},
char  defaultType = '\0',
const list_t l = {},
double  undetectValue = std::numeric_limits<double>::signaling_NaN() 
)

Default constructor.

Constructor accepting variants (related/similar quantities)

Member Function Documentation

◆ setPhysicalRange()

void setPhysicalRange ( double  min,
double  max = std::numeric_limits<double>::max() 
)
inline

Sets absolute or typical range of this quantity.

For example, for probability the range would be [0.0, 1.0]. Setting range is useful when data are converted from some storage type to another

◆ setZero() [1/2]

void setZero ( const std::string &  value)

Set a value to be used like a real measurement, for example in interpolation.

Parameters
value- substitute for undetect marker value.

◆ setZero() [2/2]

void setZero ( double  value)
inline

Set a value to be used like a real measurement, for example in interpolation.

Parameters
value- substitute for undetect marker value, or signaling_NaN

The documentation for this class was generated from the following files: