Belle II Software development
rf_roisender.cc
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#include "daq/rfarm/manager/RFRoiSender.h"
9#include "daq/rfarm/manager/RFNSM.h"
10
11#include <csignal>
12
13using namespace std;
14using namespace Belle2;
15
16static RFRoiSender* roi = NULL;
17
18extern "C" void sighandler(int /*sig*/)
19{
20 printf("SIGTERM handler here\n");
21 roi->cleanup();
22}
23
24int main(int argc, char** argv)
25{
26 if (argc < 2) {
27 printf("Wrong number of parameters\n");
28 return 1;
29 }
30 RFConf conf(argv[1]);
31
32 // RFRoiSender* roi = new RFRoiSender(argv[1]);
33 roi = new RFRoiSender(argv[1]);
34
35 signal(SIGINT, sighandler);
36 signal(SIGTERM, sighandler);
37
38 RFNSM nsm(conf.getconf("roisender", "nodename"), roi);
39 nsm.AllocMem(conf.getconf("system", "nsmdata"));
40 roi->SetNodeInfo(nsm.GetNodeInfo());
41
42 roi->server();
43
44 return 0;
45}
Abstract base class for different kinds of events.
STL namespace.