floating point variable More...

#include <Quantity.h>

Inheritance diagram for Quantity:

Public Types

typedef Value ValueType
 for consistency with Type<T>::ValueType More...
 

Public Member Functions

 Quantity (const std::string &tag, const std::string &description, double value, const std::string &unit="", Persistent *parent=nullptr)
 main constructor More...
 
 Quantity (const std::string &tag, const std::string &description, double value, const UnitArray u, Persistent *parent=nullptr)
 
 Quantity (const std::string &tag, const std::string &description, const Value &value, Persistent *parent=nullptr)
 
Quantityoperator= (const Quantity &other)
 copy assignment; does NOT copy tag / description / input / output More...
 
Quantityoperator= (const Value &other)
 assign from Value More...
 
 Quantity (Quantity &&other)
 move constructor More...
 
Quantityoperator= (Quantity &&other)
 move assignment; does NOT copy tag / description / input / output More...
 
const std::string & type () const override
 
template<class T >
bool operator!= (const T &rhs) const
 
template<class T >
bool operator== (const T &rhs) const
 
template<class T >
bool operator<= (const T &rhs) const
 
template<class T >
bool operator>= (const T &rhs) const
 
template<class T >
bool operator< (const T &rhs) const
 
template<class T >
bool operator> (const T &rhs) const
 
- Public Member Functions inherited from Item
 Item (const Item &other)
 copy constructor copies all elements but parent which is set to nullptr More...
 
Itemoperator= (const Item &other)
 copy assignment operator copies all elements but parent which is set to nullptr More...
 
 Item (const std::string &tag, const std::string &description, Persistent *parent)
 
 Item (Item &&other)
 move constructor More...
 
Itemoperator= (Item &&other)
 move assignment operator More...
 
virtual ~Item ()
 
const std::string & tag () const
 
const std::string & description () const
 
std::string fullTag () const
 
const Persistentparent () const
 
virtual const std::string & type () const =0
 
void setTag (const std::string &tag)
 
void setDescription (const std::string &description)
 
void setWideTag (const std::wstring &tag)
 wide-character variant, More...
 
void setWideDescription (const std::wstring &description)
 wide-character variant, More...
 
bool operator!= (const Item &rhs) const
 
bool operator== (const Item &rhs) const
 
- Public Member Functions inherited from GenericValue< GenericActive< double > >
 GenericValue (void)
 Default constructor. More...
 
 GenericValue (const GenericValue< GenericActive< double > > &)
 Copy constructor (this class is copyable) More...
 
 GenericValue (double)
 Value-only constructor (no UOM) More...
 
 GenericValue (double v, const std::string s)
 
 GenericValue (const std::string)
 UOM-only constructor (no value) More...
 
 GenericValue (double v, const UnitArray u)
 
 GenericValue (GenericActive< double > v, const std::string s="")
 
 GenericValue (GenericActive< double > v, const UnitArray u)
 
virtual ~GenericValue (void)
 
const GenericActive< double > & value (void) const
 
GenericActive< double > & value_rw (void)
 
double toDouble (void) const
 
double toDouble (const std::string s) const
 returns a new object with unchanged value but zero derivatives More...
 
GenericValue< GenericActive< double > > inactivated (void) const
 
GenericValue< GenericActive< double > > operator- (void) const
 
GenericValue< GenericActive< double > > operator- (const rhstype &rhs) const
 
GenericValue< GenericActive< double > > operator- (const GenericValue< GenericActive< double > > &rhs) const
 
GenericValue< GenericActive< double > > operator+ (const rhstype &rhs) const
 
GenericValue< GenericActive< double > > operator+ (const GenericValue< GenericActive< double > > &) const
 
GenericValue< GenericActive< double > > operator* (const rhstype &rhs) const
 
GenericValue< GenericActive< double > > operator/ (const rhstype &rhs) const
 
bool operator!= (const GenericValue< GenericActive< double > > &) const
 
bool operator== (const GenericValue< GenericActive< double > > &) const
 
bool operator<= (const GenericValue< GenericActive< double > > &) const
 
bool operator>= (const GenericValue< GenericActive< double > > &) const
 
bool operator< (const GenericValue< GenericActive< double > > &) const
 
bool operator> (const GenericValue< GenericActive< double > > &) const
 
GenericValue< GenericActive< double > > & operator= (double v)
 
GenericValue< GenericActive< double > > & operator= (GenericActive< double > v)
 
GenericValue< GenericActive< double > > & operator= (const GenericValue< GenericActive< double > > &a)
 
GenericValue< GenericActive< double > > & operator+= (double v)
 
GenericValue< GenericActive< double > > & operator+= (GenericActive< double > v)
 
GenericValue< GenericActive< double > > & operator+= (const GenericValue< GenericActive< double > > &a)
 
GenericValue< GenericActive< double > > & operator-= (double v)
 
GenericValue< GenericActive< double > > & operator-= (GenericActive< double > v)
 
GenericValue< GenericActive< double > > & operator-= (const GenericValue< GenericActive< double > > &a)
 
GenericValue< GenericActive< double > > & operator*= (double rhs)
 
GenericValue< GenericActive< double > > & operator*= (GenericActive< double > rhs)
 
GenericValue< GenericActive< double > > & operator*= (const GenericValue< GenericActive< double > > &a)
 
GenericValue< GenericActive< double > > & operator/= (double rhs)
 
GenericValue< GenericActive< double > > & operator/= (GenericActive< double > rhs)
 
GenericValue< GenericActive< double > > & operator/= (const GenericValue< GenericActive< double > > &a)
 
void clear (void)
 set to zero More...
 
double checkuom (const std::string &s) const
 
const bool & input (void) const
 
const bool & output (void) const
 
void setOutput (void)
 Set the GenericValue as output parameter of a model. More...
 
void setInput (void)
 Set the GenericValue as input parameter of a model. More...
 
void unSetOutput (void)
 Reset the GenericValue as default no-output parameter of a model. More...
 
void unSetInput (void)
 Reset the GenericValue as default no-input parameter of a model. More...
 
void set (double v, const std::string s="")
 
void set (GenericValue< GenericActive< double > >)
 Sets the GenericValue copying another GenericValue. More...
 
void set (GenericActive< double >)
 Sets the GenericValue only with valuetype. More...
 
const UnitArrayunit (void) const
 Returns the UnitArray of UOM. More...
 
void divideUnit (int factor)
 divide all exponents of the unit by factor; used in sqrt and curt More...
 
void forceUnit (const UnitArray &uom)
 Sets the unit of measurement (not recomended: use a proper constructor or setter) More...
 
std::string getUnit (void) const
 Returns the UOM as string. More...
 
std::string getUnittovector (void) const
 Returns the UOM as string. More...
 

Friends

class Object
 

Additional Inherited Members

- Protected Attributes inherited from Item
Persistentparent_
 pointer to the parent Persistent; set to this by the constructor if Item is self-standing or a root Persistent of a tree More...
 

Detailed Description

floating point variable

used for inputs and results

#include <libpf/persistency/Quantity.h>

Remarks
Warning
Thread safe:
Extendable:
Platform dependencies:

Member Typedef Documentation

◆ ValueType

for consistency with Type<T>::ValueType

Constructor & Destructor Documentation

◆ Quantity() [1/4]

Quantity::Quantity ( const std::string &  tag,
const std::string &  description,
double  value,
const std::string &  unit = "",
Persistent parent = nullptr 
)

main constructor

◆ Quantity() [2/4]

Quantity::Quantity ( const std::string &  tag,
const std::string &  description,
double  value,
const UnitArray  u,
Persistent parent = nullptr 
)

◆ Quantity() [3/4]

Quantity::Quantity ( const std::string &  tag,
const std::string &  description,
const Value value,
Persistent parent = nullptr 
)

◆ Quantity() [4/4]

Quantity::Quantity ( Quantity &&  other)

move constructor

Member Function Documentation

◆ operator!=()

template<class T >
bool Quantity::operator!= ( const T &  rhs) const
inline

◆ operator<()

template<class T >
bool Quantity::operator< ( const T &  rhs) const
inline

◆ operator<=()

template<class T >
bool Quantity::operator<= ( const T &  rhs) const
inline

◆ operator=() [1/3]

Quantity & Quantity::operator= ( const Quantity other)

copy assignment; does NOT copy tag / description / input / output

◆ operator=() [2/3]

Quantity & Quantity::operator= ( const Value other)

assign from Value

◆ operator=() [3/3]

Quantity & Quantity::operator= ( Quantity &&  other)

move assignment; does NOT copy tag / description / input / output

◆ operator==()

template<class T >
bool Quantity::operator== ( const T &  rhs) const
inline

◆ operator>()

template<class T >
bool Quantity::operator> ( const T &  rhs) const
inline

◆ operator>=()

template<class T >
bool Quantity::operator>= ( const T &  rhs) const
inline

◆ type()

const std::string & Quantity::type ( ) const
overridevirtual
Returns
the C++ name of the class the instance belongs to
Note
it is the responsibility of the caller to not access this reference after the lifecycle of the Item

Implements Item.

Friends And Related Function Documentation

◆ Object

friend class Object
friend

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