Belle II Software  release-05-02-19
EventBuffer.h
1 #ifndef Belle2_EventBuffer_h
2 #define Belle2_EventBuffer_h
3 
4 namespace Belle2 {
10  class EventBuffer {
11 
12  public:
13  struct Header {
14  unsigned int expno;
15  unsigned int runno;
16  unsigned int subno;
17  unsigned int count_in;
18  unsigned int count_out;
19  unsigned long long nword_in;
20  unsigned long long nword_out;
21  unsigned short nwriter;
22  unsigned short nreader;
23  };
24 
25  public:
26  EventBuffer()
27  {
28  m_buf = 0;
29  m_nword = 0;
30  }
31  EventBuffer(unsigned int nword);
32  ~EventBuffer();
33 
34  public:
35  unsigned int size() throw();
36  bool init();
37  void clear();
38 
39  public:
40  Header& getHeader() throw() { return m_header; }
41  int* getBuffer() throw() { return m_buf; }
42  bool isWritable(int nword) throw();
43  bool isReadable() throw();
44  unsigned int write(const int* buf, unsigned int nword,
45  unsigned int serial = 0);
46  unsigned int read(int* buf, Header* hdr = 0);
47 
48  private:
49  Header m_header;
50  int* m_buf;
51  unsigned int m_nword;
52 
53  };
54 
56 }
57 
58 #endif
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EventBuffer
Definition: EventBuffer.h:10
Belle2::EventBuffer::Header
Definition: EventBuffer.h:13