8#ifndef _Belle2_RunInfoBuffer_h
9#define _Belle2_RunInfoBuffer_h
11#include "daq/slc/system/SharedMemory.h"
12#include "daq/slc/system/MMutex.h"
13#include "daq/slc/system/MCond.h"
14#include "daq/slc/readout/ronode_info.h"
44 CPRFIFO_LEF_FULL = 0x80
56 bool open(
const std::string& nodename,
57 int nodeid = 0,
bool recreate =
false);
69 const std::string getName()
const {
return m_nodename; }
70 const std::string getPath()
const {
return m_path; }
71 bool isAvailable()
const {
return m_info != NULL; }
73 unsigned int getNodeId()
const {
return m_info->nodeid; }
74 unsigned int getState()
const {
return m_info->state; }
75 unsigned int getErrorFlag()
const {
return m_info->eflag; }
76 unsigned int getExpNumber()
const {
return m_info->expno; }
77 unsigned int getRunNumber()
const {
return m_info->runno; }
78 unsigned int getSubNumber()
const {
return m_info->subno; }
79 int getInputPort()
const {
return m_info->io[0].port; }
80 int getInputAddress()
const {
return m_info->io[0].addr; }
81 unsigned int getInputCount()
const {
return m_info->io[0].count; }
82 unsigned long long getInputNBytes()
const {
return m_info->io[0].nbyte; }
83 int getOutputPort()
const {
return m_info->io[1].port; }
84 int getOutputAddress()
const {
return m_info->io[1].addr; }
85 unsigned int getOutputCount()
const {
return m_info->io[1].count; }
86 unsigned long long getOutputNBytes()
const {
return m_info->io[1].nbyte; }
87 void setNodeId(
unsigned int id) { m_info->nodeid = id; }
88 void setState(State state) { m_info->state = (
unsigned int)state; }
89 void setErrorFlag(EFlag eflag) { m_info->eflag = (
unsigned int)eflag; }
90 void setExpNumber(
unsigned int expno) { m_info->expno = expno; }
91 void setRunNumber(
unsigned int runno) { m_info->runno = runno; }
92 void setSubNumber(
unsigned int subno) { m_info->subno = subno; }
93 void setInputPort(
int port) { m_info->io[0].port = port; }
94 void setInputAddress(
int addr) { m_info->io[0].addr = addr; }
95 void setInputCount(
unsigned int count) { m_info->io[0].count = count; }
96 void setInputNBytes(
unsigned long long nbyte) { m_info->io[0].nbyte = nbyte; }
97 void addInputCount(
unsigned int count) { m_info->io[0].count += count; }
98 void addInputNBytes(
unsigned long long nbyte) { m_info->io[0].nbyte += nbyte; }
99 void setOutputPort(
int port) { m_info->io[1].port = port; }
100 void setOutputAddress(
int addr) { m_info->io[1].addr = addr; }
101 void setOutputCount(
unsigned int count) { m_info->io[1].count = count; }
102 void setOutputNBytes(
unsigned long long nbyte) { m_info->io[1].nbyte = nbyte; }
103 void addOutputCount(
unsigned int count) { m_info->io[1].count += count; }
104 void addOutputNBytes(
unsigned long long nbyte) { m_info->io[1].nbyte += nbyte; }
105 event_header& getEventHeader() {
return m_info->header; }
106 void copyEventHeader(
int* buf);
107 bool isNotReady() {
return (m_info) && m_info->state == NOTREADY; }
108 bool isReady() {
return (m_info) && m_info->state == READY; }
109 bool isRunning() {
return (m_info) && m_info->state == RUNNING; }
110 bool isPausing() {
return (m_info) && m_info->state == PAUSING; }
111 bool isPaused() {
return (m_info) && m_info->state == PAUSED; }
112 bool isResuming() {
return (m_info) && m_info->state == RESUMING; }
114 bool waitRunning(
int timeout);
115 bool waitReady(
int timeout);
116 bool reportRunning();
117 bool reportError(EFlag eflag);
119 bool reportNotReady();
122 std::string m_nodename;
Abstract base class for different kinds of events.