artdaq
v3_07_02
|
This interface defines the functions used to transfer data between artdaq applications. More...
#include <artdaq/ExternalComms/CommanderInterface.hh>
Classes | |
struct | Config |
Configuration of the CommanderInterface. May be used for parameter validation More... | |
Public Types | |
using | Parameters = fhicl::WrappedTable< Config > |
Used for ParameterSet validation (if desired) | |
Public Member Functions | |
CommanderInterface (const fhicl::ParameterSet &ps, artdaq::Commandable &commandable) | |
CommanderInterface Constructor. More... | |
CommanderInterface (const CommanderInterface &)=delete | |
Copy Constructor is deleted. | |
CommanderInterface & | operator= (const CommanderInterface &)=delete |
Copy Assignment operator is deleted. More... | |
virtual | ~CommanderInterface () |
Default virtual Destructor. | |
virtual void | run_server ()=0 |
run_server is the main work loop for the Commander. More... | |
virtual std::string | send_init (fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) |
Using the transport mechanism, send an init command More... | |
virtual std::string | send_soft_init (fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) |
Using the transport mechanism, send a soft_init command More... | |
virtual std::string | send_reinit (fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) |
Using the transport mechanism, send a reinit command More... | |
virtual std::string | send_start (art::RunID runNumber, uint64_t timeout, uint64_t timestamp) |
Using the transport mechanism, send a start command More... | |
virtual std::string | send_pause (uint64_t timeout, uint64_t timestamp) |
Using the transport mechanism, send a pause command More... | |
virtual std::string | send_resume (uint64_t timeout, uint64_t timestamp) |
Using the transport mechanism, send a resume command More... | |
virtual std::string | send_stop (uint64_t timeout, uint64_t timestamp) |
Using the transport mechanism, send a stop command More... | |
virtual std::string | send_shutdown (uint64_t timeout) |
Using the transport mechanism, send a shutdown command More... | |
virtual std::string | send_status () |
Using the transport mechanism, send a status command More... | |
virtual std::string | send_report (std::string which) |
Using the transport mechanism, send a report command More... | |
virtual std::string | send_legal_commands () |
Using the transport mechanism, send a legal_commands command More... | |
virtual std::string | send_register_monitor (std::string monitor_fhicl) |
Using the transport mechanism, send a register_monitor command More... | |
virtual std::string | send_unregister_monitor (std::string label) |
Using the transport mechanism, send an unregister_monitor command More... | |
virtual std::string | send_trace_get (std::string name) |
Using the transport mechanism, send an send_trace_get command More... | |
virtual std::string | send_trace_set (std::string name, std::string type, std::string mask) |
Using the transport mechanism, send an send_trace_msgfacility_set command More... | |
virtual std::string | send_meta_command (std::string command, std::string argument) |
Using the transport mechanism, send an send_meta_command command More... | |
virtual std::string | send_rollover_subrun (uint64_t seq, uint32_t subrunNumber) |
Using the transport mechanism, send a send_rollover_subrun command More... | |
bool | GetStatus () |
Determine whether the Commander plugin is ready to accept commands More... | |
virtual std::string | add_config_archive_entry (std::string key, std::string value) |
Using the transport mechanism, send an add_config_archive_entry command More... | |
virtual std::string | clear_config_archive () |
Using the transport mechanism, send a clear_config_archive command More... | |
Public Attributes | |
artdaq::Commandable & | _commandable |
Reference to the Commandable that this Commander Commands. More... | |
Protected Attributes | |
int | _id |
ID Number of this Commander. | |
std::atomic< bool > | running_ |
Whether the server is running and able to respond to requests. | |
This interface defines the functions used to transfer data between artdaq applications.
Definition at line 13 of file CommanderInterface.hh.
|
inline |
CommanderInterface Constructor.
ps | ParameterSet used for configuring the CommanderInterface. See artdaq::CommanderInterface::Config |
commandable | artdaq::Commandable object to send transition commands to |
Definition at line 34 of file CommanderInterface.hh.
|
inlinevirtual |
Using the transport mechanism, send an add_config_archive_entry command
This will cause the receiver to add the specified key and value to its list of configuration archive information, which is stored in the art/ROOT files that are written by various processes in the system. This command accepts configuration key and value strings.
EXAMPLE: xmlrpc http://localhost:5235/RPC2 daq.add_config_archive_entry "EventBuilder1" "daq: {verbose: true}"
Definition at line 109 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send a clear_config_archive command
This will cause the receiver to clear its list of configuration archive information.
EXAMPLE: xmlrpc http://localhost:5235/RPC2 daq.clear_config_archive
Definition at line 115 of file CommanderInterface.cc.
|
inline |
Determine whether the Commander plugin is ready to accept commands
Definition at line 240 of file CommanderInterface.hh.
|
delete |
Copy Assignment operator is deleted.
|
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 trace_get trace_set meta_command rollover_subrun add_config_archive_entry clear_config_archive
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.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 7 of file CommanderInterface.cc.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 67 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send an send_meta_command command
This will cause the receiver to run the given command with the given argument in user code
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 97 of file CommanderInterface.cc.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 31 of file CommanderInterface.cc.
|
inlinevirtual |
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 73 of file CommanderInterface.cc.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 19 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send a report command
The report command returns the current value of the requested reportable quantity.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 61 of file CommanderInterface.cc.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 37 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send a send_rollover_subrun command
This will cause the receiver to rollover the subrun number at the given event. (Event with seqID == boundary will be in new subrun.) Should be sent to all EventBuilders before the given event is processed.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 103 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send a shutdown command
The shutdown command shuts down the artdaq process. This command accepts a timeout parameter.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 49 of file CommanderInterface.cc.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 13 of file CommanderInterface.cc.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 25 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send a status command
The status command returns the current status of the artdaq process.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 55 of file CommanderInterface.cc.
|
inlinevirtual |
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 43 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send an send_trace_get command
This will cause the receiver to get the TRACE level masks for the given name Use name == "ALL" to get ALL names
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 85 of file CommanderInterface.cc.
|
inlinevirtual |
Using the transport mechanism, send an send_trace_msgfacility_set command
This will cause the receiver to set the given TRACE level mask for the given name to the given mask. Only the first character of the mask selection will be parsed, dial 'M' for Memory, or 'S' for Slow. Use name == "ALL" to set ALL names
EXAMPLE: xmlrpc http://localhost:5235/RPC2 daq.trace_set s/M s/ALL s/0x12345
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 91 of file CommanderInterface.cc.
|
inlinevirtual |
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 79 of file CommanderInterface.cc.
artdaq::Commandable& artdaq::CommanderInterface::_commandable |
Reference to the Commandable that this Commander Commands.
Definition at line 270 of file CommanderInterface.hh.