artdaq  v3_09_00
StateResponder.cc
1 #include "artdaq-core/Utilities/configureMessageFacility.hh"
2 #include "artdaq/Application/Commandable.hh"
3 #include "artdaq/Application/LoadParameterSet.hh"
4 #include "artdaq/DAQdata/Globals.hh"
5 #include "artdaq/ExternalComms/MakeCommanderPlugin.hh"
6 
7 #include <boost/lexical_cast.hpp>
8 #include <boost/program_options.hpp>
9 
10 #include <iostream>
11 
12 int main(int argc, char* argv[])
13 try
14 {
15  artdaq::configureMessageFacility("commandable");
16 
17  fhicl::ParameterSet config = LoadParameterSet<artdaq::CommanderInterface::Config>(argc, argv, "stateResponder", "This simple application sets up a CommanderInterface plugin and reports any received commands.");
18 
19  artdaq::setMsgFacAppName("Commandable", config.get<int>("id"));
20 
21  // create the Commandable object
22  artdaq::Commandable commandable;
23 
24  auto commander = artdaq::MakeCommanderPlugin(config, commandable);
25  commander->run_server();
26 
27  return 0;
28 }
29 catch (...)
30 {
31  return -1;
32 }
Commandable is the base class for all artdaq components which implement the artdaq state machine...
Definition: Commandable.hh:20
std::unique_ptr< artdaq::CommanderInterface > MakeCommanderPlugin(const fhicl::ParameterSet &commander_pset, artdaq::Commandable &commandable)
Load a CommanderInterface plugin.