otsdaq  v2_01_00
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  class GatewaySupervisor;
10 
11  class ARTDAQCommandable : public artdaq::Commandable
12  {
13  public:
14  explicit ARTDAQCommandable(GatewaySupervisor* super);
15  virtual ~ARTDAQCommandable();
16 
17  void init(int commanderId, std::string commanderType);
18  private:
19  GatewaySupervisor* theSupervisor_;
20  std::unique_ptr<artdaq::CommanderInterface> theCommander_;
21  boost::thread commanderThread_;
22 
23  public:
24  // Commandable Overrides
25  // these methods provide the operations that are used by the state machine
30  bool do_initialize(fhicl::ParameterSet const&, uint64_t, uint64_t) override;
31 
36  bool do_start(art::RunID, uint64_t, uint64_t) override;
37 
42  bool do_stop(uint64_t, uint64_t) override;
43 
48  bool do_pause(uint64_t, uint64_t) override;
49 
54  bool do_resume(uint64_t, uint64_t) override;
55 
60  bool do_shutdown(uint64_t) override;
61 
64  bool do_meta_command(std::string const&, std::string const&) override;
65  };
66 }
67 
68 #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.