CbmRoot
Loading...
Searching...
No Matches
services/histserv/app/main.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4#include "Application.h"
5#include "ProgramOptions.h"
6
7#include <Logger.h>
8
9#include <csignal>
10
11namespace
12{
13 volatile sig_atomic_t signal_status = 0;
14}
15
16static void signal_handler(int sig) { signal_status = sig; }
17
18using namespace cbm::services::histserv;
19
20int main(int argc, char* argv[])
21{
22 std::signal(SIGINT, signal_handler);
23 std::signal(SIGTERM, signal_handler);
24
25 LOG(info) << "***** Histogram server without FairMQ *****";
26 try {
27 ProgramOptions opt(argc, argv);
28 Application app(opt, &signal_status);
29 app.Exec();
30 }
31 catch (std::exception const& e) {
32 LOG(error) << e.what() << "; terminating.";
33 return EXIT_FAILURE;
34 }
35
36 LOG(info) << "Histogram server without FairMQ: Program completed successfully; exiting.";
37 return EXIT_SUCCESS;
38}
Main class of the "cbmreco_fairrun" application.
Program options class for the "cbmreco_fairrun" application.
int main(int argc, char *argv[])
static void signal_handler(int sig)