A single-valued container for ObjectPtr or Value. More...
#include <keyvalue/value/Result.h>
Public Types | |
typedef boost::variant < ObjectPtr, Value > | DataType_ |
Public Member Functions | |
Result () | |
Default constructor sets content to null ObjectPtr. | |
Result (const DataType_ &data) | |
Builds and sets content. | |
template<typename Rhs > | |
Result (const Rhs &rhs) | |
Builds and sets content. | |
template<typename Rhs > | |
Result & | operator= (const Rhs &rhs) |
Assignment operator. | |
ObjectPtr | getObjectPtr () const |
Gets content. | |
ObjectPtr | getObjectPtr () |
Non const getObjectPtr(). | |
const Value * | getValue () const |
Gets content. | |
Value * | getValue () |
Non const getValue(). | |
Private Attributes | |
DataType_ | data_ |
A single-valued container for ObjectPtr or Value.
Result | ( | const DataType_ & | data | ) |
Builds and sets content.
Takes type on 1-level-down on the value hierarchy.
data | : The content. |
Result | ( | const Rhs & | rhs | ) |
Builds and sets content.
Takes type on 2-or-more-levels-down on the value hierarchy.
rhs | : The content. |
If you get an error here about 'keyvaluevalue::Parent<Rhs>', this means that Rhs isn't in a lower level in the hierarchy.
Result & operator= | ( | const Rhs & | rhs | ) |
Assignment operator.
Takes type on 2-or-more-levels-down on the value hierarchy.
rhs | : The data to be assigned. |
this
. If you get an error here about 'keyvaluevalue::Parent<P>', this means that Rhs isn't in a lower level in the hierarchy.
ObjectPtr getObjectPtr | ( | ) | const |
Gets content.
const
pointer to the content, if it is an ObjectPtr. Otherwise, a null pointer. ObjectPtr getObjectPtr | ( | ) |
Non const
getObjectPtr().
const Value* getValue | ( | ) | const |
Gets content.
const
pointer to the content, if it is a Value. Otherwise, a null pointer. Value* getValue | ( | ) |
Non const
getValue().