21.02
|
Generic measurement that stores values as either double or long long int. More...
#include <Measurement.h>
Data Structures | |
struct | Value |
Measurement value. More... | |
Public Member Functions | |
bool | operator< (const Measurement &b) const |
Compare the stored value with another value. More... | |
template<typename Floating , typename std::enable_if< !std::is_integral< Floating >::value, int >::type = 0> | |
Measurement (Floating v, std::string unit, std::list< std::string > raw={}) | |
Constructor to store a floating point value. More... | |
template<typename Integer , typename std::enable_if< std::is_integral< Integer >::value, int >::type = 0> | |
Measurement (Integer v, std::string unit, std::list< std::string > raw={}) | |
Constructor to store an integer value. More... | |
const std::string & | unit () const |
Accessor for the unit of the measurement. More... | |
const std::list< std::string > & | raw_data () const |
Accessor for the raw data. More... | |
const Value & | value () const |
Accessor for the stored value. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Measurement &measurement) |
Stream output operator to print the measurement. More... | |
Generic measurement that stores values as either double or long long int.
Definition at line 41 of file Measurement.h.
|
inline |
Constructor to store a floating point value.
[in] | v | Value to store |
[in] | unit | Unit of v |
[in] | raw | (Optional) The raw value(s) was generated from. |
Definition at line 252 of file Measurement.h.
References Measurement::Value::v.
|
inline |
Constructor to store an integer value.
[in] | v | Value to store |
[in] | unit | Unit of v |
[in] | raw | (Optional) The raw value(s) was generated from. |
Definition at line 269 of file Measurement.h.
References Measurement::Value::v.
|
inline |
Compare the stored value with another value.
[in] | b | Value to compare against |
Definition at line 225 of file Measurement.h.
References Measurement::value().
|
inline |
|
inline |
Accessor for the unit of the measurement.
Definition at line 283 of file Measurement.h.
Referenced by PrettyPrinter::print_measurements().
|
inline |
Accessor for the stored value.
Definition at line 301 of file Measurement.h.
Referenced by Measurement::operator<(), and PrettyPrinter::print_measurements().
|
friend |
Stream output operator to print the measurement.
Prints value and unit.
[out] | os | Output stream. |
[in] | measurement | Measurement. |
Definition at line 239 of file Measurement.h.