#include <CbltTraits.h>
Inheritance diagram for DybDaq::CbltTraits:
Public Types | |
typedef std::vector< BitsDefinition > | Definitions |
Public Member Functions | |
virtual | ~CbltTraits () |
Destroy this instance of the class. | |
virtual unsigned int | illegalMarker () const |
Returns the index value for an illegal header. | |
virtual unsigned int | illegalField () const |
Returns the index value for an illegal field. | |
virtual unsigned int | moduleType (unsigned int module) const |
Returns the module type for the specified module, or 0xffffffU. | |
virtual const char * | moduleTypeAsString (unsigned int moduleType) const |
Returns the string for the specified module type. | |
virtual unsigned int | headSize () const =0 |
Returns the size of a CbltHead in this format. | |
virtual unsigned int | footSize () const =0 |
Returns the size of a CbltFoot in this format. | |
virtual void | initializeHead (char *buffer) const =0 |
Initializes the CbltHead memory with the appropriate markers. | |
virtual void | initializeFoot (char *buffer) const =0 |
Initializes the CbltFoot memory with the appropriate markers. | |
virtual unsigned int | majorVersion () const =0 |
virtual unsigned int | minorVersion () const =0 |
virtual const std::string | versionString () const =0 |
virtual unsigned int | marker (unsigned int marker) const |
virtual const char * | boolAsString (bool value) const |
const DaqTraits::Definitions & | bitsDefinitions (unsigned int component) const |
Static Public Member Functions | |
static const CbltTraits & | defaultTraits () |
Returns a new default LtbTraits to bootstrap the system. | |
static const CbltTraits * | readTraits (const char *&buffer) |
Returns a new LtbTraits if the supplied traits do not match the current one. | |
Static Public Attributes | |
static const unsigned int | kHead = 0 |
The head component for this format. | |
static const unsigned int | kBody = CbltTraits::kHead + 1 |
The body component for this format. | |
static const unsigned int | kFoot = CbltTraits::kBody + 1 |
The foot component for this format. | |
static const unsigned int | kHeadModuleAddress = 0 |
The field for the module address. | |
static const unsigned int | kHeadModuleType = CbltTraits::kHeadModuleAddress + 1 |
The field for the module type. | |
static const unsigned int | kFootModuleAddress = CbltTraits::kHeadModuleType + 1 |
The field for the module address. | |
static const unsigned int | kFootDataLength = CbltTraits::kFootModuleAddress + 1 |
The field for the module type. | |
static const unsigned int | kMajorVersion = CbltTraits::kFootDataLength + 1 |
The field for the major version. | |
static const unsigned int | kMinorVersion = CbltTraits::kMajorVersion + 1 |
The field for the minor version. | |
static const unsigned int | kFeeModule = 0 |
The ModuleType of the FEE. | |
static const unsigned int | kFadcModule = CbltTraits::kFeeModule + 1 |
The ModuleType of the Trigger. | |
static const unsigned int | kLtbModule = CbltTraits::kFadcModule + 1 |
The ModuleType of the Local Trigger Board. | |
static const unsigned int | kRpcRomModule = CbltTraits::kLtbModule + 1 |
The ModuleType of the ROM Readout module. | |
static const unsigned int | kRpcRtmModule = CbltTraits::kRpcRomModule + 1 |
The ModuleType of the ROM Readout module. | |
static const unsigned int | kMtbModule = CbltTraits::kRpcRtmModule + 1 |
The ModuleType of the Master Trigger Board. | |
Protected Member Functions | |
CbltTraits () | |
Creates an instance of this class. | |
virtual unsigned int | maxModuleType () const =0 |
Returns the maximum module type. | |
virtual const unsigned int * | moduleTypes () const =0 |
Returns the array of data type strings. | |
virtual const char ** | moduleTypeStrings () const =0 |
Returns the array of site strings. | |
unsigned int | index (unsigned int field) const |
virtual unsigned int | markersEnd () const =0 |
virtual const unsigned int * | markers () const =0 |
virtual unsigned int | fieldsEnd () const =0 |
virtual const unsigned int * | indices () const =0 |
virtual const unsigned int * | shifts () const =0 |
virtual const unsigned int * | masks () const =0 |
virtual const std::string * | descriptions () const |
virtual DaqTraits::Definitions * | definitions (unsigned int component) const |
virtual void | setDefinitions (DaqTraits::Definitions *definitions, unsigned int component) |
virtual const unsigned int * | componentFields (unsigned int component) const |
virtual const unsigned int | componentFieldsEnd (unsigned int component) const |
Static Protected Member Functions | |
static unsigned int | readUnsignedInt (const char *&buffer, const DaqTraits &traits, unsigned int field) |
Private Member Functions | |
CbltTraits (CbltTraits &rhs) | |
Suppress default. | |
CbltTraits & | operator= (CbltTraits &rhs) |
Suppress default. | |
Friends | |
friend class | DaqBuffer |
Definition at line 17 of file CbltTraits.h.
CbltTraits::~CbltTraits | ( | ) | [virtual] |
CbltTraits::CbltTraits | ( | ) | [protected] |
DybDaq::CbltTraits::CbltTraits | ( | CbltTraits & | rhs | ) | [private] |
Suppress default.
const CbltTraits & CbltTraits::defaultTraits | ( | ) | [static] |
Returns a new default LtbTraits to bootstrap the system.
Definition at line 51 of file CbltTraits.cc.
00051 { 00052 if (0 == m_allTraits.size()) { 00053 m_allTraits.insert(std::pair<const char*, CbltTraits*>(CbltTraits_v0_0::key(),new CbltTraits_v0_0())); 00054 } 00055 return *m_allTraits[CbltTraits_v0_0::key()]; 00056 }
const CbltTraits * CbltTraits::readTraits | ( | const char *& | buffer | ) | [static] |
Returns a new LtbTraits if the supplied traits do not match the current one.
Definition at line 58 of file CbltTraits.cc.
00058 { 00059 defaultTraits(); // Initializes traits' map 00060 return m_allTraits[CbltTraits_v0_0::key()]; 00061 /* 00062 const unsigned int major = readUnsignedInt(buffer, 00063 defaultTraits(), 00064 CbltTraits::kMajorVersion); 00065 const unsigned int minor = readUnsignedInt(buffer, 00066 defaultTraits(), 00067 CbltTraits::kMinorVersion); 00068 const CbltTraits* result = 0; 00069 if (0U == major && 0U == minor) { 00070 result = m_allTraits[CbltTraits_v0_0::key()]; 00071 } else if (1U == major && 3U == minor) { 00072 result = m_allTraits[CbltTraits_v1_3::key()]; 00073 } 00074 return result; 00075 */ 00076 }
unsigned int CbltTraits::illegalMarker | ( | ) | const [virtual] |
Returns the index value for an illegal header.
Implements DybDaq::DaqTraits.
Definition at line 78 of file CbltTraits.cc.
unsigned int CbltTraits::illegalField | ( | ) | const [virtual] |
Returns the index value for an illegal field.
Implements DybDaq::DaqTraits.
Definition at line 82 of file CbltTraits.cc.
unsigned int CbltTraits::moduleType | ( | unsigned int | module | ) | const [virtual] |
Returns the module type for the specified module, or 0xffffffU.
Definition at line 86 of file CbltTraits.cc.
00086 { 00087 if (module > maxModuleType()) { 00088 return 0xffffffffU; 00089 } 00090 return moduleTypes()[module]; 00091 }
const char * CbltTraits::moduleTypeAsString | ( | unsigned int | moduleType | ) | const [virtual] |
Returns the string for the specified module type.
Definition at line 93 of file CbltTraits.cc.
00093 { 00094 return moduleTypeStrings()[moduleType]; 00095 }
virtual unsigned int DybDaq::CbltTraits::headSize | ( | ) | const [pure virtual] |
Returns the size of a CbltHead in this format.
Implemented in DybDaq::CbltTraits_v0_0, and DybDaq::CbltTraits_v1_3.
virtual unsigned int DybDaq::CbltTraits::footSize | ( | ) | const [pure virtual] |
Returns the size of a CbltFoot in this format.
Implemented in DybDaq::CbltTraits_v0_0, and DybDaq::CbltTraits_v1_3.
virtual void DybDaq::CbltTraits::initializeHead | ( | char * | buffer | ) | const [pure virtual] |
Initializes the CbltHead memory with the appropriate markers.
Implemented in DybDaq::CbltTraits_v0_0, and DybDaq::CbltTraits_v1_3.
virtual void DybDaq::CbltTraits::initializeFoot | ( | char * | buffer | ) | const [pure virtual] |
Initializes the CbltFoot memory with the appropriate markers.
Implemented in DybDaq::CbltTraits_v0_0, and DybDaq::CbltTraits_v1_3.
virtual unsigned int DybDaq::CbltTraits::maxModuleType | ( | ) | const [protected, pure virtual] |
Returns the maximum module type.
Implemented in DybDaq::CbltTraits_v0_0, and DybDaq::CbltTraits_v1_3.
virtual const unsigned int* DybDaq::CbltTraits::moduleTypes | ( | ) | const [protected, pure virtual] |
Returns the array of data type strings.
Implemented in DybDaq::CbltTraits_v0_0, and DybDaq::CbltTraits_v1_3.
virtual const char** DybDaq::CbltTraits::moduleTypeStrings | ( | ) | const [protected, pure virtual] |
Returns the array of site strings.
Implemented in DybDaq::CbltTraits_v0_0, and DybDaq::CbltTraits_v1_3.
CbltTraits& DybDaq::CbltTraits::operator= | ( | CbltTraits & | rhs | ) | [private] |
Suppress default.
const unsigned int CbltTraits::kHead = 0 [static] |
const unsigned int CbltTraits::kBody = CbltTraits::kHead + 1 [static] |
const unsigned int CbltTraits::kFoot = CbltTraits::kBody + 1 [static] |
const unsigned int CbltTraits::kHeadModuleAddress = 0 [static] |
const unsigned int CbltTraits::kHeadModuleType = CbltTraits::kHeadModuleAddress + 1 [static] |
const unsigned int CbltTraits::kFootModuleAddress = CbltTraits::kHeadModuleType + 1 [static] |
const unsigned int CbltTraits::kFootDataLength = CbltTraits::kFootModuleAddress + 1 [static] |
const unsigned int CbltTraits::kMajorVersion = CbltTraits::kFootDataLength + 1 [static] |
const unsigned int CbltTraits::kMinorVersion = CbltTraits::kMajorVersion + 1 [static] |
const unsigned int CbltTraits::kFeeModule = 0 [static] |
const unsigned int CbltTraits::kFadcModule = CbltTraits::kFeeModule + 1 [static] |
const unsigned int CbltTraits::kLtbModule = CbltTraits::kFadcModule + 1 [static] |
const unsigned int CbltTraits::kRpcRomModule = CbltTraits::kLtbModule + 1 [static] |
const unsigned int CbltTraits::kRpcRtmModule = CbltTraits::kRpcRomModule + 1 [static] |
const unsigned int CbltTraits::kMtbModule = CbltTraits::kRpcRtmModule + 1 [static] |