1 #ifndef artdaq_ArtModules_ArtdaqSharedMemoryService_h
2 #define artdaq_ArtModules_ArtdaqSharedMemoryService_h
4 #include "art/Framework/Services/Registry/ServiceMacros.h"
5 #include "artdaq-core/Core/SharedMemoryEventReceiver.hh"
6 #include "artdaq-core/Data/RawEvent.hh"
7 #include "fhiclcpp/types/Atom.h"
25 virtual std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments>>
ReceiveEvent(
bool broadcast) = 0;
58 fhicl::Atom<uint32_t> shared_memory_key{fhicl::Name{
"shared_memory_key"}, fhicl::Comment{
"Key to use when connecting to shared memory. Will default to 0xBEE70000 + getppid()."}, 0xBEE70000};
60 fhicl::Atom<uint32_t> broadcast_shared_memory_key{fhicl::Name{
"broadcast_shared_memory_key"}, fhicl::Comment{
"Key to use when connecting to broadcast shared memory. Will default to 0xCEE70000 + getppid()."}, 0xCEE70000};
62 fhicl::Atom<int> rank{fhicl::Name{
"rank"}, fhicl::Comment{
"Rank of this artdaq application. Used for data transfers"}};
83 std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments>> ReceiveEvent(
bool broadcast)
override;
89 size_t GetQueueSize()
override {
return incoming_events_->ReadReadyCount(); }
99 std::shared_ptr<artdaq::detail::RawEventHeader>
GetEventHeader() {
return evtHeader_; }
102 std::unique_ptr<artdaq::SharedMemoryEventReceiver> incoming_events_;
103 std::shared_ptr<artdaq::detail::RawEventHeader> evtHeader_;
104 size_t read_timeout_;
fhicl::WrappedTable< Config > Parameters
Used for ParameterSet validation (if desired)
Interface for ArtdaqSharedMemoryService. This interface is declared to art as part of the required re...
size_t GetQueueSize() override
Get the number of events which are ready to be read.
virtual std::unordered_map< artdaq::Fragment::type_t, std::unique_ptr< artdaq::Fragments > > ReceiveEvent(bool broadcast)=0
Receive an event from the shared memory.
size_t GetQueueCapacity() override
Get the maximum number of events which can be stored in the shared memory.
Allowed Configuration parameters of NetMonTransportService. May be used for configuration validation ...
ArtdaqSharedMemoryService extends ArtdaqSharedMemoryServiceInterface. It receives events from shared ...
virtual size_t GetQueueCapacity()=0
Get the maximum number of events which can be stored in the shared memory.
virtual ~ArtdaqSharedMemoryServiceInterface()=default
Default virtual destructor.
virtual size_t GetQueueSize()=0
Get the number of events which are ready to be read.
std::shared_ptr< artdaq::detail::RawEventHeader > GetEventHeader()
Get a shared_ptr to the current event header, if any.