Public Types | Public Member Functions | Private Attributes

Result Class Reference

A single-valued container for ObjectPtr or Value. More...

#include <keyvalue/value/Result.h>

List of all members.

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 >
Resultoperator= (const Rhs &rhs)
 Assignment operator.
ObjectPtr getObjectPtr () const
 Gets content.
ObjectPtr getObjectPtr ()
 Non const getObjectPtr().
const ValuegetValue () const
 Gets content.
ValuegetValue ()
 Non const getValue().

Private Attributes

DataType_ data_

Detailed Description

A single-valued container for ObjectPtr or Value.


Constructor & Destructor Documentation

Result (  ) 

Default constructor sets content to null ObjectPtr.

Result ( const DataType_ &  data  ) 

Builds and sets content.

Takes type on 1-level-down on the value hierarchy.

Parameters:
data : The content.
Result ( const Rhs &  rhs  ) 

Builds and sets content.

Takes type on 2-or-more-levels-down on the value hierarchy.

Parameters:
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.


Member Function Documentation

Result & operator= ( const Rhs &  rhs  ) 

Assignment operator.

Takes type on 2-or-more-levels-down on the value hierarchy.

Parameters:
rhs : The data to be assigned.
Returns:
A reference to 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.

Returns:
A 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.

Returns:
A const pointer to the content, if it is a Value. Otherwise, a null pointer.
Value* getValue (  ) 

Non const getValue().