test
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
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

virtual void extractValue (const AttributeList &src, TOutput &dest)
 
 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

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

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.

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

Member Function Documentation

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

Actual data extraction.

Implements FieldHandlerBase< TOutput >.

Reimplemented in ASCIIBoolFieldHandler< TOutput, FalseCharacter >.

Definition at line 69 of file RecordHelper.h.

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

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().