00001 #ifndef artdaq_ArtModules_TransferWrapper_hh
00002 #define artdaq_ArtModules_TransferWrapper_hh
00003
00004
00005 #include <string>
00006 #include <memory>
00007 #include <iostream>
00008
00009 #include "artdaq/TransferPlugins/TransferInterface.hh"
00010
00011 #include "TBufferFile.h"
00012
00013 namespace fhicl
00014 {
00015 class ParameterSet;
00016 }
00017
00018 namespace artdaq
00019 {
00020 class Fragment;
00021
00033 class TransferWrapper
00034 {
00035 public:
00036
00056 explicit TransferWrapper(const fhicl::ParameterSet& pset);
00057
00061 virtual ~TransferWrapper();
00062
00067 void receiveMessage(std::unique_ptr<TBufferFile>& msg);
00068
00069 private:
00070
00071 void extractTBufferFile(const artdaq::Fragment&, std::unique_ptr<TBufferFile>&);
00072
00073 void checkIntegrity(const artdaq::Fragment&) const;
00074
00075 void unregisterMonitor();
00076
00077 std::size_t timeoutInUsecs_;
00078 std::unique_ptr<TransferInterface> transfer_;
00079 const std::string dispatcherHost_;
00080 const std::string dispatcherPort_;
00081 const std::string serverUrl_;
00082 const std::size_t maxEventsBeforeInit_;
00083 const std::vector<int> allowedFragmentTypes_;
00084 const bool quitOnFragmentIntegrityProblem_;
00085 const size_t debugLevel_;
00086 bool monitorRegistered_;
00087 };
00088 }
00089
00090 #endif