ISIS Core Library 0.7.2 (api 3.0.0)
|
A very generic class to store values of properties. More...
#include <property.hpp>
Public Member Functions | |
template<class T > | |
T | as () const |
Interpret the value as value of any (other) type. hook for ValueBase::as | |
template<class T > | |
T & | castTo () const |
Dynamically cast the ValueBase up to its actual value of type T. hook for ValueBase::castTo | |
unsigned short | getTypeID () const |
hook for ValueBase::getTypeID | |
std::string | getTypeName () const |
hook for ValueBase::getTypeName | |
template<class T > | |
bool | is () const |
hook for ValueBase::is | |
bool | isNeeded () const |
returns true if PropertyValue is marked as needed, false otherwise | |
bool & | needed () |
accessor to mark as (not) needed | |
bool | operator!= (const PropertyValue &second) const |
Unequality to another PropertyValue. | |
template<typename T > | |
bool | operator== (const T &second) const |
Equality to a Value of type T (convenience function). | |
bool | operator== (const ValueBase &second) const |
Equality to another Value-Object (this cannot be empty but PropertyValue can). | |
bool | operator== (const PropertyValue &second) const |
Equality to another PropertyValue. | |
template<typename T > | |
PropertyValue (const Value< T > &ref, bool _needed=false) | |
template<typename T > | |
PropertyValue (const T &ref, bool _needed=false) | |
Default constructor. | |
PropertyValue () | |
Empty constructor. |
A very generic class to store values of properties.
PropertyValue may store a value of any type (defined in types.cpp) otherwise it's empty. Non-empty ValueValues are equal-compareable. But empty PropertyValues are neigther equal nor unequal to anything (not even to empty ValueValues).
Definition at line 33 of file property.hpp.
isis::util::PropertyValue::PropertyValue | ( | const T & | ref, |
bool | _needed = false |
||
) | [inline] |
Default constructor.
Creates and stores a value from any known type. If the type is not known (there is no Value<type> available) an compiler error will be raised.
ref | the value to be stored |
_needed | flag if this PropertyValue is needed an thus not allowed to be empty (a.k.a. undefined) |
Definition at line 47 of file property.hpp.
isis::util::PropertyValue::PropertyValue | ( | const Value< T > & | ref, |
bool | _needed = false |
||
) | [inline] |
Definition at line 51 of file property.hpp.
isis::util::PropertyValue::PropertyValue | ( | ) |
Empty constructor.
Creates an empty property value. So PropertyValue().isEmpty() will allways be true.
Definition at line 40 of file property.cpp.
T isis::util::PropertyValue::as | ( | ) | const [inline] |
Interpret the value as value of any (other) type.
hook for ValueBase::asDefinition at line 129 of file property.hpp.
T& isis::util::PropertyValue::castTo | ( | ) | const [inline] |
Dynamically cast the ValueBase up to its actual value of type T.
hook for ValueBase::castToDefinition at line 159 of file property.hpp.
short unsigned int isis::util::PropertyValue::getTypeID | ( | ) | const |
hook for ValueBase::getTypeID
Definition at line 48 of file property.cpp.
std::string isis::util::PropertyValue::getTypeName | ( | ) | const |
hook for ValueBase::getTypeName
Definition at line 42 of file property.cpp.
bool isis::util::PropertyValue::is | ( | ) | const [inline] |
hook for ValueBase::is
Definition at line 138 of file property.hpp.
bool isis::util::PropertyValue::isNeeded | ( | ) | const |
returns true if PropertyValue is marked as needed, false otherwise
Definition at line 21 of file property.cpp.
bool & isis::util::PropertyValue::needed | ( | ) |
accessor to mark as (not) needed
Definition at line 20 of file property.cpp.
bool isis::util::PropertyValue::operator!= | ( | const PropertyValue & | second | ) | const |
Unequality to another PropertyValue.
Properties are ONLY unequal if:
Definition at line 28 of file property.cpp.
bool isis::util::PropertyValue::operator== | ( | const T & | second | ) | const [inline] |
Equality to a Value of type T (convenience function).
Properties are ONLY equal to Values if:
PropertyValue(4.5)==5
Definition at line 103 of file property.hpp.
bool isis::util::PropertyValue::operator== | ( | const PropertyValue & | second | ) | const |
Equality to another PropertyValue.
Properties are ONLY equal if:
Definition at line 24 of file property.cpp.
bool isis::util::PropertyValue::operator== | ( | const ValueBase & | second | ) | const |
Equality to another Value-Object (this cannot be empty but PropertyValue can).
Properties are ONLY equal to Value-Object if:
Definition at line 34 of file property.cpp.