1 #ifndef artdaq_core_Core_SharedMemoryEventReceiver_hh
2 #define artdaq_core_Core_SharedMemoryEventReceiver_hh 1
6 #include "artdaq-core/Core/SharedMemoryManager.hh"
7 #include "artdaq-core/Data/Fragment.hh"
8 #include "artdaq-core/Data/RawEvent.hh"
35 bool ReadyForRead(
bool broadcast =
false,
size_t timeout_us = 1000000);
91 int current_read_buffer_;
void ReleaseBuffer()
Release the buffer currently being read to the Empty state.
detail::RawFragmentHeader::type_t type_t
typedef for type_t from RawFragmentHeader
SharedMemoryEventReceiver can receive events (as written by SharedMemoryEventManager) from Shared Mem...
The SharedMemoryManager creates a Shared Memory area which is divided into a number of fixed-size buf...
int GetRank()
Returns the Rank of the writing process.
size_t ReadReadyCount()
Count the number of buffers that are ready for reading.
size_t size()
Get the size of the data buffer.
int GetRank() const
Get the rank of the owner of the Shared Memory (artdaq assigns rank to each artdaq process for data f...
SharedMemoryEventReceiver(uint32_t shm_key, uint32_t broadcast_shm_key)
Connect to a Shared Memory segment using the given parameters.
size_t size() const
Get the number of buffers in the shared memory segment.
std::set< Fragment::type_t > GetFragmentTypes(bool &err)
Get a set of Fragment Types present in the event.
int ReadReadyCount()
Get the count of available buffers, both broadcasts and data.
virtual ~SharedMemoryEventReceiver()=default
SharedMemoryEventReceiver Destructor.
bool ReadyForRead(bool broadcast=false, size_t timeout_us=1000000)
Determine whether an event is available for reading.
std::string toString()
Write out information about the Shared Memory to a string.
detail::RawEventHeader * ReadHeader(bool &err)
Get the Event header.
std::unique_ptr< Fragments > GetFragmentsByType(bool &err, Fragment::type_t type)
Get a pointer to the Fragments of a given type in the event.