00001 #ifndef otsdaq_otsdaq_core_GatewaySupervisor_ARTDAQCommandable_h
00002 #define otsdaq_otsdaq_core_GatewaySupervisor_ARTDAQCommandable_h
00003
00004 #include "artdaq/Application/Commandable.hh"
00005 #include "artdaq/ExternalComms/CommanderInterface.hh"
00006 #include "boost/thread.hpp"
00007
00008 namespace ots {
00009 class GatewaySupervisor;
00010
00011 class ARTDAQCommandable : public artdaq::Commandable
00012 {
00013 public:
00014 explicit ARTDAQCommandable(GatewaySupervisor* super);
00015 virtual ~ARTDAQCommandable();
00016
00017 void init(int commanderId, std::string commanderType);
00018 private:
00019 GatewaySupervisor* theSupervisor_;
00020 std::unique_ptr<artdaq::CommanderInterface> theCommander_;
00021 boost::thread commanderThread_;
00022
00023 public:
00024
00025
00030 bool do_initialize(fhicl::ParameterSet const&, uint64_t, uint64_t) override;
00031
00036 bool do_start(art::RunID, uint64_t, uint64_t) override;
00037
00042 bool do_stop(uint64_t, uint64_t) override;
00043
00048 bool do_pause(uint64_t, uint64_t) override;
00049
00054 bool do_resume(uint64_t, uint64_t) override;
00055
00060 bool do_shutdown(uint64_t) override;
00061
00064 bool do_meta_command(std::string const&, std::string const&) override;
00065 };
00066 }
00067
00068 #endif //otsdaq_otsdaq_core_GatewaySupervisor_ARTDAQCommandable_h