artdaq  v3_08_00
ShmemWrapper.hh
1 #ifndef artdaq_ArtModules_ShmemWrapper_hh
2 #define artdaq_ArtModules_ShmemWrapper_hh
3 
4 #include "artdaq-core/Utilities/ExceptionHandler.hh"
5 #include "fhiclcpp/ParameterSet.h"
6 
7 #include "artdaq-core/Data/Fragment.hh"
8 #include "artdaq-core/Data/RawEvent.hh"
9 
10 #include <memory>
11 #include <string>
12 
13 namespace art {
24 {
25 public:
30  ShmemWrapper(fhicl::ParameterSet const& ps);
31 
35  virtual ~ShmemWrapper() = default;
36 
41  artdaq::FragmentPtrs receiveMessage();
46  std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments>> receiveMessages();
47 
52  artdaq::FragmentPtrs receiveInitMessage();
53 
58  std::shared_ptr<artdaq::detail::RawEventHeader> getEventHeader() { return hdr_ptr_; }
59 
60 private:
61  fhicl::ParameterSet data_pset_;
62  bool init_received_;
63  double init_timeout_s_;
64  std::shared_ptr<artdaq::detail::RawEventHeader> hdr_ptr_;
65 };
66 } // namespace art
67 
68 #endif /* artdaq_ArtModules_ShmemWrapper_hh */
std::unordered_map< artdaq::Fragment::type_t, std::unique_ptr< artdaq::Fragments > > receiveMessages()
Receive all messsages for an event from ArtdaqSharedMemoryService.
Definition: ShmemWrapper.cc:80
artdaq::FragmentPtrs receiveMessage()
Receive a message from the ArtdaqSharedMemoryService.
Definition: ShmemWrapper.cc:16
ShmemWrapper(fhicl::ParameterSet const &ps)
ShmemWrapper Constructor.
Definition: ShmemWrapper.cc:9
virtual ~ShmemWrapper()=default
ShmemWrapper Destructor.
This class wraps ArtdaqSharedMemoryService so that it can act as an ArtdaqInput template class...
Definition: ShmemWrapper.hh:23
artdaq::FragmentPtrs receiveInitMessage()
Receive an init message from the ArtdaqSharedMemoryService.
std::shared_ptr< artdaq::detail::RawEventHeader > getEventHeader()
Get a pointer to the last received RawEventHeader.
Definition: ShmemWrapper.hh:58