CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
ASCIIBoolFieldHandler< TOutput, FalseCharacter > Class Template Reference

#include <RecordHelper.h>

Inheritance diagram for ASCIIBoolFieldHandler< TOutput, FalseCharacter >:
FieldHandler< TOutput, bool, char > FieldHandlerBase< TOutput >

Public Types

typedef coral::AttributeList AttributeList
 
- Public Types inherited from FieldHandler< TOutput, bool, char >
typedef coral::AttributeList AttributeList
 
typedef void(TOutput::* TSetMethod) (const bool)
 
- Public Types inherited from FieldHandlerBase< TOutput >
typedef coral::AttributeList AttributeList
 

Public Member Functions

 ASCIIBoolFieldHandler (const std::string &fieldName, typename FieldHandler< TOutput, bool, char >::TSetMethod setter)
 
void extractValue (const AttributeList &src, TOutput &dest) override
 
- Public Member Functions inherited from FieldHandler< TOutput, bool, char >
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 ()
 

Additional Inherited Members

- Protected Attributes inherited from FieldHandler< TOutput, bool, char >
TSetMethod setter_
 

Detailed Description

template<class TOutput, char FalseCharacter>
class ASCIIBoolFieldHandler< TOutput, FalseCharacter >

A special handler for bool fields in the GT/GMT DBs. These can't be imported in the generic way because bool values are returned as char '0' for false and '1' for true from the database. Basically, all values that are != FalseCharacter are treated as true (in adherence to the venerable C tradition).

Definition at line 93 of file RecordHelper.h.

Member Typedef Documentation

◆ AttributeList

template<class TOutput , char FalseCharacter>
typedef coral::AttributeList ASCIIBoolFieldHandler< TOutput, FalseCharacter >::AttributeList

Definition at line 95 of file RecordHelper.h.

Constructor & Destructor Documentation

◆ ASCIIBoolFieldHandler()

template<class TOutput , char FalseCharacter>
ASCIIBoolFieldHandler< TOutput, FalseCharacter >::ASCIIBoolFieldHandler ( const std::string &  fieldName,
typename FieldHandler< TOutput, bool, char >::TSetMethod  setter 
)
inline

Definition at line 96 of file RecordHelper.h.

97  : FieldHandler<TOutput, bool, char>(fieldName, setter) {}

Member Function Documentation

◆ extractValue()

template<class TOutput , char FalseCharacter>
void ASCIIBoolFieldHandler< TOutput, FalseCharacter >::extractValue ( const AttributeList src,
TOutput &  dest 
)
inlineoverridevirtual

Extract value as char, then see compare it to '0' to get its truth value.

Implements FieldHandlerBase< TOutput >.

Definition at line 100 of file RecordHelper.h.

100  {
101  char value = src[this->getColumnName()].template data<char>();
102 #ifdef RECORDHELPER_DEBUG
103  std::cout << " .. and " << this->getColumnName() << " is (in integers) " << (int)value << std::endl;
104 #endif
105  ((dest).*(this->setter_))(value != FalseCharacter);
106  }

References gather_cfg::cout, mps_fire::dest, FieldHandlerBase< TOutput >::getColumnName(), createfilelist::int, FieldHandler< TOutput, bool, char >::setter_, and TrackRefitter_38T_cff::src.

gather_cfg.cout
cout
Definition: gather_cfg.py:144
FieldHandler< TOutput, bool, char >
FieldHandlerBase::getColumnName
virtual const std::string getColumnName()
Definition: RecordHelper.h:39
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
FieldHandler< TOutput, bool, char >::setter_
TSetMethod setter_
Definition: RecordHelper.h:84
mps_fire.dest
dest
Definition: mps_fire.py:179