Commandable is the base class for all artdaq components which implement the artdaq state machine. More...
#include <artdaq/Application/Commandable.hh>
Public Member Functions | |
Commandable () | |
Commandable (Commandable const &) | |
Copy Constructor is deleted. | |
virtual | ~Commandable () |
Default Destructor. | |
Commandable & | operator= (Commandable const &) |
Copy Assignment operator is deleted. | |
bool | initialize (fhicl::ParameterSet const &pset, uint64_t timeout, uint64_t timestamp) |
Processes the initialize request. | |
bool | start (art::RunID id, uint64_t timeout, uint64_t timestamp) |
Processes the start transition. | |
bool | stop (uint64_t timeout, uint64_t timestamp) |
Processes the stop transition. | |
bool | pause (uint64_t timeout, uint64_t timestamp) |
Processes the pause transition. | |
bool | resume (uint64_t timeout, uint64_t timestamp) |
Processes the resume transition. | |
bool | shutdown (uint64_t timeout) |
Processes the shutdown transition. | |
bool | soft_initialize (fhicl::ParameterSet const &pset, uint64_t timeout, uint64_t timestamp) |
Processes the soft-initialize request. | |
bool | reinitialize (fhicl::ParameterSet const &pset, uint64_t timeout, uint64_t timestamp) |
Processes the reinitialize request. | |
bool | in_run_failure () |
Actions taken when the in_run_failure state is set. | |
virtual std::string | report (std::string const &) const |
Default report implementation returns current report_string. | |
std::string | status () const |
Returns the current state of the Commandable. | |
virtual std::string | register_monitor (fhicl::ParameterSet const &) |
Perform the register_monitor action. | |
virtual std::string | unregister_monitor (std::string const &) |
Perform the unregister_monitor action. | |
std::vector< std::string > | legal_commands () const |
Get the legal transition commands from the current state. | |
virtual bool | do_initialize (fhicl::ParameterSet const &, uint64_t, uint64_t) |
Perform the initialize transition. | |
virtual bool | do_start (art::RunID, uint64_t, uint64_t) |
Perform the start transition. | |
virtual bool | do_stop (uint64_t, uint64_t) |
Perform the stop transition. | |
virtual bool | do_pause (uint64_t, uint64_t) |
Perform the pause transition. | |
virtual bool | do_resume (uint64_t, uint64_t) |
Perform the resume transition. | |
virtual bool | do_shutdown (uint64_t) |
Perform the shutdown transition. | |
virtual bool | do_reinitialize (fhicl::ParameterSet const &, uint64_t, uint64_t) |
Perform the reinitialize transition. | |
virtual bool | do_soft_initialize (fhicl::ParameterSet const &, uint64_t, uint64_t) |
Perform the soft_initialize transition. | |
virtual void | badTransition (const std::string &trans) |
This function is called when an attempt is made to call an illegal transition. | |
virtual void | BootedEnter () |
Perform actions upon entering the Booted state. | |
virtual void | InRunExit () |
Perform actions upon leaving the InRun state. | |
virtual std::string | do_trace_get (std::string const &) |
Get the TRACE mask for the given trace name. | |
virtual bool | do_trace_set (std::string const &, std::string const &, uint64_t) |
Set the given TRACE mask for the given trace name. | |
virtual bool | do_meta_command (std::string const &, std::string const &) |
Run a module-defined command with the given parameter string. | |
Protected Member Functions | |
std::string | current_state () const |
Return the name of the current state. | |
Protected Attributes | |
CommandableContext | fsm_ |
The generated State Machine (using smc_compiler). | |
bool | external_request_status_ |
Whether the last command succeeded. | |
std::string | report_string_ |
Status information about the last command. |
Commandable is the base class for all artdaq components which implement the artdaq state machine.
Definition at line 20 of file Commandable.hh.
artdaq::Commandable::Commandable | ( | ) |
Default constructor.
Definition at line 4 of file Commandable.cc.
void artdaq::Commandable::badTransition | ( | const std::string & | trans | ) | [virtual] |
This function is called when an attempt is made to call an illegal transition.
trans | The transition that was attempted |
Definition at line 282 of file Commandable.cc.
void artdaq::Commandable::BootedEnter | ( | ) | [virtual] |
Perform actions upon entering the Booted state.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 301 of file Commandable.cc.
std::string artdaq::Commandable::current_state | ( | ) | const [protected] |
Return the name of the current state.
Definition at line 399 of file Commandable.cc.
bool artdaq::Commandable::do_initialize | ( | fhicl::ParameterSet const & | , | |
uint64_t | , | |||
uint64_t | ||||
) | [virtual] |
Perform the initialize transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 226 of file Commandable.cc.
bool artdaq::Commandable::do_meta_command | ( | std::string const & | cmd, | |
std::string const & | arg | |||
) | [virtual] |
Run a module-defined command with the given parameter string.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp.
Definition at line 389 of file Commandable.cc.
bool artdaq::Commandable::do_pause | ( | uint64_t | , | |
uint64_t | ||||
) | [virtual] |
Perform the pause transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 247 of file Commandable.cc.
bool artdaq::Commandable::do_reinitialize | ( | fhicl::ParameterSet const & | , | |
uint64_t | , | |||
uint64_t | ||||
) | [virtual] |
Perform the reinitialize transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 268 of file Commandable.cc.
bool artdaq::Commandable::do_resume | ( | uint64_t | , | |
uint64_t | ||||
) | [virtual] |
Perform the resume transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 254 of file Commandable.cc.
bool artdaq::Commandable::do_shutdown | ( | uint64_t | ) | [virtual] |
Perform the shutdown transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 261 of file Commandable.cc.
bool artdaq::Commandable::do_soft_initialize | ( | fhicl::ParameterSet const & | , | |
uint64_t | , | |||
uint64_t | ||||
) | [virtual] |
Perform the soft_initialize transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 275 of file Commandable.cc.
bool artdaq::Commandable::do_start | ( | art::RunID | , | |
uint64_t | , | |||
uint64_t | ||||
) | [virtual] |
Perform the start transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 233 of file Commandable.cc.
bool artdaq::Commandable::do_stop | ( | uint64_t | , | |
uint64_t | ||||
) | [virtual] |
Perform the stop transition.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 240 of file Commandable.cc.
std::string artdaq::Commandable::do_trace_get | ( | std::string const & | name | ) | [virtual] |
Get the TRACE mask for the given trace name.
This function is implemented in Commandable, derived classes may override if necessary.
Definition at line 312 of file Commandable.cc.
bool artdaq::Commandable::do_trace_set | ( | std::string const & | type, | |
std::string const & | name, | |||
uint64_t | mask | |||
) | [virtual] |
Set the given TRACE mask for the given trace name.
This function is implemented in Commandable, derived classes may override if necessary.
Definition at line 341 of file Commandable.cc.
bool artdaq::Commandable::in_run_failure | ( | ) |
Actions taken when the in_run_failure state is set.
Definition at line 163 of file Commandable.cc.
bool artdaq::Commandable::initialize | ( | fhicl::ParameterSet const & | pset, | |
uint64_t | timeout, | |||
uint64_t | timestamp | |||
) |
Processes the initialize request.
pset | ParameterSet used to configure the Commandable | |
timeout | Timeout for init step | |
timestamp | Timestamp of init step |
Definition at line 11 of file Commandable.cc.
void artdaq::Commandable::InRunExit | ( | ) | [virtual] |
Perform actions upon leaving the InRun state.
This function is a No-Op. Derived classes should override it.
Definition at line 306 of file Commandable.cc.
std::vector< std::string > artdaq::Commandable::legal_commands | ( | ) | const |
Get the legal transition commands from the current state.
Definition at line 194 of file Commandable.cc.
Commandable& artdaq::Commandable::operator= | ( | Commandable const & | ) |
Copy Assignment operator is deleted.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
bool artdaq::Commandable::pause | ( | uint64_t | timeout, | |
uint64_t | timestamp | |||
) |
Processes the pause transition.
timeout | Timeout for transition | |
timestamp | Timestamp of transition |
Definition at line 68 of file Commandable.cc.
virtual std::string artdaq::Commandable::register_monitor | ( | fhicl::ParameterSet const & | ) | [inline, virtual] |
Perform the register_monitor action.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::DispatcherApp.
Definition at line 139 of file Commandable.hh.
bool artdaq::Commandable::reinitialize | ( | fhicl::ParameterSet const & | pset, | |
uint64_t | timeout, | |||
uint64_t | timestamp | |||
) |
Processes the reinitialize request.
pset | ParameterSet used to configure the Commandable | |
timeout | Timeout for init step | |
timestamp | Timestamp of init step |
Definition at line 144 of file Commandable.cc.
virtual std::string artdaq::Commandable::report | ( | std::string const & | ) | const [inline, virtual] |
Default report implementation returns current report_string.
Reimplemented in artdaq::BoardReaderApp, artdaq::DataLoggerApp, artdaq::DispatcherApp, artdaq::EventBuilderApp, and artdaq::RoutingMasterApp.
Definition at line 121 of file Commandable.hh.
bool artdaq::Commandable::resume | ( | uint64_t | timeout, | |
uint64_t | timestamp | |||
) |
Processes the resume transition.
timeout | Timeout for transition | |
timestamp | Timestamp of transition |
Definition at line 87 of file Commandable.cc.
bool artdaq::Commandable::shutdown | ( | uint64_t | timeout | ) |
Processes the shutdown transition.
timeout | Timeout for transition |
Definition at line 106 of file Commandable.cc.
bool artdaq::Commandable::soft_initialize | ( | fhicl::ParameterSet const & | pset, | |
uint64_t | timeout, | |||
uint64_t | timestamp | |||
) |
Processes the soft-initialize request.
pset | ParameterSet used to configure the Commandable | |
timeout | Timeout for init step | |
timestamp | Timestamp of init step |
Definition at line 125 of file Commandable.cc.
bool artdaq::Commandable::start | ( | art::RunID | id, | |
uint64_t | timeout, | |||
uint64_t | timestamp | |||
) |
Processes the start transition.
id | Run number of new run | |
timeout | Timeout for transition | |
timestamp | Timestamp of transition |
Definition at line 30 of file Commandable.cc.
std::string artdaq::Commandable::status | ( | ) | const |
Returns the current state of the Commandable.
Definition at line 182 of file Commandable.cc.
bool artdaq::Commandable::stop | ( | uint64_t | timeout, | |
uint64_t | timestamp | |||
) |
Processes the stop transition.
timeout | Timeout for transition | |
timestamp | Timestamp of transition |
Definition at line 49 of file Commandable.cc.
virtual std::string artdaq::Commandable::unregister_monitor | ( | std::string const & | ) | [inline, virtual] |
Perform the unregister_monitor action.
This function is a No-Op. Derived classes should override it.
Reimplemented in artdaq::DispatcherApp.
Definition at line 150 of file Commandable.hh.