CMS 3D CMS Logo

List of all members | 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 >

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)
 
- Public Member Functions inherited from FieldHandlerBase< TOutput >
 FieldHandlerBase (const std::string &name)
 
virtual const std::string getColumnName ()
 
const std::string & getName ()
 
virtual ~FieldHandlerBase ()
 

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

◆ AttributeList

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

Definition at line 61 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 62 of file RecordHelper.h.

Constructor & Destructor Documentation

◆ FieldHandler()

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.

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

Member Function Documentation

◆ 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 68 of file RecordHelper.h.

68  {
69 #ifdef RECORDHELPER_DEBUG
70  std::cout << "Parsing field " << this->getName() << " with type " << typeid(TCField).name();
71 #endif
73  const TDBFieldT& value = src[this->getColumnName()].template data<TDBFieldT>();
74  ((dest).*setter_)(TCField(value));
75 
76 #ifdef RECORDHELPER_DEBUG
77  std::cout << "=" << TCField(value) << std::endl;
78 #endif
79  }
const std::string & getName()
Definition: RecordHelper.h:35
virtual const std::string getColumnName()
Definition: RecordHelper.h:39
TSetMethod setter_
Definition: RecordHelper.h:84
Definition: value.py:1

Member Data Documentation

◆ setter_

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 84 of file RecordHelper.h.

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