BSON C++ API  2.5.1
uma::bson
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
uma::bson::ODMObject< Model >::MetaField Class Referenceabstract

Abstract base class that encapsulates a field in a model object. Primarily used to get around requirement that implementation needs exact type of data encapsulated in the field as template type. More...

#include <ODMObject.h>

+ Inheritance diagram for uma::bson::ODMObject< Model >::MetaField:

Public Member Functions

 MetaField (const std::string &field)
 Create a new instance representing the field with the specified name.
 
virtual ~MetaField ()
 Virtual dtor for sub-classing.
 
virtual ValuegetValue (Model *model)=0
 Return the value for the field represented by this instance.
 
virtual void setValue (Model *model, const Value &value)=0
 Set the value for the field represented by this instance.
 
const std::string & getName () const
 Return the name of the field encapsulated in this meta field instance.
 

Detailed Description

template<typename Model>
class uma::bson::ODMObject< Model >::MetaField

Abstract base class that encapsulates a field in a model object. Primarily used to get around requirement that implementation needs exact type of data encapsulated in the field as template type.

Template Parameters
ModelThe type of the class whose field is to be represented

Constructor & Destructor Documentation

template<typename Model >
uma::bson::ODMObject< Model >::MetaField::MetaField ( const std::string &  field)
inline

Create a new instance representing the field with the specified name.

Parameters
fieldThe name of the field.
template<typename Model >
virtual uma::bson::ODMObject< Model >::MetaField::~MetaField ( )
inlinevirtual

Virtual dtor for sub-classing.

Member Function Documentation

template<typename Model >
const std::string& uma::bson::ODMObject< Model >::MetaField::getName ( ) const
inline

Return the name of the field encapsulated in this meta field instance.

Returns
const std::string The field name.
template<typename Model >
virtual Value& uma::bson::ODMObject< Model >::MetaField::getValue ( Model *  model)
pure virtual

Return the value for the field represented by this instance.

Parameters
modelThe model object from which the value is to retrieved.
Returns
Value The value for the field.

Implemented in uma::bson::ODMObject< Model >::MetaFieldImpl< DataType >.

template<typename Model >
virtual void uma::bson::ODMObject< Model >::MetaField::setValue ( Model *  model,
const Value value 
)
pure virtual

Set the value for the field represented by this instance.

Parameters
modelThe model object in which the value is to be stored.
valueThe value for the field to store.

Implemented in uma::bson::ODMObject< Model >::MetaFieldImpl< DataType >.


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