#include <FadcData.h>
Inheritance diagram for DybDaq::FadcData:
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 | ~FadcData () |
Destroy this instance of the class. | |
unsigned int | channelId () const |
Returns the channel id for this object. | |
unsigned char | highDataByte () const |
Returns the high data byte for this ojbect. | |
unsigned char | middleDataByte () const |
Returns the middle data byte for this ojbect. | |
unsigned char | lowDataByte () const |
Returns the low data byte for this ojbect. | |
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 const DaqTraits & | daqTraits () 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 | |
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 | |
FadcData (const unsigned int channelId, const unsigned int highDataByte, const unsigned int middleDataByte, const unsigned int lowDataByte, const FadcTraits &traits) | |
FadcData (const ByteBuffer &byteBuffer, const FadcTraits &traits) | |
Create an instance of this class. | |
FadcData () | |
Suppress default. | |
FadcData (FadcData &rhs) | |
Suppress default. | |
FadcData & | operator= (FadcData &rhs) |
Suppress default. | |
void | setChannelId (const unsigned int channelId) |
Set the channel id. | |
void | setHighDataByte (const unsigned int dataByte) |
Set the high data byte for this ojbect. | |
void | setMiddleDataByte (const unsigned int dataByte) |
Set the middle data byte for this ojbect. | |
void | setLowDataByte (const unsigned int dataByte) |
Set the low data byte for this ojbect. | |
Friends | |
class | FadcReadout |
Definition at line 20 of file FadcData.h.
FadcData::~FadcData | ( | ) | [virtual] |
FadcData::FadcData | ( | const unsigned int | channelId, | |
const unsigned int | highDataByte, | |||
const unsigned int | middleDataByte, | |||
const unsigned int | lowDataByte, | |||
const FadcTraits & | traits | |||
) | [private] |
Definition at line 16 of file FadcData.cc.
00020 : 00021 FadcBuffer(new char[traits.dataSize() * kBytesInInt], 00022 traits) { 00023 traits.initializeData(buffer()); 00024 setChannelId(channelId); 00025 setHighDataByte(highDataByte); 00026 setMiddleDataByte(middleDataByte); 00027 setLowDataByte(lowDataByte); 00028 }
FadcData::FadcData | ( | const ByteBuffer & | byteBuffer, | |
const FadcTraits & | traits | |||
) | [private] |
Create an instance of this class.
Definition at line 30 of file FadcData.cc.
00031 : 00032 FadcBuffer(byteBuffer, 00033 traits) { 00034 byteBuffer.position(byteBuffer.position() + (fadcTraits().dataSize() * kBytesInInt)); 00035 }
DybDaq::FadcData::FadcData | ( | ) | [private] |
Suppress default.
DybDaq::FadcData::FadcData | ( | FadcData & | rhs | ) | [private] |
Suppress default.
unsigned int FadcData::channelId | ( | ) | const |
Returns the channel id for this object.
Definition at line 44 of file FadcData.cc.
00044 { 00045 return readUnsignedInt(FadcTraits::kChannelId); 00046 }
unsigned char FadcData::highDataByte | ( | ) | const |
Returns the high data byte for this ojbect.
Definition at line 48 of file FadcData.cc.
00048 { 00049 return readUnsignedChar(FadcTraits::kHighDataByte); 00050 }
unsigned char FadcData::middleDataByte | ( | ) | const |
Returns the middle data byte for this ojbect.
Definition at line 52 of file FadcData.cc.
00052 { 00053 return readUnsignedChar(FadcTraits::kMiddleDataByte); 00054 }
unsigned char FadcData::lowDataByte | ( | ) | const |
Returns the low data byte for this ojbect.
Definition at line 56 of file FadcData.cc.
00056 { 00057 return readUnsignedChar(FadcTraits::kLowDataByte); 00058 }
unsigned int FadcData::bufferSize | ( | ) | const [virtual] |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
Implements DybDaq::DaqBuffer.
Definition at line 60 of file FadcData.cc.
00060 { 00061 return fadcTraits().dataSize(); 00062 }
unsigned int FadcData::formatComponent | ( | ) | const [protected, virtual] |
Returns the component with the format of this buffer.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 40 of file FadcData.cc.
00040 { 00041 return FadcTraits::kData; 00042 }
void FadcData::setChannelId | ( | const unsigned int | channelId | ) | [private] |
Set the channel id.
Definition at line 64 of file FadcData.cc.
00064 { 00065 writeField(channelId, 00066 FadcTraits::kChannelId); 00067 }
void FadcData::setHighDataByte | ( | const unsigned int | dataByte | ) | [private] |
Set the high data byte for this ojbect.
Definition at line 69 of file FadcData.cc.
00069 { 00070 writeField(dataByte, 00071 FadcTraits::kHighDataByte); 00072 }
void FadcData::setMiddleDataByte | ( | const unsigned int | dataByte | ) | [private] |
Set the middle data byte for this ojbect.
Definition at line 74 of file FadcData.cc.
00074 { 00075 writeField(dataByte, 00076 FadcTraits::kMiddleDataByte); 00077 }
void FadcData::setLowDataByte | ( | const unsigned int | dataByte | ) | [private] |
Set the low data byte for this ojbect.
Definition at line 79 of file FadcData.cc.
00079 { 00080 writeField(dataByte, 00081 FadcTraits::kLowDataByte); 00082 }
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 FadcData.h.