#include <FeeHead.h>
Inheritance diagram for DybDaq::FeeHead:
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 | ~FeeHead () |
Destroy this instance of the class. | |
virtual const DaqTraits & | daqTraits () const |
Returns the DaqTraits instance used to parse this object's buffer. | |
unsigned int | version () const |
Returns the version of the fee format. | |
unsigned int | triggerNumber () const |
Returns the trigger number from this readout. | |
unsigned int | triggerType () const |
Returns the trigger type from this readout. | |
bool | checked () const |
Returns true if the data is checked. | |
bool | error () const |
Returns true if the data has an error. | |
virtual unsigned int | bufferSize () const |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer. | |
const FeeTraits & | feeTraits () const |
Returns the FeeTraits instance used to parse this object's buffer. | |
bool | hasDaqTraits () const |
virtual unsigned int | gather (OutputBufferList &outputBuffers) const |
virtual unsigned int | inspect (DaqBuffer::Bytes &inspectors) const |
Static Public Attributes | |
static const unsigned int | kBytesInInt |
static const unsigned int | kUndefinedFormatComponent |
Protected Member Functions | |
FeeHead (const unsigned int triggerNumber, const unsigned int triggerType, const bool checked, const bool error, const FeeTraits &traits) | |
Create an instance of this class. | |
FeeHead (const ByteBuffer &byteBuffer) | |
Create an instance of this class. | |
virtual unsigned int | formatComponent () const |
Returns the component with the format of this buffer. | |
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) |
Private Member Functions | |
FeeHead () | |
Suppress default. | |
FeeHead (FeeHead &rhs) | |
Suppress default. | |
FeeHead & | operator= (FeeHead &rhs) |
Suppress default. | |
void | setTriggerNumber (const unsigned int triggerNumber) |
Sets the trigger number from this readout. | |
void | setTriggerType (const unsigned int triggerType) |
Sets the trigger type from this readout. | |
void | setChecked (const bool checked) |
Sets whether the data is checked or not. | |
void | setError (const bool error) |
Sets whether the data has an error or not. | |
Private Attributes | |
const FeeTraits * | m_traits |
The FeeTraits instance used to parse this object's buffer. | |
Friends | |
class | FeeReadout |
Definition at line 20 of file FeeHead.h.
FeeHead::~FeeHead | ( | ) | [virtual] |
FeeHead::FeeHead | ( | const unsigned int | triggerNumber, | |
const unsigned int | triggerType, | |||
const bool | checked, | |||
const bool | error, | |||
const FeeTraits & | traits | |||
) | [protected] |
Create an instance of this class.
Definition at line 18 of file FeeHead.cc.
00022 : 00023 FeeBuffer(new char[traits.headSize() * kBytesInInt], 00024 traits) { 00025 m_traits = &traits; 00026 traits.initializeHead(buffer()); 00027 setTriggerNumber(triggerNumber); 00028 setTriggerType(triggerType); 00029 setChecked(checked); 00030 setError(error); 00031 }
FeeHead::FeeHead | ( | const ByteBuffer & | byteBuffer | ) | [protected] |
Create an instance of this class.
Definition at line 34 of file FeeHead.cc.
00034 : 00035 FeeBuffer(byteBuffer, 00036 *((FeeTraits*)0)) { 00037 const char* buffer = byteBuffer.cursor(); 00038 m_traits = FeeTraits::readTraits(buffer); 00039 byteBuffer.position(byteBuffer.position() + kBytesInInt); 00040 }
DybDaq::FeeHead::FeeHead | ( | ) | [private] |
Suppress default.
DybDaq::FeeHead::FeeHead | ( | FeeHead & | rhs | ) | [private] |
Suppress default.
const DaqTraits & FeeHead::daqTraits | ( | ) | const [virtual] |
Returns the DaqTraits instance used to parse this object's buffer.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 49 of file FeeHead.cc.
00049 { 00050 return *m_traits; 00051 }
unsigned int FeeHead::version | ( | ) | const |
Returns the version of the fee format.
Definition at line 45 of file FeeHead.cc.
00045 { 00046 return readUnsignedInt(FeeTraits::kMinorVersion); 00047 }
unsigned int FeeHead::triggerNumber | ( | ) | const |
Returns the trigger number from this readout.
Definition at line 57 of file FeeHead.cc.
00057 { 00058 return readUnsignedInt(FeeTraits::kHeadTriggerNumber); 00059 }
unsigned int FeeHead::triggerType | ( | ) | const |
Returns the trigger type from this readout.
Definition at line 61 of file FeeHead.cc.
00061 { 00062 return readUnsignedInt(FeeTraits::kTriggerType); 00063 }
bool FeeHead::checked | ( | ) | const |
Returns true if the data is checked.
Definition at line 65 of file FeeHead.cc.
00065 { 00066 return readUnsignedInt(FeeTraits::kChecked); 00067 }
bool FeeHead::error | ( | ) | const |
Returns true if the data has an error.
Definition at line 69 of file FeeHead.cc.
00069 { 00070 return readUnsignedInt(FeeTraits::kError); 00071 }
unsigned int FeeHead::bufferSize | ( | ) | const [virtual] |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
Implements DybDaq::DaqBuffer.
Definition at line 73 of file FeeHead.cc.
00073 { 00074 return feeTraits().headSize(); 00075 }
unsigned int FeeHead::formatComponent | ( | ) | const [protected, virtual] |
Returns the component with the format of this buffer.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 53 of file FeeHead.cc.
00053 { 00054 return FeeTraits::kHead; 00055 }
void FeeHead::setTriggerNumber | ( | const unsigned int | triggerNumber | ) | [private] |
Sets the trigger number from this readout.
Definition at line 77 of file FeeHead.cc.
00077 { 00078 writeField(triggerNumber, 00079 FeeTraits::kHeadTriggerNumber); 00080 }
void FeeHead::setTriggerType | ( | const unsigned int | triggerType | ) | [private] |
Sets the trigger type from this readout.
Definition at line 82 of file FeeHead.cc.
00082 { 00083 writeField(triggerType, 00084 FeeTraits::kTriggerType); 00085 }
void FeeHead::setChecked | ( | const bool | checked | ) | [private] |
Sets whether the data is checked or not.
Definition at line 87 of file FeeHead.cc.
00087 { 00088 writeField(checked, 00089 FeeTraits::kChecked); 00090 }
void FeeHead::setError | ( | const bool | error | ) | [private] |
Sets whether the data has an error or not.
Definition at line 92 of file FeeHead.cc.
00092 { 00093 writeField(error, 00094 FeeTraits::kError); 00095 }
const FeeTraits & FeeBuffer::feeTraits | ( | ) | const [inherited] |
Returns the FeeTraits instance used to parse this object's buffer.
Definition at line 34 of file FeeBuffer.cc.
00034 { 00035 return dynamic_cast<const FeeTraits&>(daqTraits()); 00036 }
friend class FeeReadout [friend] |
const FeeTraits* DybDaq::FeeHead::m_traits [private] |
The FeeTraits instance used to parse this object's buffer.
This is set after construction, so can not use base class's.
Reimplemented from DybDaq::DaqBuffer.