CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Attributes
RecordHelper< TOutput > Class Template Reference

#include <RecordHelper.h>

Public Types

typedef coral::AttributeList AttributeList
 
typedef std::vector
< FieldHandlerBase< TOutput > * > 
FieldVector
 

Public Member Functions

template<typename TField >
void addField (const std::string &fieldName, void(TOutput::*setter)(const TField))
 
virtual void extractRecord (const AttributeList &source, TOutput &dest)
 
virtual std::vector< std::string > getColumnList ()
 
virtual ~RecordHelper ()
 

Protected Attributes

FieldVector fields_
 

Detailed Description

template<class TOutput>
class RecordHelper< TOutput >

Description: A microframework to deal with the need to fill rather boring getter/setter classes from Coral classes.

Definition at line 151 of file RecordHelper.h.

Member Typedef Documentation

template<class TOutput >
typedef coral::AttributeList RecordHelper< TOutput >::AttributeList

Definition at line 153 of file RecordHelper.h.

template<class TOutput >
typedef std::vector<FieldHandlerBase<TOutput>*> RecordHelper< TOutput >::FieldVector

A list of field handlers that determine how to handle a record.

Definition at line 155 of file RecordHelper.h.

Constructor & Destructor Documentation

template<class TOutput >
virtual RecordHelper< TOutput >::~RecordHelper ( )
inlinevirtual

Destructor: Wipe out all the field handlers.

Definition at line 187 of file RecordHelper.h.

Member Function Documentation

template<class TOutput >
template<typename TField >
void RecordHelper< TOutput >::addField ( const std::string &  fieldName,
void(TOutput::*)(const TField)  setter 
)
inline

Definition at line 157 of file RecordHelper.h.

template<class TOutput >
virtual void RecordHelper< TOutput >::extractRecord ( const AttributeList source,
TOutput &  dest 
)
inlinevirtual

Iterates over all known fields and extracts the fields of the record in source to the object in dest.

Definition at line 168 of file RecordHelper.h.

template<class TOutput >
virtual std::vector<std::string> RecordHelper< TOutput >::getColumnList ( )
inlinevirtual

Returns a list of database column names for the added fields.

Definition at line 176 of file RecordHelper.h.

Member Data Documentation

template<class TOutput >
FieldVector RecordHelper< TOutput >::fields_
protected

List of known fields. TODO: Make private, add base type addField.

Definition at line 195 of file RecordHelper.h.