artdaq  v3_12_02
DispatcherCore.hh
1 #ifndef artdaq_Application_MPI2_DispatcherCore_hh
2 #define artdaq_Application_MPI2_DispatcherCore_hh
3 
4 #include "artdaq/Application/DataReceiverCore.hh"
5 
6 #include "fhiclcpp/ParameterSet.h"
7 
8 #include <mutex>
9 #include <string>
10 #include <unordered_map>
11 
12 namespace artdaq {
13 class DispatcherCore;
14 }
15 
21 {
22 public:
26  DispatcherCore() = default;
27 
31  DispatcherCore(DispatcherCore const&) = delete;
32 
37  {
38  TLOG(TLVL_DEBUG + 32) << "Destructor";
39  }
40 
45  DispatcherCore& operator=(DispatcherCore const&) = delete;
46  DispatcherCore(DispatcherCore&&) = delete;
48 
76  bool initialize(fhicl::ParameterSet const& pset) override;
77 
85  std::string register_monitor(fhicl::ParameterSet const& pset);
86 
92  std::string unregister_monitor(std::string const& label);
93 
94 private:
95  fhicl::ParameterSet generate_filter_fhicl_();
96  fhicl::ParameterSet merge_parameter_sets_(fhicl::ParameterSet const& skel, const std::string& label, const fhicl::ParameterSet& pset);
97  void check_filters_();
98 
99  void start_art_process_(std::string const& label);
100  void stop_art_process_(std::string const& label);
101 
102  std::mutex dispatcher_transfers_mutex_;
103  std::unordered_map<std::string, fhicl::ParameterSet> registered_monitors_;
104  std::unordered_map<std::string, pid_t> registered_monitor_pids_;
105  fhicl::ParameterSet pset_; // The ParameterSet initially passed to the Dispatcher (contains input info)
106  bool broadcast_mode_;
107 };
108 
109 #endif
110 
111 // LocalWords: ds
DispatcherCore & operator=(DispatcherCore const &)=delete
Copy Assignment operator is deleted.
DataReceiverCore implements the state machine for the DataReceiver artdaq application. DataReceiverCore receives Fragment objects from the DataReceiverManager, and sends them to the EventStore.
std::string unregister_monitor(std::string const &label)
Delete the TransferInterface having the given unique label.
DispatcherCore implements the state machine for the Dispatcher artdaq application. DispatcherCore processes incoming events in one of three roles: Data Logger, Online Monitor, or Dispatcher.
std::string register_monitor(fhicl::ParameterSet const &pset)
Create a new TransferInterface instance using the given configuration.
DispatcherCore()=default
DispatcherCore Constructor.
bool initialize(fhicl::ParameterSet const &pset) override
Processes the initialize request.