artdaq  v3_01_00
TransferWrapper.hh
1 #ifndef artdaq_ArtModules_TransferWrapper_hh
2 #define artdaq_ArtModules_TransferWrapper_hh
3 
4 
5 #include <string>
6 #include <memory>
7 #include <iostream>
8 
9 #include "artdaq/TransferPlugins/TransferInterface.hh"
10 #include "artdaq/ExternalComms/CommanderInterface.hh"
11 
12 #include <TBufferFile.h>
13 
14 namespace fhicl
15 {
16  class ParameterSet;
17 }
18 
19 namespace artdaq
20 {
21  class Fragment;
22 
35  {
36  public:
37 
57  explicit TransferWrapper(const fhicl::ParameterSet& pset);
58 
62  virtual ~TransferWrapper();
63 
68  void receiveMessage(std::unique_ptr<TBufferFile>& msg);
69 
74  void receiveInitMessage(std::unique_ptr<TBufferFile>& msg) { receiveMessage(msg); }
75 
76  private:
77 
78  void extractTBufferFile(const artdaq::Fragment&, std::unique_ptr<TBufferFile>&);
79 
80  void checkIntegrity(const artdaq::Fragment&) const;
81 
82  void unregisterMonitor();
83 
84  std::size_t timeoutInUsecs_;
85  std::unique_ptr<TransferInterface> transfer_;
86  std::unique_ptr<CommanderInterface> commander_;
87  const std::string dispatcherHost_;
88  const std::string dispatcherPort_;
89  const std::string serverUrl_;
90  const std::size_t maxEventsBeforeInit_;
91  const std::vector<int> allowedFragmentTypes_;
92  const bool quitOnFragmentIntegrityProblem_;
93  bool monitorRegistered_;
94  };
95 }
96 
97 #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 ...