This interface defines the functions used to transfer data between artdaq applications. More...
#include <artdaq/ExternalComms/CommanderInterface.hh>
Public Member Functions | |
CommanderInterface (const fhicl::ParameterSet &ps, artdaq::Commandable &commandable) | |
CommanderInterface Constructor. | |
CommanderInterface (const CommanderInterface &) | |
Copy Constructor is deleted. | |
CommanderInterface & | operator= (const CommanderInterface &) |
Copy Assignment operator is deleted. | |
virtual | ~CommanderInterface () |
Default virtual Destructor. | |
virtual void | run_server ()=0 |
run_server is the main work loop for the Commander. | |
virtual std::string | send_init (fhicl::ParameterSet, uint64_t, uint64_t) |
Using the transport mechanism, send an init command. | |
virtual std::string | send_soft_init (fhicl::ParameterSet, uint64_t, uint64_t) |
Using the transport mechanism, send a soft_init command. | |
virtual std::string | send_reinit (fhicl::ParameterSet, uint64_t, uint64_t) |
Using the transport mechanism, send a reinit command. | |
virtual std::string | send_start (art::RunID, uint64_t, uint64_t) |
Using the transport mechanism, send a start command. | |
virtual std::string | send_pause (uint64_t, uint64_t) |
Using the transport mechanism, send a pause command. | |
virtual std::string | send_resume (uint64_t, uint64_t) |
Using the transport mechanism, send a resume command. | |
virtual std::string | send_stop (uint64_t, uint64_t) |
Using the transport mechanism, send a stop command. | |
virtual std::string | send_shutdown (uint64_t) |
Using the transport mechanism, send a shutdown command. | |
virtual std::string | send_status () |
Using the transport mechanism, send a status command. | |
virtual std::string | send_report (std::string) |
Using the transport mechanism, send a report command. | |
virtual std::string | send_legal_commands () |
Using the transport mechanism, send a legal_commands command. | |
virtual std::string | send_register_monitor (std::string) |
Using the transport mechanism, send a register_monitor command. | |
virtual std::string | send_unregister_monitor (std::string) |
Using the transport mechanism, send an unregister_monitor command. | |
Public Attributes | |
artdaq::Commandable & | _commandable |
Reference to the Commandable that this Commander Commands. | |
Protected Attributes | |
int | _id |
ID Number of this Commander. |
This interface defines the functions used to transfer data between artdaq applications.
Definition at line 13 of file CommanderInterface.hh.
artdaq::CommanderInterface::CommanderInterface | ( | const fhicl::ParameterSet & | ps, | |
artdaq::Commandable & | commandable | |||
) | [inline] |
CommanderInterface Constructor.
ps | ParameterSet used for configuring the CommanderInterface | |
commandable | artdaq::Commandable object to send transition commands to |
* CommanderInterface accepts the following Parameters: "commanderPluginType": The type of Commander plugin to load "id": Integer ID number of this Commandable. May be constrained by plugin types (i.e. XMLRPC port number). *
Definition at line 29 of file CommanderInterface.hh.
CommanderInterface& artdaq::CommanderInterface::operator= | ( | const CommanderInterface & | ) |
Copy Assignment operator is deleted.
virtual void artdaq::CommanderInterface::run_server | ( | ) | [pure virtual] |
run_server is the main work loop for the Commander.
This function is expected to block and persist for the entire run of the application. It should accept and handle the following commands (subject to state-machine constraints, see Commandable::legal_commands()): init soft_init reinit start pause resume stop shutdown status report legal_commands register_monitor unregister_monitor
See the send_* functions for more details on each command. Not all commands are valid for all applications/states. run_server should return a string indicating success or failure to the transport mechanism when it is done processing a command.
Implemented in artdaq::xmlrpc_commander.
std::string artdaq::CommanderInterface::send_init | ( | fhicl::ParameterSet | , | |
uint64_t | , | |||
uint64_t | ||||
) | [inline, virtual] |
Using the transport mechanism, send an init command.
The init command is accepted by all artdaq processes that are in the booted state. It expects a ParameterSet for configuration, a timeout, and a timestamp.
Definition at line 4 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_legal_commands | ( | ) | [inline, virtual] |
Using the transport mechanism, send a legal_commands command.
This will query the artdaq process, and it will return the list of allowed transition commands from its current state.
Definition at line 64 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_pause | ( | uint64_t | , | |
uint64_t | ||||
) | [inline, virtual] |
Using the transport mechanism, send a pause command.
The pause command pauses a Run. When the run resumes, the subrun number will be incremented. This command accepts a timeout parameter and a timestamp parameter.
Definition at line 28 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_register_monitor | ( | std::string | ) | [inline, virtual] |
Using the transport mechanism, send a register_monitor command.
This will cause a Dispatcher to start an art process with the given FHiCL configuration string
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 70 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_reinit | ( | fhicl::ParameterSet | , | |
uint64_t | , | |||
uint64_t | ||||
) | [inline, virtual] |
Using the transport mechanism, send a reinit command.
The reinit command is accepted by all artdaq processes. It expects a ParameterSet for configuration, a timeout, and a timestamp.
Definition at line 16 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_report | ( | std::string | ) | [inline, virtual] |
Using the transport mechanism, send a report command.
The report command returns the current value of the requested reportable quantity.
Definition at line 58 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_resume | ( | uint64_t | , | |
uint64_t | ||||
) | [inline, virtual] |
Using the transport mechanism, send a resume command.
The resume command resumes a paused Run. When the run resumes, the subrun number will be incremented. This command accepts a timeout parameter and a timestamp parameter.
Definition at line 34 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_shutdown | ( | uint64_t | ) | [inline, virtual] |
Using the transport mechanism, send a shutdown command.
The shutdown command shuts down the artdaq process. This command accepts a timeout parameter.
Definition at line 46 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_soft_init | ( | fhicl::ParameterSet | , | |
uint64_t | , | |||
uint64_t | ||||
) | [inline, virtual] |
Using the transport mechanism, send a soft_init command.
The soft_init command is accepted by all artdaq processes that are in the booted state. It expects a ParameterSet for configuration, a timeout, and a timestamp.
Definition at line 10 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_start | ( | art::RunID | , | |
uint64_t | , | |||
uint64_t | ||||
) | [inline, virtual] |
Using the transport mechanism, send a start command.
The start command starts a Run using the given run number. This command also accepts a timeout parameter and a timestamp parameter.
Definition at line 22 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_status | ( | ) | [inline, virtual] |
Using the transport mechanism, send a status command.
The status command returns the current status of the artdaq process.
Definition at line 52 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_stop | ( | uint64_t | , | |
uint64_t | ||||
) | [inline, virtual] |
Using the transport mechanism, send a stop command.
The stop command stops the current Run. This command accepts a timeout parameter and a timestamp parameter.
Definition at line 40 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_unregister_monitor | ( | std::string | ) | [inline, virtual] |
Using the transport mechanism, send an unregister_monitor command.
This will cause a Dispatcher to stop sending data to the monitor identified by the given label
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 76 of file CommanderInterface.cc.
Reference to the Commandable that this Commander Commands.
Definition at line 193 of file CommanderInterface.hh.