#include <RunParametersRecord.h>
Inheritance diagram for DybDaq::RunParametersRecord:
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 | |
RunParametersRecord (const unsigned int runNumber, const bool recordEnabled, const unsigned int triggerType, const unsigned int detectorMask, const FileTraits &traits) | |
Create an instance of this class. | |
RunParametersRecord (const DybDaq::ByteBuffer &byteBuffer, const FileTraits &traits) | |
Create an instance of this class. | |
virtual | ~RunParametersRecord () |
Destroy this instance of the class. | |
virtual bool | isMarked (unsigned int marker) const |
Returns true if this object contains the specified marker. | |
unsigned int | runNumber () const |
Returns the run number of this file's data. | |
bool | recordEnabled () const |
Returns true if recording is enabled. | |
unsigned int | triggerType () const |
Returns the trigger type. | |
unsigned int | detectorMask () const |
Returns the detector mask used while this data was taken. | |
const FileTraits & | fileTraits () const |
Returns the FileTraits instance used to parse this object's buffer. | |
unsigned int | marker () const |
Returns the marker for this FileBuffer. | |
unsigned int | size () const |
Returns the length of this record in 4-byte words. | |
virtual unsigned int | bufferSize () const |
Returns the size, in 4-bytes,, of this object's contents in the 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. | |
void | setMarker (const unsigned int marker) |
Sets the marker for this FileBuffer. | |
void | setSize (const unsigned int size) |
Sets the size, in 4-bytes,, of this object's contents in the 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 | |
RunParametersRecord () | |
Suppress default. | |
RunParametersRecord (RunParametersRecord &rhs) | |
Suppress default. | |
RunParametersRecord & | operator= (RunParametersRecord &rhs) |
Suppress default. | |
void | setRunNumber (const unsigned int runNumber) |
Sets the run number of this file's data. | |
void | setRecordEnabled (const bool recordEnabled) |
Sets true if recording is enabled. | |
void | setTriggerType (const unsigned int triggerType) |
Sets the trigger type. | |
void | setDetectorMask (const unsigned int detectorMask) |
Sets the detector mask used while this data was taken. |
Definition at line 17 of file RunParametersRecord.h.
RunParametersRecord::RunParametersRecord | ( | const unsigned int | runNumber, | |
const bool | recordEnabled, | |||
const unsigned int | triggerType, | |||
const unsigned int | detectorMask, | |||
const FileTraits & | traits | |||
) |
Create an instance of this class.
Definition at line 16 of file RunParametersRecord.cc.
00020 : 00021 FileBuffer(new char[traits.recordSize(FileTraits::kRunParametersRecord) * kBytesInInt], 00022 traits, 00023 FileTraits::kRunParametersRecord) { 00024 setRunNumber(runNumber); 00025 setRecordEnabled(recordEnabled); 00026 setTriggerType(triggerType); 00027 setDetectorMask(detectorMask); 00028 }
RunParametersRecord::RunParametersRecord | ( | const DybDaq::ByteBuffer & | byteBuffer, | |
const FileTraits & | traits | |||
) |
Create an instance of this class.
Definition at line 30 of file RunParametersRecord.cc.
00031 : 00032 FileBuffer(byteBuffer, 00033 traits) { 00034 }
RunParametersRecord::~RunParametersRecord | ( | ) | [virtual] |
DybDaq::RunParametersRecord::RunParametersRecord | ( | ) | [private] |
Suppress default.
DybDaq::RunParametersRecord::RunParametersRecord | ( | RunParametersRecord & | rhs | ) | [private] |
Suppress default.
bool RunParametersRecord::isMarked | ( | unsigned int | marker | ) | const [virtual] |
Returns true if this object contains the specified marker.
Implements DybDaq::FileBuffer.
Definition at line 39 of file RunParametersRecord.cc.
00039 { 00040 return FileTraits::kRunParametersRecord == marker; 00041 }
unsigned int RunParametersRecord::runNumber | ( | ) | const |
Returns the run number of this file's data.
Definition at line 43 of file RunParametersRecord.cc.
00043 { 00044 return readUnsignedInt(FileTraits::kFileRunNumber); 00045 }
bool RunParametersRecord::recordEnabled | ( | ) | const |
Returns true if recording is enabled.
Definition at line 47 of file RunParametersRecord.cc.
00047 { 00048 return readUnsignedInt(FileTraits::kRecordEnabled); 00049 }
unsigned int RunParametersRecord::triggerType | ( | ) | const |
Returns the trigger type.
Definition at line 51 of file RunParametersRecord.cc.
00051 { 00052 return readUnsignedInt(FileTraits::kRunTriggerType); 00053 }
unsigned int RunParametersRecord::detectorMask | ( | ) | const |
Returns the detector mask used while this data was taken.
Definition at line 55 of file RunParametersRecord.cc.
00055 { 00056 return readUnsignedInt(FileTraits::kRunDetectorMask); 00057 }
unsigned int RunParametersRecord::formatComponent | ( | ) | const [protected, virtual] |
Returns the component with the format of this buffer.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 59 of file RunParametersRecord.cc.
00059 { 00060 return FileTraits::kRunParametersRecord; 00061 }
RunParametersRecord& DybDaq::RunParametersRecord::operator= | ( | RunParametersRecord & | rhs | ) | [private] |
Suppress default.
void RunParametersRecord::setRunNumber | ( | const unsigned int | runNumber | ) | [private] |
Sets the run number of this file's data.
Definition at line 63 of file RunParametersRecord.cc.
00063 { 00064 writeField(runNumber, 00065 FileTraits::kFileRunNumber); 00066 }
void RunParametersRecord::setRecordEnabled | ( | const bool | recordEnabled | ) | [private] |
Sets true if recording is enabled.
Definition at line 68 of file RunParametersRecord.cc.
00068 { 00069 writeField(recordEnabled, 00070 FileTraits::kRecordEnabled); 00071 }
void RunParametersRecord::setTriggerType | ( | const unsigned int | triggerType | ) | [private] |
Sets the trigger type.
Definition at line 73 of file RunParametersRecord.cc.
00073 { 00074 writeField(triggerType, 00075 FileTraits::kRunTriggerType); 00076 }
void RunParametersRecord::setDetectorMask | ( | const unsigned int | detectorMask | ) | [private] |
Sets the detector mask used while this data was taken.
Definition at line 78 of file RunParametersRecord.cc.
00078 { 00079 writeField(detectorMask, 00080 FileTraits::kRunDetectorMask); 00081 }
const FileTraits & FileBuffer::fileTraits | ( | ) | const [inherited] |
Returns the FileTraits instance used to parse this object's buffer.
Definition at line 40 of file FileBuffer.cc.
00040 { 00041 return dynamic_cast<const FileTraits&>(daqTraits()); 00042 }
unsigned int FileBuffer::marker | ( | ) | const [inherited] |
Returns the marker for this FileBuffer.
Definition at line 44 of file FileBuffer.cc.
00044 { 00045 return readUnsignedInt(FileTraits::kMarker); 00046 }
unsigned int FileBuffer::size | ( | ) | const [inherited] |
Returns the length of this record in 4-byte words.
Definition at line 48 of file FileBuffer.cc.
00048 { 00049 return readUnsignedInt(FileTraits::kRecordSize); 00050 }
unsigned int FileBuffer::bufferSize | ( | ) | const [virtual, inherited] |
Returns the size, in 4-bytes,, of this object's contents in the buffer.
Implements DybDaq::DaqBuffer.
Definition at line 52 of file FileBuffer.cc.
00052 { 00053 return size(); 00054 }
void FileBuffer::setMarker | ( | const unsigned int | marker | ) | [protected, inherited] |
Sets the marker for this FileBuffer.
Definition at line 56 of file FileBuffer.cc.
00056 { 00057 writeField(marker, 00058 FileTraits::kMarker); 00059 }
void FileBuffer::setSize | ( | const unsigned int | size | ) | [protected, inherited] |
Sets the size, in 4-bytes,, of this object's contents in the buffer.
Definition at line 61 of file FileBuffer.cc.
00061 { 00062 writeField(size, 00063 FileTraits::kRecordSize); 00064 }