CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Attributes

FieldHandler< TOutput, TCField, TDBField > Class Template Reference

#include <RecordHelper.h>

Inheritance diagram for FieldHandler< TOutput, TCField, TDBField >:
FieldHandlerBase< TOutput >

List of all members.

Public Types

typedef coral::AttributeList AttributeList
typedef void(TOutput::* TSetMethod )(const TCField)

Public Member Functions

virtual void extractValue (const AttributeList &src, TOutput &dest)
 FieldHandler (const std::string &fieldName, TSetMethod setter)

Protected Attributes

TSetMethod setter_

Detailed Description

template<class TOutput, class TCField, class TDBField>
class FieldHandler< TOutput, TCField, TDBField >

A template field handler that simply

Definition at line 59 of file RecordHelper.h.


Member Typedef Documentation

template<class TOutput, class TCField, class TDBField>
typedef coral::AttributeList FieldHandler< TOutput, TCField, TDBField >::AttributeList

Reimplemented from FieldHandlerBase< TOutput >.

Reimplemented in ASCIIBoolFieldHandler< TOutput, FalseCharacter >.

Definition at line 61 of file RecordHelper.h.

template<class TOutput, class TCField, class TDBField>
typedef void(TOutput::* FieldHandler< TOutput, TCField, TDBField >::TSetMethod)(const TCField)

Definition at line 62 of file RecordHelper.h.


Constructor & Destructor Documentation

template<class TOutput, class TCField, class TDBField>
FieldHandler< TOutput, TCField, TDBField >::FieldHandler ( const std::string &  fieldName,
TSetMethod  setter 
) [inline]

Definition at line 64 of file RecordHelper.h.

                                  : FieldHandlerBase<TOutput>(fieldName), setter_(setter) 
  { }

Member Function Documentation

template<class TOutput, class TCField, class TDBField>
virtual void FieldHandler< TOutput, TCField, TDBField >::extractValue ( const AttributeList src,
TOutput &  dest 
) [inline, virtual]

Actual data extraction.

Implements FieldHandlerBase< TOutput >.

Reimplemented in ASCIIBoolFieldHandler< TOutput, FalseCharacter >.

Definition at line 69 of file RecordHelper.h.

                                                                     { 
#ifdef RECORDHELPER_DEBUG
    std::cout << "Parsing field " << this->getName() << " with type " << typeid(TCField).name() ;
#endif
    typedef typename boost::remove_cv<typename boost::remove_reference<TDBField>::type>::type TDBFieldT;
    const TDBFieldT & value = src[this->getColumnName()].template data< TDBFieldT >();
    ((dest).*setter_)(TCField(value));

#ifdef RECORDHELPER_DEBUG
    std::cout << "=" << TCField(value) << std::endl ; 
#endif
  }

Member Data Documentation

template<class TOutput, class TCField, class TDBField>
TSetMethod FieldHandler< TOutput, TCField, TDBField >::setter_ [protected]

Points to the setter method used to stuff the field's value into the destination object.

Definition at line 85 of file RecordHelper.h.

Referenced by FieldHandler< TOutput, bool, char >::extractValue().