00001 #ifndef artdaq_ExternalComms_CommanderInterface_hh
00002 #define artdaq_ExternalComms_CommanderInterface_hh
00003
00004 #include "artdaq/DAQdata/Globals.hh"
00005 #include "fhiclcpp/ParameterSet.h"
00006 #include "artdaq/Application/Commandable.hh"
00007 #include "cetlib/compiler_macros.h"
00008
00009
00010 namespace artdaq
00011 {
00015 class CommanderInterface
00016 {
00017 public:
00018
00019
00031 CommanderInterface(const fhicl::ParameterSet& ps, artdaq::Commandable& commandable)
00032 : _commandable(commandable)
00033 , _id(ps.get<int>("id", 0))
00034 {}
00035
00039 CommanderInterface(const CommanderInterface&) = delete;
00040
00045 CommanderInterface& operator=(const CommanderInterface&) = delete;
00046
00050 virtual ~CommanderInterface();
00051
00074 virtual void run_server() = 0;
00075
00083 virtual std::string send_init(fhicl::ParameterSet, uint64_t, uint64_t);
00084
00092 virtual std::string send_soft_init(fhicl::ParameterSet, uint64_t, uint64_t);
00093
00101 virtual std::string send_reinit(fhicl::ParameterSet, uint64_t, uint64_t);
00102
00110 virtual std::string send_start(art::RunID, uint64_t, uint64_t);
00111
00119 virtual std::string send_pause(uint64_t, uint64_t);
00120
00128 virtual std::string send_resume(uint64_t, uint64_t);
00129
00137 virtual std::string send_stop(uint64_t, uint64_t);
00138
00146 virtual std::string send_shutdown(uint64_t);
00147
00154 virtual std::string send_status();
00155
00162 virtual std::string send_report(std::string);
00163
00170 virtual std::string send_legal_commands();
00171
00178 virtual std::string send_register_monitor(std::string);
00179
00186 virtual std::string send_unregister_monitor(std::string);
00187
00195 virtual std::string send_trace_get(std::string);
00196
00207 virtual std::string send_trace_set(std::string, std::string, uint64_t);
00208
00215 virtual std::string send_meta_command(std::string, std::string);
00216
00217 private:
00218
00219 public:
00223 artdaq::Commandable& _commandable;
00224
00225 protected:
00226 int _id;
00227 };
00228 }
00229
00230 #ifndef EXTERN_C_FUNC_DECLARE_START
00231 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
00232 #endif
00233
00234 #define DEFINE_ARTDAQ_COMMANDER(klass) \
00235 EXTERN_C_FUNC_DECLARE_START \
00236 std::unique_ptr<artdaq::CommanderInterface> make(fhicl::ParameterSet const & ps, \
00237 artdaq::Commandable& commandable) { \
00238 return std::unique_ptr<artdaq::CommanderInterface>(new klass(ps, commandable)); \
00239 }}
00240
00241
00242 #endif
00243
00244
00245
00246