1 #ifndef Belle2_SharedEventBuffer_h
2 #define Belle2_SharedEventBuffer_h
4 #include "daq/slc/system/SharedMemory.h"
5 #include "daq/slc/system/MMutex.h"
6 #include "daq/slc/system/MCond.h"
21 unsigned int count_in;
22 unsigned int count_out;
23 unsigned long long nword_in;
24 unsigned long long nword_out;
25 unsigned short nwriter;
26 unsigned short nreader;
37 if (m_buf != NULL) m_memory.close();
41 size_t size() throw();
42 bool open(const std::
string& nodename,
43 size_t nword,
bool recreate = false);
48 bool unlock() throw();
50 bool wait(
int time) throw();
51 bool notify() throw();
53 bool isOpened() {
return m_memory.isOpened(); }
56 const std::string getPath()
const throw() {
return m_path; }
57 Header* getHeader() throw() {
return m_header; }
58 int* getBuffer() throw() {
return m_buf; }
59 bool isWritable(
int nword)
throw();
60 bool isReadable(
int nword)
throw();
61 unsigned int write(
const int* buf,
unsigned int nword,
62 bool fouce,
unsigned int serial = 0)
64 return write(buf, nword, fouce, serial,
false);
66 unsigned int write(
const int* buf,
unsigned int nword,
67 bool fouce,
unsigned int serial,
bool unlocked);
68 unsigned int read(
int* buf,
bool fouce,
bool unlocked, Header* hdr = NULL);
72 SharedMemory m_memory;