artdaq  v3_00_03
CommanderInterface.hh
1 #ifndef artdaq_ExternalComms_CommanderInterface_hh
2 #define artdaq_ExternalComms_CommanderInterface_hh
3 
4 #include "fhiclcpp/ParameterSet.h"
5 #include "artdaq/Application/Commandable.hh"
6 
7 
8 namespace artdaq
9 {
14  {
15  public:
16 
17 
29  CommanderInterface(const fhicl::ParameterSet& ps, artdaq::Commandable& commandable)
30  : _commandable(commandable)
31  , _id(ps.get<int>("id", 0))
32  {}
33 
37  CommanderInterface(const CommanderInterface&) = delete;
38 
44 
48  virtual ~CommanderInterface() = default;
49 
72  virtual void run_server() = 0;
73 
81  virtual std::string send_init(fhicl::ParameterSet, uint64_t, uint64_t);
82 
90  virtual std::string send_soft_init(fhicl::ParameterSet, uint64_t, uint64_t);
91 
99  virtual std::string send_reinit(fhicl::ParameterSet, uint64_t, uint64_t);
100 
108  virtual std::string send_start(art::RunID, uint64_t, uint64_t);
109 
117  virtual std::string send_pause(uint64_t, uint64_t);
118 
126  virtual std::string send_resume(uint64_t, uint64_t);
127 
135  virtual std::string send_stop(uint64_t, uint64_t);
136 
144  virtual std::string send_shutdown(uint64_t);
145 
152  virtual std::string send_status();
153 
160  virtual std::string send_report(std::string);
161 
168  virtual std::string send_legal_commands();
169 
176  virtual std::string send_register_monitor(std::string);
177 
184  virtual std::string send_unregister_monitor(std::string);
185 
193  virtual std::string send_trace_get(std::string);
194 
205  virtual std::string send_trace_set(std::string, std::string, uint64_t);
206 
213  virtual std::string send_meta_command(std::string, std::string);
214 
215  private:
216 
217  public:
222 
223  protected:
224  int _id;
225  };
226 }
227 
228 #define DEFINE_ARTDAQ_COMMANDER(klass) \
229  extern "C" std::unique_ptr<artdaq::CommanderInterface> make(fhicl::ParameterSet const & ps, \
230  artdaq::Commandable& commandable) { \
231  return std::unique_ptr<artdaq::CommanderInterface>(new klass(ps, commandable)); \
232 }
233 
234 
235 #endif /* artdaq_ExternalComms_CommanderInterface.hh */
236 
237 // Local Variables:
238 // mode: c++
239 // 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
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 ~CommanderInterface()=default
Default virtual Destructor.
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