#include <FecReadout.h>
Inheritance diagram for DybDaq::FecReadout:
Public Types | |
typedef std::vector< const FecData * > | FecDataPtrList |
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 | |
FecReadout (const FecTraits &traits) | |
FecReadout (const ByteBuffer &byteBuffer, const unsigned int length, const unsigned int verFormat=0) | |
virtual | ~FecReadout () |
virtual const DaqTraits & | daqTraits () const |
const FecDataPtrList & | fecDataList () const |
virtual unsigned int | romSize () const |
virtual unsigned int | gatherRom (OutputBufferList &outputBuffers) const |
virtual unsigned int | inspectRom (DaqBuffer::Bytes &inspectors) const |
virtual unsigned int | bufferSize () const |
const FecData & | addFecData (const unsigned int rpcCFId, const unsigned int rpcFecId, const bool transErr1, const bool transErr2, const unsigned int trigType, const bool fullFlag, const bool validGPS, const bool validCLK, const bool usingUTC, const unsigned int second, const unsigned int nanoSecond, const unsigned int hitMap) |
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 unsigned int | gatherRom (DaqBuffer::OutputBufferList &outputBuffers) const =0 |
Static Public Attributes | |
static const unsigned int | kBytesInInt |
static const unsigned int | kUndefinedFormatComponent |
Protected Member Functions | |
virtual unsigned int | gatherComponents (OutputBufferList &outputBuffers) const |
virtual unsigned int | inspectComponents (DaqBuffer::Bytes &inspectors) const |
virtual void | expanded (const unsigned int size) |
virtual bool | setRomExpandable (DaqExpandable &expandable) |
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 | |
FecReadout () | |
FecReadout (const FecReadout &) | |
FecReadout & | operator= (const FecReadout &) |
const FecTraits & | fecTraits () const |
const FecData & | add (const FecData *fecData) |
Private Attributes | |
FecDataPtrList * | m_fecList |
unsigned int | m_verFormat |
const FecTraits * | m_fecTraits |
Friends | |
friend class | DaqContainer |
Definition at line 18 of file FecReadout.h.
typedef std::vector<const FecData*> DybDaq::FecReadout::FecDataPtrList |
Definition at line 21 of file FecReadout.h.
FecReadout::FecReadout | ( | const FecTraits & | traits | ) |
Definition at line 14 of file FecReadout.cc.
00015 : DaqContainer(), 00016 m_fecList(0), 00017 m_verFormat(0), 00018 m_fecTraits(&traits) 00019 { 00020 }
FecReadout::FecReadout | ( | const ByteBuffer & | byteBuffer, | |
const unsigned int | length, | |||
const unsigned int | verFormat = 0 | |||
) |
Definition at line 22 of file FecReadout.cc.
00025 : DaqContainer(byteBuffer, bufferSize), 00026 m_fecList(0), 00027 m_verFormat(verFormat), 00028 m_fecTraits(0) 00029 { 00030 byteBuffer.position( byteBuffer.position() + bufferSize * kBytesInInt ); 00031 }
FecReadout::~FecReadout | ( | ) | [virtual] |
DybDaq::FecReadout::FecReadout | ( | ) | [private] |
DybDaq::FecReadout::FecReadout | ( | const FecReadout & | ) | [private] |
const DaqTraits & FecReadout::daqTraits | ( | ) | const [virtual] |
Reimplemented from DybDaq::DaqContainer.
Definition at line 45 of file FecReadout.cc.
00046 { 00047 return fecTraits(); 00048 }
const FecReadout::FecDataPtrList & FecReadout::fecDataList | ( | ) | const |
Definition at line 50 of file FecReadout.cc.
00051 { 00052 if ( m_fecList == 0 ) { 00053 m_fecList = new FecDataPtrList(); 00054 if ( hasByteBuffer() ) { 00055 const FecTraits& traits = fecTraits(); 00056 const ByteBuffer& buffer = byteBuffer(); 00057 00058 const unsigned int originalPosition = buffer.position(); 00059 buffer.position( begin() ); 00060 const unsigned int finished = containerSize() / traits.fecSize(); 00061 for ( unsigned int count = 0; count != finished; ++count ) { 00062 FecData* fecData = new FecData(buffer, traits); 00063 m_fecList->push_back(fecData); 00064 } 00065 buffer.position( originalPosition ); 00066 } 00067 } 00068 return *m_fecList; 00069 }
unsigned int FecReadout::romSize | ( | ) | const [virtual] |
Implements DybDaq::RomData.
Definition at line 71 of file FecReadout.cc.
00072 { 00073 return bufferSize(); 00074 }
unsigned int FecReadout::gatherRom | ( | OutputBufferList & | outputBuffers | ) | const [virtual] |
unsigned int FecReadout::inspectRom | ( | DaqBuffer::Bytes & | inspectors | ) | const [virtual] |
Implements DybDaq::RomData.
Definition at line 81 of file FecReadout.cc.
00082 { 00083 return inspect(inspectors); 00084 }
unsigned int FecReadout::bufferSize | ( | ) | const [virtual] |
Implements DybDaq::DaqContainer.
Definition at line 86 of file FecReadout.cc.
00087 { 00088 unsigned int result = 0; 00089 const FecDataPtrList& fecList = fecDataList(); 00090 00091 FecDataPtrList::const_iterator it = fecList.begin(); 00092 while ( it != fecList.end() ) { 00093 result += (*it)->bufferSize(); 00094 ++it; 00095 } 00096 00097 return result; 00098 }
const FecData & FecReadout::addFecData | ( | const unsigned int | rpcCFId, | |
const unsigned int | rpcFecId, | |||
const bool | transErr1, | |||
const bool | transErr2, | |||
const unsigned int | trigType, | |||
const bool | fullFlag, | |||
const bool | validGPS, | |||
const bool | validCLK, | |||
const bool | usingUTC, | |||
const unsigned int | second, | |||
const unsigned int | nanoSecond, | |||
const unsigned int | hitMap | |||
) |
Definition at line 100 of file FecReadout.cc.
00112 { 00113 FecData* result = new FecData(rpcCFId, 00114 rpcFecId, 00115 transErr1, 00116 transErr2, 00117 trigType, 00118 fullFlag, 00119 validGPS, 00120 validCLK, 00121 usingUTC, 00122 second, 00123 nanoSecond, 00124 hitMap, 00125 fecTraits() ); 00126 return add( result ); 00127 }
unsigned int FecReadout::gatherComponents | ( | OutputBufferList & | outputBuffers | ) | const [protected, virtual] |
Definition at line 129 of file FecReadout.cc.
00130 { 00131 unsigned int result = 0; 00132 const FecDataPtrList& fecList = fecDataList(); 00133 00134 FecDataPtrList::const_iterator it = fecList.begin(); 00135 while ( it != fecList.end() ) { 00136 result += (*it)->gather(outputBuffers); 00137 ++it; 00138 } 00139 00140 return result; 00141 }
unsigned int FecReadout::inspectComponents | ( | DaqBuffer::Bytes & | inspectors | ) | const [protected, virtual] |
Implements DybDaq::DaqContainer.
Definition at line 143 of file FecReadout.cc.
00144 { 00145 unsigned int result = 0; 00146 const FecDataPtrList& fecList = fecDataList(); 00147 00148 FecDataPtrList::const_iterator it = fecList.begin(); 00149 while ( it != fecList.end() ) { 00150 result += (*it)->inspect(inspectors); 00151 ++it; 00152 } 00153 00154 return result; 00155 }
void FecReadout::expanded | ( | const unsigned int | size | ) | [protected, virtual] |
Implements DybDaq::DaqContainer.
Definition at line 157 of file FecReadout.cc.
00158 { 00159 notifyExpandable(size); 00160 }
bool FecReadout::setRomExpandable | ( | DaqExpandable & | expandable | ) | [protected, virtual] |
Implements DybDaq::RomData.
Definition at line 162 of file FecReadout.cc.
00163 { 00164 return setExpandable(expandable); 00165 }
FecReadout& DybDaq::FecReadout::operator= | ( | const FecReadout & | ) | [private] |
const FecTraits & FecReadout::fecTraits | ( | ) | const [private] |
Definition at line 167 of file FecReadout.cc.
00168 { 00169 if ( m_fecTraits == 0 ) { 00170 m_fecTraits = FecTraits::getTraits(m_verFormat); 00171 } 00172 return *m_fecTraits; 00173 }
Definition at line 175 of file FecReadout.cc.
00176 { 00177 if ( m_fecList == 0 ) { 00178 m_fecList = new FecDataPtrList(); 00179 } 00180 00181 m_fecList->push_back(fecData); 00182 expanded( fecData->bufferSize() ); 00183 00184 return *fecData; 00185 }
FecDataPtrList* DybDaq::FecReadout::m_fecList [mutable, private] |
Definition at line 101 of file FecReadout.h.
unsigned int DybDaq::FecReadout::m_verFormat [private] |
Definition at line 104 of file FecReadout.h.
const FecTraits* DybDaq::FecReadout::m_fecTraits [mutable, private] |
Definition at line 107 of file FecReadout.h.