$treeview $search $mathjax $extrastylesheet
artdaq
v3_04_01
$projectbrief
|
$projectbrief
|
$searchbox |
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 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. | |
virtual std::string | send_trace_get (std::string) |
Using the transport mechanism, send an send_trace_get command. | |
virtual std::string | send_trace_set (std::string, std::string, uint64_t) |
Using the transport mechanism, send an send_trace_msgfacility_set command. | |
virtual std::string | send_meta_command (std::string, std::string) |
Using the transport mechanism, send an send_meta_command command. | |
virtual std::string | send_rollover_subrun (uint64_t, uint32_t) |
Using the transport mechanism, send a send_rollover_subrun command. | |
bool | GetStatus () |
Determine whether the Commander plugin is ready to accept commands. | |
virtual std::string | add_config_archive_entry (std::string, std::string) |
Using the transport mechanism, send an add_config_archive_entry command. | |
virtual std::string | clear_config_archive () |
Using the transport mechanism, send a clear_config_archive command. | |
Public Attributes | |
artdaq::Commandable & | _commandable |
Reference to the Commandable that this Commander Commands. | |
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 15 of file CommanderInterface.hh.
artdaq::CommanderInterface::CommanderInterface | ( | const fhicl::ParameterSet & | ps, | |
artdaq::Commandable & | commandable | |||
) | [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 36 of file CommanderInterface.hh.
std::string artdaq::CommanderInterface::add_config_archive_entry | ( | std::string | , | |
std::string | ||||
) | [inline, virtual] |
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.
std::string artdaq::CommanderInterface::clear_config_archive | ( | ) | [inline, virtual] |
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.
bool artdaq::CommanderInterface::GetStatus | ( | ) | [inline] |
Determine whether the Commander plugin is ready to accept commands.
Definition at line 241 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 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.
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 7 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 67 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_meta_command | ( | std::string | , | |
std::string | ||||
) | [inline, virtual] |
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.
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 31 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 73 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 19 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 61 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 37 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_rollover_subrun | ( | uint64_t | , | |
uint32_t | ||||
) | [inline, virtual] |
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.
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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 49 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 13 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 25 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 55 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.
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 43 of file CommanderInterface.cc.
std::string artdaq::CommanderInterface::send_trace_get | ( | std::string | ) | [inline, virtual] |
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.
std::string artdaq::CommanderInterface::send_trace_set | ( | std::string | , | |
std::string | , | |||
uint64_t | ||||
) | [inline, virtual] |
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_msgfacility_set TraceLock i/$((0x1234)) # Use Bash to convert hex to dec
Reimplemented in artdaq::xmlrpc_commander.
Definition at line 91 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 79 of file CommanderInterface.cc.
Reference to the Commandable that this Commander Commands.
Definition at line 272 of file CommanderInterface.hh.