CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
FieldHandler< TOutput, TCField, TDBField > Class Template Reference

#include <RecordHelper.h>

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

Public Types

typedef coral::AttributeList AttributeList
 
typedef void(TOutput::* TSetMethod) (const TCField)
 
- Public Types inherited from FieldHandlerBase< TOutput >
typedef coral::AttributeList AttributeList
 

Public Member Functions

void extractValue (const AttributeList &src, TOutput &dest) override
 
 FieldHandler (const std::string &fieldName, TSetMethod setter)
 
 FieldHandler ()=delete
 
- Public Member Functions inherited from FieldHandlerBase< TOutput >
 FieldHandlerBase (const std::string &name)
 
 FieldHandlerBase ()=delete
 
virtual const std::string getColumnName ()
 
const std::string & getName ()
 
virtual ~FieldHandlerBase ()
 

Protected Member Functions

void call (TOutput &dest, const TCField value)
 

Protected Attributes

TSetMethod setter_ = nullptr
 

Detailed Description

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

A template field handler that simply

Definition at line 60 of file RecordHelper.h.

Member Typedef Documentation

◆ AttributeList

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

Definition at line 62 of file RecordHelper.h.

◆ TSetMethod

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

Definition at line 63 of file RecordHelper.h.

Constructor & Destructor Documentation

◆ FieldHandler() [1/2]

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

Definition at line 65 of file RecordHelper.h.

66  : FieldHandlerBase<TOutput>(fieldName), setter_(setter) {}
TSetMethod setter_
Definition: RecordHelper.h:88

◆ FieldHandler() [2/2]

template<class TOutput, class TCField, class TDBField>
FieldHandler< TOutput, TCField, TDBField >::FieldHandler ( )
delete

Member Function Documentation

◆ call()

template<class TOutput, class TCField, class TDBField>
void FieldHandler< TOutput, TCField, TDBField >::call ( TOutput &  dest,
const TCField  value 
)
inlineprotected

◆ extractValue()

template<class TOutput, class TCField, class TDBField>
void FieldHandler< TOutput, TCField, TDBField >::extractValue ( const AttributeList src,
TOutput &  dest 
)
inlineoverridevirtual

Actual data extraction.

Implements FieldHandlerBase< TOutput >.

Definition at line 71 of file RecordHelper.h.

71  {
72 #ifdef RECORDHELPER_DEBUG
73  std::cout << "Parsing field " << this->getName() << " with type " << typeid(TCField).name();
74 #endif
76  const TDBFieldT& value = src[this->getColumnName()].template data<TDBFieldT>();
77  call(dest, TCField(value));
78 
79 #ifdef RECORDHELPER_DEBUG
80  std::cout << "=" << TCField(value) << std::endl;
81 #endif
82  }
void call(TOutput &dest, const TCField value)
Definition: RecordHelper.h:85
const std::string & getName()
Definition: RecordHelper.h:36
virtual const std::string getColumnName()
Definition: RecordHelper.h:40
Definition: value.py:1

Member Data Documentation

◆ setter_

template<class TOutput, class TCField, class TDBField>
TSetMethod FieldHandler< TOutput, TCField, TDBField >::setter_ = nullptr
protected

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

Definition at line 88 of file RecordHelper.h.

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