artdaq  v3_07_01
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 {
14  artdaq::configureMessageFacility("commandable");
15 
16  fhicl::ParameterSet config = LoadParameterSet<artdaq::CommanderInterface::Config>(argc, argv, "stateResponder", "This simple application sets up a CommanderInterface plugin and reports any received commands.");
17 
18  artdaq::setMsgFacAppName("Commandable", config.get<int>("id"));
19 
20  // create the Commandable object
21  artdaq::Commandable commandable;
22 
23  auto commander = artdaq::MakeCommanderPlugin(config, commandable);
24  commander->run_server();
25 }
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.