8#ifndef _Belle2_NSMCommunicator_hh
9#define _Belle2_NSMCommunicator_hh
11#include "daq/slc/nsm/NSMMessage.h"
12#include "daq/slc/nsm/NSMNode.h"
14#include <daq/slc/system/Mutex.h>
34 typedef std::vector<NSMCommunicator*> NSMCommunicatorList;
41 static NSMCommunicatorList& get() {
return g_comm; }
45 static NSMCommunicatorList g_comm;
47 static Mutex g_mutex_select;
55 void init(
const NSMNode& node,
const std::string& host,
int port)
63 int getId()
const {
return m_id; }
64 void setId(
int id) { m_id = id; }
66 const NSMMessage& getMessage()
const {
return m_message; }
68 const NSMNode& getNode()
const {
return m_node; }
69 int getNodeIdByName(
const std::string& name);
70 int getNodePidByName(
const std::string& name);
75 const std::string& getHostName() {
return m_host; }
76 int getPort() {
return m_port; }
78 bool isConnected(
const std::string& node);
79 const std::string getNodeNameById(
int id);
80 void pushQueue(
const NSMMessage& msg) { m_msg_q.push(msg); }
81 bool hasQueue()
const {
return !m_msg_q.empty(); }
98 std::queue<NSMMessage> m_msg_q;
102 typedef std::vector<NSMCommunicator*> NSMCommunicatorList;
Abstract base class for different kinds of events.