#include <FadcHead.h>
Inheritance diagram for DybDaq::FadcHead:
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 | ~FadcHead () |
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 fadc format. | |
unsigned int | triggerNumber () const |
Returns the trigger number from this readout. | |
unsigned int | triggerType () const |
Returns the trigger type from this readout. | |
bool | noData () const |
Returns true if there is no data, just a head and foot. | |
virtual unsigned int | bufferSize () const |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer. | |
const FadcTraits & | fadcTraits () const |
Returns the FadcTraits 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 | |
FadcHead (const unsigned int triggerNumber, const unsigned int triggerType, const bool noData, const FadcTraits &traits) | |
Create an instance of this class. | |
FadcHead (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 | |
FadcHead () | |
Suppress default. | |
FadcHead (FadcHead &rhs) | |
Suppress default. | |
FadcHead & | operator= (FadcHead &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 | setNoData (const bool checked) |
Sets whether there is no data, just a head and foot or not. | |
Private Attributes | |
const FadcTraits * | m_traits |
The FadcTraits instance used to parse this object's buffer. | |
Friends | |
class | FadcReadout |
Definition at line 20 of file FadcHead.h.
FadcHead::~FadcHead | ( | ) | [virtual] |
FadcHead::FadcHead | ( | const unsigned int | triggerNumber, | |
const unsigned int | triggerType, | |||
const bool | noData, | |||
const FadcTraits & | traits | |||
) | [protected] |
Create an instance of this class.
Definition at line 17 of file FadcHead.cc.
00020 : 00021 FadcBuffer(new char[traits.headSize() * kBytesInInt], 00022 traits) { 00023 m_traits = &traits; 00024 traits.initializeHead(buffer()); 00025 setTriggerNumber(triggerNumber); 00026 setTriggerType(triggerType); 00027 setNoData(noData); 00028 }
FadcHead::FadcHead | ( | const ByteBuffer & | byteBuffer | ) | [protected] |
Create an instance of this class.
Definition at line 31 of file FadcHead.cc.
00031 : 00032 FadcBuffer(byteBuffer, 00033 *((FadcTraits*)0)) { 00034 const char* buffer = byteBuffer.cursor(); 00035 m_traits = FadcTraits::readTraits(buffer); 00036 byteBuffer.position(byteBuffer.position() + kBytesInInt); 00037 }
DybDaq::FadcHead::FadcHead | ( | ) | [private] |
Suppress default.
DybDaq::FadcHead::FadcHead | ( | FadcHead & | rhs | ) | [private] |
Suppress default.
const DaqTraits & FadcHead::daqTraits | ( | ) | const [virtual] |
Returns the DaqTraits instance used to parse this object's buffer.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 50 of file FadcHead.cc.
00050 { 00051 return *m_traits; 00052 }
unsigned int FadcHead::version | ( | ) | const |
Returns the version of the fadc format.
Definition at line 46 of file FadcHead.cc.
00046 { 00047 return readUnsignedInt(FadcTraits::kMinorVersion); 00048 }
unsigned int FadcHead::triggerNumber | ( | ) | const |
Returns the trigger number from this readout.
Definition at line 54 of file FadcHead.cc.
00054 { 00055 return readUnsignedInt(FadcTraits::kHeadTriggerNumber); 00056 }
unsigned int FadcHead::triggerType | ( | ) | const |
Returns the trigger type from this readout.
Definition at line 58 of file FadcHead.cc.
00058 { 00059 return readUnsignedInt(FadcTraits::kTriggerType); 00060 }
bool FadcHead::noData | ( | ) | const |
Returns true if there is no data, just a head and foot.
Definition at line 62 of file FadcHead.cc.
00062 { 00063 return readBool(FadcTraits::kNoData); 00064 }
unsigned int FadcHead::bufferSize | ( | ) | const [virtual] |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
Implements DybDaq::DaqBuffer.
Definition at line 66 of file FadcHead.cc.
00066 { 00067 return fadcTraits().headSize(); 00068 }
unsigned int FadcHead::formatComponent | ( | ) | const [protected, virtual] |
Returns the component with the format of this buffer.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 42 of file FadcHead.cc.
00042 { 00043 return FadcTraits::kHead; 00044 }
void FadcHead::setTriggerNumber | ( | const unsigned int | triggerNumber | ) | [private] |
Sets the trigger number from this readout.
Definition at line 70 of file FadcHead.cc.
00070 { 00071 writeField(triggerNumber, 00072 FadcTraits::kHeadTriggerNumber); 00073 }
void FadcHead::setTriggerType | ( | const unsigned int | triggerType | ) | [private] |
Sets the trigger type from this readout.
Definition at line 75 of file FadcHead.cc.
00075 { 00076 writeField(triggerType, 00077 FadcTraits::kTriggerType); 00078 }
void FadcHead::setNoData | ( | const bool | checked | ) | [private] |
Sets whether there is no data, just a head and foot or not.
Definition at line 80 of file FadcHead.cc.
00080 { 00081 writeField(noData, 00082 FadcTraits::kNoData); 00083 }
const FadcTraits & FadcBuffer::fadcTraits | ( | ) | const [inherited] |
Returns the FadcTraits instance used to parse this object's buffer.
Definition at line 32 of file FadcBuffer.cc.
00032 { 00033 return dynamic_cast<const FadcTraits&>(daqTraits()); 00034 }
friend class FadcReadout [friend] |
Definition at line 24 of file FadcHead.h.
const FadcTraits* DybDaq::FadcHead::m_traits [private] |
The FadcTraits instance used to parse this object's buffer.
This is set after construction, so can not use base class's.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 118 of file FadcHead.h.