CMS 3D CMS Logo

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 >

List of all members.

Public Types

typedef coral::AttributeList AttributeList

Public Member Functions

 ASCIIBoolFieldHandler (const std::string &fieldName, typename FieldHandler< TOutput, bool, char >::TSetMethod setter)
virtual void extractValue (const AttributeList &src, TOutput &dest)

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

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

Reimplemented from FieldHandler< TOutput, bool, char >.

Definition at line 96 of file RecordHelper.h.


Constructor & Destructor Documentation

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

Definition at line 97 of file RecordHelper.h.

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

Member Function Documentation

template<class TOutput , char FalseCharacter>
virtual void ASCIIBoolFieldHandler< TOutput, FalseCharacter >::extractValue ( const AttributeList src,
TOutput &  dest 
) [inline, virtual]

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

Reimplemented from FieldHandler< TOutput, bool, char >.

Definition at line 103 of file RecordHelper.h.

References gather_cfg::cout, alignCSCRings::dest, FieldHandlerBase< TOutput >::getColumnName(), FieldHandler< TOutput, bool, char >::setter_, and relativeConstraints::value.

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