artdaq  v3_07_02
TransferWrapper.hh
1 #ifndef artdaq_ArtModules_TransferWrapper_hh
2 #define artdaq_ArtModules_TransferWrapper_hh
3 
4 #include <iostream>
5 #include <memory>
6 #include <string>
7 
8 #include "artdaq/ExternalComms/CommanderInterface.hh"
9 #include "artdaq/TransferPlugins/TransferInterface.hh"
10 
11 namespace fhicl {
12 class ParameterSet;
13 }
14 
15 namespace artdaq {
16 class Fragment;
17 
30 {
31 public:
54  explicit TransferWrapper(const fhicl::ParameterSet& pset);
55 
59  virtual ~TransferWrapper();
60 
65  artdaq::FragmentPtr receiveMessage();
66 
71  artdaq::FragmentPtr receiveInitMessage() { return receiveMessage(); }
72 
73 private:
74  void checkIntegrity(const artdaq::Fragment&) const;
75 
76  void registerMonitor();
77  void unregisterMonitor();
78  std::string getDispatcherStatus();
79 
80  std::size_t timeoutInUsecs_;
81  std::unique_ptr<TransferInterface> transfer_;
82  std::unique_ptr<CommanderInterface> commander_;
83  const fhicl::ParameterSet pset_;
84  const std::string dispatcherHost_;
85  const std::string dispatcherPort_;
86  const std::string serverUrl_;
87  const std::size_t maxEventsBeforeInit_;
88  const std::vector<int> allowedFragmentTypes_;
89  const double runningStateTimeout_;
90  size_t runningStateInterval_us_;
91  const bool quitOnFragmentIntegrityProblem_;
92  const bool multi_run_mode_;
93  bool monitorRegistered_;
94 };
95 } // namespace artdaq
96 
97 #endif /* artdaq_ArtModules_TransferWrapper_hh */
artdaq::FragmentPtr receiveMessage()
Receive a Fragment from the TransferInterface, and send it to art.
TransferWrapper(const fhicl::ParameterSet &pset)
TransferWrapper Constructor.
artdaq::FragmentPtr receiveInitMessage()
Receive the Init message from the TransferInterface, and send it to art.
virtual ~TransferWrapper()
TransferWrapper Destructor.
TransferWrapper wraps a TransferInterface so that it can be used in the ArtdaqInput class to make an ...