DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
daq_application.cxx File Reference
#include "Application.hpp"
#include "CommandLineInterpreter.hpp"
#include "logging/Logging.hpp"
#include <csignal>
#include <fstream>
#include <list>
#include <map>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for daq_application.cxx:

Go to the source code of this file.

Functions

static void signal_handler (int signal)
 Signal handler for graceful stop.
 
int main (int argc, char *argv[])
 

Variables

std::atomic< bool > run_marker { true }
 Global atomic for process lifetime.
 

Detailed Description

Main Application for the DAQ Framework, loads DAQModules based on json configuration file

This is part of the DUNE DAQ Application Framework, copyright 2020. Licensing/copyright details are in the COPYING file that you should have received with this code.

Definition in file daq_application.cxx.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 39 of file daq_application.cxx.

40{
41
42 // Setup signals
43 std::signal(SIGINT, signal_handler);
44 std::signal(SIGQUIT, signal_handler);
45
46 using namespace dunedaq;
47
49 try {
50 args = appfwk::CommandLineInterpreter::parse(argc, argv);
51 } catch (bpo::error const& e) {
52 // Die but do it gracefully gracefully.
53 std::cerr << "Failed to interpret command line: " << e.what(); // NOLINT
54 exit(1);
55 }
56
57 if (args.help_requested) {
58 exit(0);
59 }
60
61 // Enable DUNE-DAQ logging, including TLOG and ERS messages
62 dunedaq::logging::Logging().setup(args.session_name, args.app_name);
63
64 // Create the Application
65 appfwk::Application app(args.app_name,
66 args.session_name,
67 args.command_facility_plugin_name,
68 args.conf_service_plugin_name,
69 args.configuration_id);
70
71 try {
72
73 app.init();
74 app.run(run_marker);
75 } catch (ers::Issue& e) {
76 ers::fatal(appfwk::ApplicationFailure(ERS_HERE, args.session_name, args.app_name, e));
77 }
78
79 TLOG() << "Application " << args.session_name << '.' << args.app_name << " exiting.";
80 return 0;
81}
#define ERS_HERE
The Logger class defines the interface necessary to configure central logging within a DAQ Applicatio...
Definition Logging.hpp:25
static void setup(const std::string &session, const std::string &application)
Setup the Logger service Currently no args.
Definition Logging.hpp:32
Base class for any user define issue.
Definition Issue.hpp:69
static void signal_handler(int signal)
Signal handler for graceful stop.
std::atomic< bool > run_marker
Global atomic for process lifetime.
#define TLOG(...)
Definition macro.hpp:22
Including Qt Headers.
void fatal(const Issue &issue)
Definition ers.hpp:88
CommandLineInterpreter parses the command-line options given to the application and stores the result...

◆ signal_handler()

static void signal_handler ( int signal)
static

Signal handler for graceful stop.

Definition at line 32 of file daq_application.cxx.

33{
34 TLOG() << "Signal received: " << signal;
35 run_marker.store(false);
36}

Variable Documentation

◆ run_marker

std::atomic<bool> run_marker { true }

Global atomic for process lifetime.

Definition at line 26 of file daq_application.cxx.

26{ true };