artdaq  v3_07_01
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 #include <TBufferFile.h>
12 
13 namespace fhicl {
14 class ParameterSet;
15 }
16 
17 namespace artdaq {
18 class Fragment;
19 
32 {
33 public:
53  explicit TransferWrapper(const fhicl::ParameterSet& pset);
54 
58  virtual ~TransferWrapper();
59 
64  void receiveMessage(std::unique_ptr<TBufferFile>& msg);
65 
70  void receiveInitMessage(std::unique_ptr<TBufferFile>& msg) { receiveMessage(msg); }
71 
72 private:
73  void extractTBufferFile(const artdaq::Fragment&, std::unique_ptr<TBufferFile>&);
74 
75  void checkIntegrity(const artdaq::Fragment&) const;
76 
77  void unregisterMonitor();
78 
79  std::size_t timeoutInUsecs_;
80  std::unique_ptr<TransferInterface> transfer_;
81  std::unique_ptr<CommanderInterface> commander_;
82  const std::string dispatcherHost_;
83  const std::string dispatcherPort_;
84  const std::string serverUrl_;
85  const std::size_t maxEventsBeforeInit_;
86  const std::vector<int> allowedFragmentTypes_;
87  const bool quitOnFragmentIntegrityProblem_;
88  bool monitorRegistered_;
89 };
90 } // namespace artdaq
91 
92 #endif /* artdaq_ArtModules_TransferWrapper_hh */
void receiveMessage(std::unique_ptr< TBufferFile > &msg)
Receive a Fragment from the TransferInterface, and send it to art.
TransferWrapper(const fhicl::ParameterSet &pset)
TransferWrapper Constructor.
virtual ~TransferWrapper()
TransferWrapper Destructor.
void receiveInitMessage(std::unique_ptr< TBufferFile > &msg)
Receive the Init message from the TransferInterface, and send it to art.
TransferWrapper wraps a TransferInterface so that it can be used in the ArtdaqInput class to make an ...