Belle II Software  release-08-01-10
RFOutputServer.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #ifndef RFOUTPUTSERVER_H
9 #define RFOUTPUTSERVER_H
10 
11 #include <string>
12 
13 #include "daq/rfarm/manager/RFConf.h"
14 #include "daq/rfarm/manager/RFSharedMem.h"
15 #include "daq/rfarm/manager/RFProcessManager.h"
16 #include "daq/rfarm/manager/RFLogManager.h"
17 #include "daq/rfarm/manager/RFFlowStat.h"
18 
19 #include "daq/rfarm/manager/RFServerBase.h"
20 
21 #define MAXNODES 256
22 
23 namespace Belle2 {
29  class RFOutputServer : public RFServerBase {
30  public:
31  RFOutputServer(std::string conffile);
32  ~RFOutputServer();
33 
34  // Functions to be hooked to NSM
35  int Configure(NSMmsg*, NSMcontext*) override;
36  int UnConfigure(NSMmsg*, NSMcontext*) override;
37  int Start(NSMmsg*, NSMcontext*) override;
38  int Stop(NSMmsg*, NSMcontext*) override;
39  int Restart(NSMmsg*, NSMcontext*) override;
40 
41  // Server function
42  void server();
43 
44  // Cleanup
45  void cleanup();
46 
47  private:
48  RFConf* m_conf;
49  RFSharedMem* m_shm;
50  RFProcessManager* m_proc;
51  RFLogManager* m_log;
52  RFFlowStat* m_flow;
53  RingBuffer* m_rbufin;
54  RingBuffer* m_rbufout;
55 
56  int m_pid_receiver[MAXNODES];
57  int m_pid_basf2;
58  int m_pid_sender;
59  int m_pid_hrecv;
60  int m_pid_hrelay;
61  int m_nnodes;
62 
63  };
64 
66 }
67 #endif
68 
69 
70 
71 
Class to manage a Ring Buffer placed in an IPC shared memory.
Definition: RingBuffer.h:39
Abstract base class for different kinds of events.
Definition: nsm2.h:224