otsdaq  v2_04_01
ARTDAQCommandable.h
1 #ifndef otsdaq_otsdaq_core_GatewaySupervisor_ARTDAQCommandable_h
2 #define otsdaq_otsdaq_core_GatewaySupervisor_ARTDAQCommandable_h
3 
4 #include "artdaq/Application/Commandable.hh"
5 #include "artdaq/ExternalComms/CommanderInterface.hh"
6 #include "boost/thread.hpp"
7 
8 namespace ots
9 {
10 class GatewaySupervisor;
11 
12 class ARTDAQCommandable : public artdaq::Commandable
13 {
14  public:
15  explicit ARTDAQCommandable(GatewaySupervisor* super);
16  virtual ~ARTDAQCommandable();
17 
18  void init(int commanderId, std::string commanderType);
19 
20  private:
21  GatewaySupervisor* theSupervisor_;
22  std::unique_ptr<artdaq::CommanderInterface> theCommander_;
23  boost::thread commanderThread_;
24 
25  public:
26  // Commandable Overrides
27  // these methods provide the operations that are used by the state machine
32  bool do_initialize(fhicl::ParameterSet const&, uint64_t, uint64_t) override;
33 
38  bool do_start(art::RunID, uint64_t, uint64_t) override;
39 
44  bool do_stop(uint64_t, uint64_t) override;
45 
50  bool do_pause(uint64_t, uint64_t) override;
51 
56  bool do_resume(uint64_t, uint64_t) override;
57 
62  bool do_shutdown(uint64_t) override;
63 
66  bool do_meta_command(std::string const&, std::string const&) override;
67 };
68 } // namespace ots
69 
70 #endif // otsdaq_otsdaq_core_GatewaySupervisor_ARTDAQCommandable_h
bool do_shutdown(uint64_t) override
Perform the shutdown transition.
bool do_meta_command(std::string const &, std::string const &) override
Run a module-defined command with the given parameter string.
bool do_stop(uint64_t, uint64_t) override
Perform the stop transition.
bool do_start(art::RunID, uint64_t, uint64_t) override
Perform the start transition.
bool do_resume(uint64_t, uint64_t) override
Perform the resume transition.
bool do_initialize(fhicl::ParameterSet const &, uint64_t, uint64_t) override
Perform the initialize transition.
bool do_pause(uint64_t, uint64_t) override
Perform the pause transition.