#include <ROBFragment.h>
Inheritance diagram for eformat::ROBFragment< TPointer >:
Public Member Functions | |
Header & | assign (const TPointer &it, uint32_t match) |
ROBFragment & | assign (const TPointer &it) |
ROBFragment & | assign (const TPointer &it) |
virtual bool | check () const |
virtual bool | check () const |
bool | check_tree () const |
bool | check_tree () const |
virtual void | child (TPointer &p, size_t n) const |
virtual void | child (TPointer &p, size_t n) const |
virtual void | child_check (TPointer &p, size_t n) const |
virtual void | child_check (TPointer &p, size_t n) const |
virtual uint32_t | children (TPointer *p, size_t max) const |
virtual uint32_t | children (TPointer *p, size_t max) const |
void | end (TPointer &it) const |
void | end (TPointer &it) const |
uint32_t | fragment_size_word () const |
uint32_t | fragment_size_word () const |
uint32_t | header_size_word () const |
uint32_t | header_size_word () const |
uint32_t | marker () const |
uint32_t | marker () const |
virtual uint32_t | nchildren () const |
virtual uint32_t | nchildren () const |
uint32_t | nspecific () const |
uint32_t | nspecific () const |
uint32_t | nstatus () const |
uint32_t | nstatus () const |
ROBFragment & | operator= (const ROBFragment &other) |
ROBFragment & | operator= (const ROBFragment &other) |
void | payload (TPointer &it) const |
void | payload (TPointer &it) const |
uint32_t | payload_size_word (void) const |
uint32_t | payload_size_word (void) const |
ROBFragment () | |
ROBFragment (const ROBFragment &other) | |
ROBFragment (const TPointer &it) | |
ROBFragment () | |
ROBFragment (const ROBFragment &other) | |
ROBFragment (const TPointer &it) | |
uint32_t | rod_bc_id () const |
uint32_t | rod_bc_id () const |
void | rod_data (TPointer &it) const |
void | rod_data (TPointer &it) const |
uint32_t | rod_detev_type () const |
uint32_t | rod_detev_type () const |
uint32_t | rod_fragment_size_word () const |
uint32_t | rod_fragment_size_word () const |
uint32_t | rod_header_size_word () const |
uint32_t | rod_header_size_word () const |
uint32_t | rod_lvl1_id () const |
uint32_t | rod_lvl1_id () const |
uint32_t | rod_lvl1_trigger_type () const |
uint32_t | rod_lvl1_trigger_type () const |
uint32_t | rod_marker () const |
uint32_t | rod_marker () const |
uint32_t | rod_ndata () const |
uint32_t | rod_ndata () const |
uint32_t | rod_nstatus () const |
uint32_t | rod_nstatus () const |
uint32_t | rod_run_no () const |
uint32_t | rod_run_no () const |
uint32_t | rod_source_id () const |
uint32_t | rod_source_id () const |
void | rod_status (TPointer &it) const |
void | rod_status (TPointer &it) const |
uint32_t | rod_status_position () const |
uint32_t | rod_status_position () const |
uint32_t | rod_trailer_size_word () const |
uint32_t | rod_trailer_size_word () const |
uint32_t | rod_version () const |
uint32_t | rod_version () const |
uint32_t | source_id () const |
uint32_t | source_id () const |
void | specific_header (TPointer &it) const |
void | specific_header (TPointer &it) const |
void | start (TPointer &it) const |
void | start (TPointer &it) const |
void | status (TPointer &it) const |
void | status (TPointer &it) const |
uint32_t | version () const |
uint32_t | version () const |
virtual | ~ROBFragment () |
virtual | ~ROBFragment () |
Private Attributes | |
TPointer | m_start |
my last word | |
Static Private Attributes | |
const uint32_t | NSPECIFIC = 0 |
|
To build a fragment given the containing buffer. I need to know where the fragment starts in order to do that.
00194 : eformat::Header<TPointer>(it, eformat::ROB), 00195 m_start() 00196 { 00197 ERS_DEBUG_3("Building ROBFragment from pointer"); 00198 specific_header(m_start); 00199 ERS_DEBUG_1("Initialized header with source identifier = %s", 00200 eformat::helper::SourceIdentifier(source_id()).human().c_str()); 00201 ERS_DEBUG_3("Building underlying RODFragment"); 00202 if (rod_marker() != eformat::ROD) 00203 throw EFORMAT_WRONG_MARKER(rod_marker(), eformat::ROD); 00204 ERS_DEBUG_1("Initialized ROD header with source identifier = %s", 00205 eformat::helper::SourceIdentifier(rod_source_id()).human().c_str()); 00206 }
|
|
Copy constructor
|
|
Builds an empty, otherwise useless ROBFragment 00053 : Header<TPointer>(), m_start() {}
|
|
Destructor virtualisation 00058 {}
|
|
To build a fragment given the containing buffer. I need to know where the fragment starts in order to do that.
|
|
Copy constructor
|
|
Builds an empty, otherwise useless ROBFragment 00053 : Header<TPointer>(), m_start() {}
|
|
Destructor virtualisation 00058 {}
|
|
Reassign this header
00237 { 00238 ERS_DEBUG_3("Rebuilding header 0x%x from iterator", match); 00239 m_start = it; 00240 if (marker() != match) { 00241 throw EFORMAT_WRONG_MARKER(marker(), match); 00242 } 00243 ERS_DEBUG_1("Re-initialized header with source identifier = %s", 00244 eformat::helper::SourceIdentifier(match).human().c_str()); 00245 return *this; 00246 }
|
|
Manual re-assignment
|
|
Manual re-assignment
00210 { 00211 ERS_DEBUG_3("Re-building ROBFragment from pointer"); 00212 eformat::Header<TPointer>::assign(it, eformat::ROB); 00213 specific_header(m_start); 00214 ERS_DEBUG_1("Initialized header with source identifier = %s", 00215 eformat::helper::SourceIdentifier(source_id()).human().c_str()); 00216 ERS_DEBUG_3("Re-building underlying RODFragment"); 00217 if (rod_marker() != eformat::ROD) 00218 throw EFORMAT_WRONG_MARKER(rod_marker(), eformat::ROD); 00219 ERS_DEBUG_1("Reinitialized header with source identifier = %s", 00220 eformat::helper::SourceIdentifier(rod_source_id()).human().c_str()); 00221 return *this; 00222 }
|
|
Says if the the fragment is valid. This may throw exceptions. Reimplemented from eformat::Header< TPointer >. |
|
Says if the the fragment is valid. This may throw exceptions. Reimplemented from eformat::Header< TPointer >. 00226 { 00227 //ROB checking 00228 ERS_DEBUG_2("Checking for consistency of ROBFragment [%s]", 00229 eformat::helper::SourceIdentifier(source_id()).human().c_str()); 00230 eformat::Header<TPointer>::check(); //< first do a generic check 00231 if (eformat::Header<TPointer>::nspecific() != NSPECIFIC) 00232 throw EFORMAT_SIZE_CHECK(NSPECIFIC, nspecific()); 00233 00234 //ROD checking 00235 ERS_DEBUG_2("Checking for consistency of RODFragment [%s]", 00236 eformat::helper::SourceIdentifier(rod_source_id()).human().c_str()); 00237 if ( rod_version() >> 16 != eformat::MAJOR_DEFAULT_VERSION ) 00238 throw EFORMAT_BAD_VERSION(rod_version() >> 16, 00239 eformat::MAJOR_DEFAULT_VERSION); 00240 if ( rod_header_size_word() != 9 ) 00241 throw EFORMAT_SIZE_CHECK(9, rod_header_size_word()); 00242 if ( rod_fragment_size_word() != 12 + rod_nstatus() + rod_ndata() ) 00243 throw EFORMAT_SIZE_CHECK(rod_fragment_size_word(), 00244 (12 + rod_nstatus() + rod_ndata())); 00245 return true; 00246 }
|
|
Says if the the fragment is valid. This may throw exceptions. 00083 { check(); return true; }
|
|
Says if the the fragment is valid. This may throw exceptions. 00083 { check(); return true; }
|
|
Returns the nth child fragment. If the nth fragment doesn't exist, the behaviour is undefined.
|
|
Returns the nth child fragment. If the nth fragment doesn't exist, the behaviour is undefined.
00273 { 00274 ERS_DEBUG_2("User asked for child %ud of fragment type %s [%s]", n, 00275 eformat::marker2string(marker()).c_str(), 00276 eformat::helper::SourceIdentifier(source_id()).human().c_str()); 00277 TPointer next; 00278 payload(next); 00279 for (size_t i=0; i<n; ++i) next += next[1]; 00280 ERS_DEBUG_3("Set user object"); 00281 p = next; 00282 }
|
|
Returns the nth child fragment. If the nth fragment doesn't exist, an exception is thrown.
|
|
Returns the nth child fragment. If the nth fragment doesn't exist, an exception is thrown.
00286 { 00287 uint32_t total = nchildren(); 00288 if (n >= total) throw EFORMAT_NO_SUCH_CHILD(n, total); 00289 child(p, n); 00290 }
|
|
Returns all the children of this fragment. The input to this method is a valid set of iterators to existing, pre-allocated pointers
|
|
Returns all the children of this fragment. The input to this method is a valid set of iterators to existing, pre-allocated pointers
00294 { 00295 ERS_DEBUG_2("Retrieving all children..."); 00296 TPointer payload_start; 00297 payload(payload_start); 00298 try { 00299 return find_fragments(child_marker(static_cast<HeaderMarker>(marker())), 00300 payload_start, payload_size_word(), p, max); 00301 } 00302 catch (WrongMarkerIssue& ex) { 00303 //This normally means the fragment size is wrong... 00304 throw EFORMAT_WRONG_SIZE(fragment_size_word()); 00305 } 00306 return 0; 00307 }
|
|
Sets the pointer to one-past my end position
00144 { it = m_start; it += fragment_size_word(); }
|
|
Sets the pointer to one-past my end position
00144 { it = m_start; it += fragment_size_word(); }
|
|
Returns the size, in words, of the current fragment. 00100 { return m_start[1]; }
|
|
Returns the size, in words, of the current fragment. 00100 { return m_start[1]; }
|
|
Returns the size, in words, of the current header. That does include the specific part of the header. 00106 { return m_start[2]; }
|
|
Returns the size, in words, of the current header. That does include the specific part of the header. 00106 { return m_start[2]; }
|
|
Returns the fragment type. 00095 { return m_start[0]; }
|
|
Returns the fragment type. 00095 { return m_start[0]; }
|
|
Returns the number of children available. |
|
Returns the number of children available. 00264 { 00265 ERS_DEBUG_2("User asked for number of children of fragment type %s [%s]", 00266 eformat::marker2string(marker()).c_str(), 00267 eformat::helper::SourceIdentifier(source_id()).human().c_str()); 00268 return children(0,0); 00269 }
|
|
Returns the number of specific words available in the specific header part
|
|
Returns the number of specific words available in the specific header part
|
|
Returns the number of status words available 00121 { return m_start[5]; }
|
|
Returns the number of status words available 00121 { return m_start[5]; }
|
|
Assignment
00066 { Header<TPointer>::operator=(other); m_start=other.m_start; return *this; }
|
|
Assignment
00066 { Header<TPointer>::operator=(other); m_start=other.m_start; return *this; }
|
|
Sets the pointer to where the payload starts
00136 { it = m_start; it+= header_size_word(); }
|
|
Sets the pointer to where the payload starts
00136 { it = m_start; it+= header_size_word(); }
|
|
Returns the payload size 00150 { return fragment_size_word() - header_size_word(); }
|
|
Returns the payload size 00150 { return fragment_size_word() - header_size_word(); }
|
|
Returns the bunch crossing identifier 00130 { return m_start[6]; }
|
|
Returns the bunch crossing identifier 00130 { return m_start[6]; }
|
|
Returns a pointer to the first data word
|
|
Returns a pointer to the first data word
00258 { 00259 it = m_start; 00260 it += 9; 00261 if (!rod_status_position()) it += rod_nstatus(); 00262 }
|
|
Returns the detector event type 00140 { return m_start[8]; }
|
|
Returns the detector event type 00140 { return m_start[8]; }
|
|
Returns the total fragment size 00094 { return payload_size_word(); }
|
|
Returns the total fragment size 00094 { return payload_size_word(); }
|
|
Returns the size, in words, of the current header. That does not include the trailer. 00100 { return m_start[1]; }
|
|
Returns the size, in words, of the current header. That does not include the trailer. 00100 { return m_start[1]; }
|
|
Returns the lvl1 identifier 00125 { return m_start[5]; }
|
|
Returns the lvl1 identifier 00125 { return m_start[5]; }
|
|
Returns the lvl1 trigger type 00135 { return m_start[7]; }
|
|
Returns the lvl1 trigger type 00135 { return m_start[7]; }
|
|
Returns the fragment type. 00088 { return m_start[0]; }
|
|
Returns the fragment type. 00088 { return m_start[0]; }
|
|
Returns the number of data words available 00160 { return m_start[payload_size_word()-2]; }
|
|
Returns the number of data words available 00160 { return m_start[payload_size_word()-2]; }
|
|
Returns the number of status words available 00146 { return m_start[payload_size_word()-3]; }
|
|
Returns the number of status words available 00146 { return m_start[payload_size_word()-3]; }
|
|
Returns the current run number. 00120 { return m_start[4]; }
|
|
Returns the current run number. 00120 { return m_start[4]; }
|
|
Returns the full source identifier. 00115 { return m_start[3]; }
|
|
Returns the full source identifier. 00115 { return m_start[3]; }
|
|
Returns the status words, as an iterator to the status words available.
|
|
Returns the status words, as an iterator to the status words available.
00250 { 00251 it = m_start; 00252 it += 9; 00253 if (rod_status_position()) it += rod_ndata(); 00254 }
|
|
Returns the status block position. A value of 00175 { return m_start[payload_size_word()-1]; }
|
|
Returns the status block position. A value of 00175 { return m_start[payload_size_word()-1]; }
|
|
Returns the size, in words, of the trailer 00105 { return 3; }
|
|
Returns the size, in words, of the trailer 00105 { return 3; }
|
|
Returns the formatting version. 00110 { return m_start[2]; }
|
|
Returns the formatting version. 00110 { return m_start[2]; }
|
|
Returns the full source identifier. 00116 { return m_start[4]; }
|
|
Returns the full source identifier. 00116 { return m_start[4]; }
|
|
Returns an iterator to the start of the specific header part (this does not include the number of specific header fragments)
00173 { it = m_start; it += 7 + nstatus(); }
|
|
Returns an iterator to the start of the specific header part (this does not include the number of specific header fragments)
00173 { it = m_start; it += 7 + nstatus(); }
|
|
Sets the pointer to my start
00128 { it = m_start; }
|
|
Sets the pointer to my start
00128 { it = m_start; }
|
|
Returns the status words, as an iterator to the status words available.
00157 { it = m_start; it += 6; }
|
|
Returns the status words, as an iterator to the status words available.
00157 { it = m_start; it += 6; }
|
|
Returns the formatting version. 00111 { return m_start[3]; }
|
|
Returns the formatting version. 00111 { return m_start[3]; }
|
|
my last word
Reimplemented from eformat::Header< TPointer >. |
|
|