artdaq  v3_08_00
xmlrpc_commander.hh
1 /* DarkSide 50 DAQ program
2  * This file add the xmlrpc commander as a client to the SC
3  * Author: Alessandro Razeto <Alessandro.Razeto@ge.infn.it>
4  */
5 #ifndef artdaq_ExternalComms_xmlrpc_commander_hh
6 #define artdaq_ExternalComms_xmlrpc_commander_hh
7 
8 #include <mutex>
9 #include "artdaq/ExternalComms/CommanderInterface.hh"
10 
11 namespace artdaq {
12 
17 {
18 public:
30  xmlrpc_commander(fhicl::ParameterSet ps, artdaq::Commandable& commandable);
31 
35  void run_server() override;
36 
42  std::string send_register_monitor(std::string monitor_fhicl) override;
43 
49  std::string send_unregister_monitor(std::string monitor_label) override;
50 
61  std::string send_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override;
62 
73  std::string send_soft_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override;
74 
85  std::string send_reinit(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override;
86 
97  std::string send_start(art::RunID runNumber, uint64_t timeout, uint64_t timestamp) override;
98 
108  std::string send_pause(uint64_t timeout, uint64_t timestamp) override;
109 
119  std::string send_resume(uint64_t timeout, uint64_t timestamp) override;
120 
130  std::string send_stop(uint64_t timeout, uint64_t timestamp) override;
131 
140  std::string send_shutdown(uint64_t timeout) override;
141 
148  std::string send_status() override;
149 
157  std::string send_report(std::string which) override;
158 
165  std::string send_legal_commands() override;
166 
175  std::string send_trace_get(std::string name) override;
176 
190  std::string send_trace_set(std::string name, std::string type, std::string mask) override;
191 
200  std::string send_meta_command(std::string command, std::string argument) override;
201 
211  std::string send_rollover_subrun(uint64_t seq, uint32_t subrunNumber) override;
212 
213 private:
214  xmlrpc_commander(const xmlrpc_commander&) = delete;
215 
217 
218  int port_;
219  std::string serverUrl_;
220 
221  std::string send_command_(std::string command);
222  std::string send_command_(std::string command, std::string arg);
223  std::string send_command_(std::string command, fhicl::ParameterSet pset, uint64_t a, uint64_t b);
224  std::string send_command_(std::string command, uint64_t a, uint64_t b);
225  std::string send_command_(std::string command, art::RunID r, uint64_t a, uint64_t b);
226  std::string send_command_(std::string, uint64_t);
227  std::string send_command_(std::string, std::string, std::string);
228  std::string send_command_(std::string, std::string, std::string, std::string);
229 
230 public:
231  std::timed_mutex mutex_;
232  std::unique_ptr<xmlrpc_c::serverAbyss> server;
233 };
234 
235 } // namespace artdaq
236 
237 #endif /* artdaq_ExternalComms_xmlrpc_commander_hh */
std::string send_rollover_subrun(uint64_t seq, uint32_t subrunNumber) override
Send a send_rollover_subrun command over XMLRPC
This interface defines the functions used to transfer data between artdaq applications.
std::string send_trace_get(std::string name) override
Send an send_trace_get command over XMLRPC
std::string send_unregister_monitor(std::string monitor_label) override
Send an unregister_monitor command over XMLRPC
std::string send_register_monitor(std::string monitor_fhicl) override
Send a register_monitor command over XMLRPC
Commandable is the base class for all artdaq components which implement the artdaq state machine...
Definition: Commandable.hh:20
xmlrpc_commander(fhicl::ParameterSet ps, artdaq::Commandable &commandable)
xmlrpc_commander Constructor
std::string send_stop(uint64_t timeout, uint64_t timestamp) override
Send a stop command over XMLRPC
std::string send_status() override
Send a status command over XMLRPC
std::string send_legal_commands() override
Send a legal_commands command over XMLRPC
The xmlrpc_commander class serves as the XMLRPC server run in each artdaq application.
std::string send_meta_command(std::string command, std::string argument) override
Send an send_meta_command command over XMLRPC
void run_server() override
Run the XMLRPC server.
std::unique_ptr< xmlrpc_c::serverAbyss > server
XMLRPC server.
std::string send_shutdown(uint64_t timeout) override
Send a shutdown command over XMLRPC
std::string send_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override
Send an init command over XMLRPC
std::string send_pause(uint64_t timeout, uint64_t timestamp) override
Send a pause command over XMLRPC
std::string send_trace_set(std::string name, std::string type, std::string mask) override
Send an send_trace_msgfacility_set command over XMLRPC
std::string send_start(art::RunID runNumber, uint64_t timeout, uint64_t timestamp) override
Send a start command over XMLRPC
std::string send_soft_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override
Send a soft_init command over XMLRPC
std::timed_mutex mutex_
XMLRPC mutex.
std::string send_resume(uint64_t timeout, uint64_t timestamp) override
Send a resume command over XMLRPC
std::string send_report(std::string which) override
Send a report command over XMLRPC
std::string send_reinit(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override
Send a reinit command over XMLRPC