BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
eformat::SubDetectorFragment< TPointer > Class Template Reference

#include <SubDetectorFragment.h>

+ Inheritance diagram for eformat::SubDetectorFragment< TPointer >:

Public Member Functions

 SubDetectorFragment (const TPointer &it)
 
 SubDetectorFragment ()
 
 SubDetectorFragment (const SubDetectorFragment &other)
 
virtual ~SubDetectorFragment ()
 
SubDetectorFragmentoperator= (const SubDetectorFragment &other)
 
SubDetectorFragmentassign (const TPointer &it)
 
virtual bool check () const
 
bool check_tree () const
 
- Public Member Functions inherited from eformat::Header< TPointer >
 Header (const TPointer &it, uint32_t match)
 
 Header ()
 
 Header (const Header &other)
 
virtual ~Header ()
 
Headeroperator= (const Header &other)
 
Headerassign (const TPointer &it, uint32_t match)
 
virtual bool check () const
 
uint32_t marker () const
 
uint32_t fragment_size_word () const
 
uint32_t header_size_word () const
 
uint32_t version () const
 
uint32_t source_id () const
 
uint32_t nstatus () const
 
void start (TPointer &it) const
 
void payload (TPointer &it) const
 
void end (TPointer &it) const
 
uint32_t payload_size_word (void) const
 
void status (TPointer &it) const
 
uint32_t nspecific () const
 
void specific_header (TPointer &it) const
 
virtual uint32_t nchildren () const
 
virtual void child (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
 

Detailed Description

template<class TPointer>
class eformat::SubDetectorFragment< TPointer >

Describes how to access the contents of a subdetector fragment, as prescribed by the event format note.

Definition at line 29 of file SubDetectorFragment.h.

Constructor & Destructor Documentation

◆ SubDetectorFragment() [1/3]

template<class TPointer >
eformat::SubDetectorFragment< TPointer >::SubDetectorFragment ( const TPointer &  it)

To build a fragment given the containing buffer. I need to know where the fragment starts in order to do that.

Parameters
itThe exact position where this fragment should start.

Definition at line 100 of file SubDetectorFragment.h.

103 m_start()
104{
105 specific_header(m_start);
106}
void specific_header(TPointer &it) const
Definition: Header.h:172
@ SUB_DETECTOR
The SubDet. marker.
Definition: HeaderMarker.h:29

◆ SubDetectorFragment() [2/3]

template<class TPointer >
eformat::SubDetectorFragment< TPointer >::SubDetectorFragment ( )
inline

Builds an empty, otherwise useless SubDetectorFragment

Definition at line 44 of file SubDetectorFragment.h.

44: Header<TPointer>(), m_start() {}

◆ SubDetectorFragment() [3/3]

template<class TPointer >
eformat::SubDetectorFragment< TPointer >::SubDetectorFragment ( const SubDetectorFragment< TPointer > &  other)
inline

Copy constructor

Parameters
otherThe fragment to be copied

Definition at line 51 of file SubDetectorFragment.h.

52 : Header<TPointer>(other), m_start(other.m_start) {}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

◆ ~SubDetectorFragment()

template<class TPointer >
virtual eformat::SubDetectorFragment< TPointer >::~SubDetectorFragment ( )
inlinevirtual

Destructor virtualisation

Definition at line 57 of file SubDetectorFragment.h.

57{}

Member Function Documentation

◆ assign()

template<class TPointer >
eformat::SubDetectorFragment< TPointer > & eformat::SubDetectorFragment< TPointer >::assign ( const TPointer &  it)

Manual re-assignment

Parameters
itThe position pointing the first word of this fragment

Definition at line 109 of file SubDetectorFragment.h.

110{
111 ERS_DEBUG_3("Re-building SubDetectorFragment from pointer");
113 specific_header(m_start);
114 ERS_DEBUG_1("Initialized header with source identifier = %s",
116 return *this;
117}
#define ERS_DEBUG_1(...)
#define ERS_DEBUG_3(...)
uint32_t source_id() const
Definition: Header.h:116
Header & assign(const TPointer &it, uint32_t match)
Definition: Header.h:236
char * c_str(Index i)
Definition: EvtCyclic3.cc:252

◆ check()

template<class TPointer >
bool eformat::SubDetectorFragment< TPointer >::check
virtual

Says if the the fragment is valid. This may throw exceptions.

Reimplemented from eformat::Header< TPointer >.

Definition at line 120 of file SubDetectorFragment.h.

121{
122 ERS_DEBUG_2("Checking for consistency of SubDetectorFragment");
123 eformat::Header<TPointer>::check(); //< first do a generic check
124 if (this->nspecific() != NSPECIFIC) {
125 throw EFORMAT_SIZE_CHECK(NSPECIFIC, this->nspecific());
126 }
127 return true;
128}
#define EFORMAT_SIZE_CHECK(actual, informed)
#define ERS_DEBUG_2(...)
uint32_t nspecific() const
Definition: Header.h:164
virtual bool check() const
Definition: Header.h:249

◆ check_tree()

template<class TPointer >
bool eformat::SubDetectorFragment< TPointer >::check_tree

Says if the the fragment is valid. This may throw exceptions.

Definition at line 131 of file SubDetectorFragment.h.

132{
133 ERS_DEBUG_2("Checking recursively for consistency of SubDetectorFragment");
134 check(); // check myself
135 uint32_t total = this->nchildren();
136 for (size_t i=0; i<total; ++i) {
137 TPointer fp;
138 child(fp, i);
140 f.check_tree();
141 }
142 return true;
143}
virtual uint32_t nchildren() const
Definition: Header.h:263
virtual void child(TPointer &p, size_t n) const
Definition: Header.h:272

Referenced by eformat::FullEventFragment< TPointer >::check_tree().

◆ operator=()

template<class TPointer >
SubDetectorFragment & eformat::SubDetectorFragment< TPointer >::operator= ( const SubDetectorFragment< TPointer > &  other)
inline

Copy operator

Parameters
otherThe fragment to be copied

Definition at line 64 of file SubDetectorFragment.h.

65 { Header<TPointer>::operator=(other); m_start=other.m_start; return *this; }
Header & operator=(const Header &other)
Definition: Header.h:75

The documentation for this class was generated from the following file: