artdaq  v3_01_00
CommanderInterface.hh
1 #ifndef artdaq_ExternalComms_CommanderInterface_hh
2 #define artdaq_ExternalComms_CommanderInterface_hh
3 
4 #include "artdaq/DAQdata/Globals.hh"
5 #include "fhiclcpp/ParameterSet.h"
6 #include "artdaq/Application/Commandable.hh"
7 #include "cetlib/compiler_macros.h"
8 
9 
10 namespace artdaq
11 {
16  {
17  public:
18 
19 
31  CommanderInterface(const fhicl::ParameterSet& ps, artdaq::Commandable& commandable)
32  : _commandable(commandable)
33  , _id(ps.get<int>("id", 0))
34  {}
35 
39  CommanderInterface(const CommanderInterface&) = delete;
40 
46 
50  virtual ~CommanderInterface();
51 
74  virtual void run_server() = 0;
75 
83  virtual std::string send_init(fhicl::ParameterSet, uint64_t, uint64_t);
84 
92  virtual std::string send_soft_init(fhicl::ParameterSet, uint64_t, uint64_t);
93 
101  virtual std::string send_reinit(fhicl::ParameterSet, uint64_t, uint64_t);
102 
110  virtual std::string send_start(art::RunID, uint64_t, uint64_t);
111 
119  virtual std::string send_pause(uint64_t, uint64_t);
120 
128  virtual std::string send_resume(uint64_t, uint64_t);
129 
137  virtual std::string send_stop(uint64_t, uint64_t);
138 
146  virtual std::string send_shutdown(uint64_t);
147 
154  virtual std::string send_status();
155 
162  virtual std::string send_report(std::string);
163 
170  virtual std::string send_legal_commands();
171 
178  virtual std::string send_register_monitor(std::string);
179 
186  virtual std::string send_unregister_monitor(std::string);
187 
195  virtual std::string send_trace_get(std::string);
196 
207  virtual std::string send_trace_set(std::string, std::string, uint64_t);
208 
215  virtual std::string send_meta_command(std::string, std::string);
216 
217  private:
218 
219  public:
224 
225  protected:
226  int _id;
227  };
228 }
229 
230 #ifndef EXTERN_C_FUNC_DECLARE_START
231 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
232 #endif
233 
234 #define DEFINE_ARTDAQ_COMMANDER(klass) \
235  EXTERN_C_FUNC_DECLARE_START \
236  std::unique_ptr<artdaq::CommanderInterface> make(fhicl::ParameterSet const & ps, \
237  artdaq::Commandable& commandable) { \
238  return std::unique_ptr<artdaq::CommanderInterface>(new klass(ps, commandable)); \
239 }}
240 
241 
242 #endif /* artdaq_ExternalComms_CommanderInterface.hh */
243 
244 // Local Variables:
245 // mode: c++
246 // End:
This interface defines the functions used to transfer data between artdaq applications.
Commandable is the base class for all artdaq components which implement the artdaq state machine...
Definition: Commandable.hh:20
virtual std::string send_report(std::string)
Using the transport mechanism, send a report command
virtual std::string send_soft_init(fhicl::ParameterSet, uint64_t, uint64_t)
Using the transport mechanism, send a soft_init command
virtual std::string send_unregister_monitor(std::string)
Using the transport mechanism, send an unregister_monitor command
virtual std::string send_meta_command(std::string, std::string)
Using the transport mechanism, send an send_meta_command command
int _id
ID Number of this Commander.
virtual std::string send_resume(uint64_t, uint64_t)
Using the transport mechanism, send a resume command
virtual std::string send_legal_commands()
Using the transport mechanism, send a legal_commands command
virtual std::string send_trace_set(std::string, std::string, uint64_t)
Using the transport mechanism, send an send_trace_msgfacility_set command
virtual std::string send_start(art::RunID, uint64_t, uint64_t)
Using the transport mechanism, send a start command
virtual ~CommanderInterface()
Default virtual Destructor.
artdaq::Commandable & _commandable
Reference to the Commandable that this Commander Commands.
virtual std::string send_stop(uint64_t, uint64_t)
Using the transport mechanism, send a stop command
virtual std::string send_init(fhicl::ParameterSet, uint64_t, uint64_t)
Using the transport mechanism, send an init command
CommanderInterface(const fhicl::ParameterSet &ps, artdaq::Commandable &commandable)
CommanderInterface Constructor.
virtual std::string send_reinit(fhicl::ParameterSet, uint64_t, uint64_t)
Using the transport mechanism, send a reinit command
CommanderInterface & operator=(const CommanderInterface &)=delete
Copy Assignment operator is deleted.
virtual std::string send_shutdown(uint64_t)
Using the transport mechanism, send a shutdown command
virtual std::string send_register_monitor(std::string)
Using the transport mechanism, send a register_monitor command
virtual void run_server()=0
run_server is the main work loop for the Commander.
virtual std::string send_status()
Using the transport mechanism, send a status command
virtual std::string send_trace_get(std::string)
Using the transport mechanism, send an send_trace_get command
virtual std::string send_pause(uint64_t, uint64_t)
Using the transport mechanism, send a pause command