#include <CbltBody.h>
Inheritance diagram for DybDaq::CbltBody:
Public Types | |
typedef std::pair< const char *, unsigned int > | OutputBuffer |
typedef std::vector< OutputBuffer > | OutputBufferList |
typedef std::vector< ByteInspector * > | Bytes |
typedef std::vector< BitsInspector * > | Bits |
Public Member Functions | |
virtual | ~CbltBody () |
Destroy this instance of the class. | |
const RomData & | data () const |
virtual unsigned int | bufferSize () const |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer. | |
virtual unsigned int | gather (OutputBufferList &outputBuffers) const |
virtual unsigned int | gather (OutputBufferList &outputBuffers) const |
virtual unsigned int | inspect (DaqBuffer::Bytes &inspectors) const |
bool | hasDaqTraits () const |
virtual const DaqTraits & | daqTraits () const |
Static Public Attributes | |
static const unsigned int | kBytesInInt |
static const unsigned int | kUndefinedFormatComponent |
Protected Member Functions | |
CbltBody (const RomData *romData, const unsigned int moduleType, DaqExpandable &expandable) | |
Create an instance of this class. | |
CbltBody (const ByteBuffer &byteBuffer, const unsigned int moduleType, const unsigned int size, const CbltTraits &traits) | |
Create an instance of this class. | |
virtual unsigned int | gatherComponents (OutputBufferList &outputBuffers) const |
Gathers the DAQ formatted bytes for this object's components. | |
virtual unsigned int | inspectComponents (DaqBuffer::Bytes &inspectors) const |
Inspects the DAQ formatted bytes for this object's components. | |
virtual void | expanded (const unsigned int size) |
Tells this object that its contents has expanded by the specified number of bytes. | |
unsigned int | begin () const |
unsigned int | containerSize () const |
virtual unsigned int | gatherComponents (OutputBufferList &outputBuffers) const =0 |
bool | setExpandable (DaqExpandable &expandable) |
void | notifyExpandable (const unsigned int size) |
bool | expandedByRomData (const RomData *romData) |
const char * | buffer () const |
char * | buffer () |
bool | hasByteBuffer () const |
const ByteBuffer & | byteBuffer () const |
unsigned int | fillInspectors (DaqBuffer::Bytes &inspectors, unsigned int component, unsigned int cursor) const |
virtual bool | readBool (const unsigned int field) const |
virtual int | readInt (const unsigned int field) const |
virtual unsigned char | readUnsignedChar (const unsigned int field) const |
virtual unsigned int | readUnsignedInt (const unsigned int field) const |
virtual void | writeField (const bool value, const unsigned int field) |
virtual void | writeField (const int value, const unsigned int field) |
virtual void | writeField (const unsigned int value, const unsigned int field) |
virtual unsigned int | formatComponent () const |
Private Member Functions | |
CbltBody () | |
Suppress default. | |
CbltBody (CbltBody &rhs) | |
Suppress default. | |
CbltBody & | operator= (CbltBody &rhs) |
Suppress default. | |
Private Attributes | |
const RomData * | m_data |
The RomData for this event. | |
unsigned int | m_moduleType |
The type of module inside this object. | |
Friends | |
class | CbltReadout |
Definition at line 23 of file CbltBody.h.
CbltBody::~CbltBody | ( | ) | [virtual] |
CbltBody::CbltBody | ( | const RomData * | romData, | |
const unsigned int | moduleType, | |||
DaqExpandable & | expandable | |||
) | [protected] |
Create an instance of this class.
Definition at line 31 of file CbltBody.cc.
00033 : 00034 DaqContainer(expandable), 00035 m_data(data), 00036 m_moduleType(moduleType) { 00037 expandedByRomData(data); 00038 }
CbltBody::CbltBody | ( | const ByteBuffer & | byteBuffer, | |
const unsigned int | moduleType, | |||
const unsigned int | size, | |||
const CbltTraits & | traits | |||
) | [protected] |
Create an instance of this class.
Definition at line 40 of file CbltBody.cc.
00043 : 00044 DaqContainer(byteBuffer, 00045 traits, 00046 bufferSize), 00047 m_data(0), 00048 m_moduleType(moduleType) { 00049 byteBuffer.position(byteBuffer.position() + (bufferSize * kBytesInInt)); 00050 }
DybDaq::CbltBody::CbltBody | ( | ) | [private] |
Suppress default.
DybDaq::CbltBody::CbltBody | ( | CbltBody & | rhs | ) | [private] |
Suppress default.
const RomData & CbltBody::data | ( | ) | const |
Definition at line 58 of file CbltBody.cc.
00058 { 00059 if (0 == m_data && hasByteBuffer()) { 00060 const CbltTraits& traits = dynamic_cast<const CbltTraits&>(daqTraits()); 00061 const ByteBuffer& buffer = byteBuffer(); 00062 00063 const unsigned int originalPosition = buffer.position(); 00064 buffer.position(begin()); 00065 if (m_moduleType == traits.moduleType(CbltTraits::kFadcModule)) { 00066 m_data = new FadcReadout(buffer, 00067 containerSize()); 00068 } else if (m_moduleType == traits.moduleType(CbltTraits::kFeeModule)) { 00069 m_data = new FeeReadout(buffer, 00070 containerSize()); 00071 } else if (m_moduleType == traits.moduleType(CbltTraits::kLtbModule)) { 00072 m_data = new LtbReadout(buffer, 00073 containerSize()); 00074 } 00075 else if ( m_moduleType == traits.moduleType(CbltTraits::kRpcRomModule)) { 00076 const unsigned int version = (traits.majorVersion() << 4) | traits.minorVersion(); 00077 m_data = new FecReadout(buffer, containerSize(), version); 00078 } 00079 else if ( m_moduleType == traits.moduleType(CbltTraits::kRpcRtmModule)) { 00080 const unsigned int version = (traits.majorVersion() << 4) | traits.minorVersion(); 00081 m_data = new RtmReadout(buffer, containerSize(), version); 00082 } 00083 buffer.position(originalPosition); 00084 } 00085 return *m_data; 00086 }
unsigned int CbltBody::bufferSize | ( | ) | const [virtual] |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
Implements DybDaq::DaqContainer.
Definition at line 88 of file CbltBody.cc.
unsigned int CbltBody::gatherComponents | ( | OutputBufferList & | outputBuffers | ) | const [protected, virtual] |
Gathers the DAQ formatted bytes for this object's components.
Definition at line 92 of file CbltBody.cc.
unsigned int CbltBody::inspectComponents | ( | DaqBuffer::Bytes & | inspectors | ) | const [protected, virtual] |
Inspects the DAQ formatted bytes for this object's components.
Implements DybDaq::DaqContainer.
Definition at line 96 of file CbltBody.cc.
00096 { 00097 // return 0; 00098 return data().inspectRom(inspectors); 00099 }
void CbltBody::expanded | ( | const unsigned int | size | ) | [protected, virtual] |
Tells this object that its contents has expanded by the specified number of bytes.
Implements DybDaq::DaqContainer.
Definition at line 101 of file CbltBody.cc.
00101 { 00102 notifyExpandable(size); 00103 }
friend class CbltReadout [friend] |
Definition at line 27 of file CbltBody.h.
const RomData* DybDaq::CbltBody::m_data [mutable, private] |
unsigned int DybDaq::CbltBody::m_moduleType [private] |