Public Types | Public Member Functions | Private Attributes

Value Class Reference

A single-valued container for Single, Vector or Matrix. More...

#include <keyvalue/value/Value.h>

List of all members.

Public Types

typedef boost::variant< Single,
Vector, Matrix
DataType_

Public Member Functions

 Value ()
 Default constructor sets content to Singles's default.
 Value (const DataType_ &data)
 Builds and sets content.
template<typename Rhs >
 Value (const Rhs &rhs)
 Builds and sets content.
template<typename Rhs >
Valueoperator= (const Rhs &rhs)
 Assignment operator.
bool operator== (const Value &rhs) const
 Comparison operator.
template<typename Type >
const Type * get () const
 Gets content if it has a certain type.
template<typename Type >
Type * get ()
 Non const get().

Private Attributes

DataType_ data_

Detailed Description

A single-valued container for Single, Vector or Matrix.


Constructor & Destructor Documentation

Value (  ) 

Default constructor sets content to Singles's default.

Value ( const DataType_ &  data  ) 

Builds and sets content.

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

Parameters:
data : The content.
Value ( 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

Value & 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.

bool operator== ( const Value rhs  )  const

Comparison operator.

const Type* get (  )  const

Gets content if it has a certain type.

Parameters:
Type : (template parameter) The expected content's type.
Returns:
A const pointer to the content, if it is of type Type. Otherwise, a null pointer.
Type* get (  ) 

Non const get().