|
artdaq_core
v3_08_01
|
SharedMemoryEventReceiver can receive events (as written by SharedMemoryEventManager) from Shared Memory. More...
#include <artdaq-core/Core/SharedMemoryEventReceiver.hh>
Public Member Functions | |
| SharedMemoryEventReceiver (uint32_t shm_key, uint32_t broadcast_shm_key) | |
| Connect to a Shared Memory segment using the given parameters. More... | |
| virtual | ~SharedMemoryEventReceiver ()=default |
| SharedMemoryEventReceiver Destructor. | |
| bool | ReadyForRead (bool broadcast=false, size_t timeout_us=1000000) |
| Determine whether an event is available for reading. More... | |
| detail::RawEventHeader * | ReadHeader (bool &err) |
| Get the Event header. More... | |
| std::set< Fragment::type_t > | GetFragmentTypes (bool &err) |
| Get a set of Fragment Types present in the event. More... | |
| std::unique_ptr< Fragments > | GetFragmentsByType (bool &err, Fragment::type_t type) |
| Get a pointer to the Fragments of a given type in the event. More... | |
| std::string | toString () |
| Write out information about the Shared Memory to a string. More... | |
| void | ReleaseBuffer () |
| Release the buffer currently being read to the Empty state. | |
| int | GetRank () |
| Returns the Rank of the writing process. More... | |
| int | GetMyId () |
| Returns the ID of the reading process. More... | |
| bool | IsEndOfData () |
| Determine if the end of data has been reached (from data shared memory segment) More... | |
| int | ReadReadyCount () |
| Get the count of available buffers, both broadcasts and data. More... | |
| size_t | size () |
| Get the size of the data buffer. More... | |
SharedMemoryEventReceiver can receive events (as written by SharedMemoryEventManager) from Shared Memory.
Definition at line 14 of file SharedMemoryEventReceiver.hh.
| artdaq::SharedMemoryEventReceiver::SharedMemoryEventReceiver | ( | uint32_t | shm_key, |
| uint32_t | broadcast_shm_key | ||
| ) |
Connect to a Shared Memory segment using the given parameters.
| shm_key | Key of the Shared Memory segment |
| broadcast_shm_key | Key of the broadcast Shared Memory segment |
Definition at line 9 of file SharedMemoryEventReceiver.cc.
| std::unique_ptr< artdaq::Fragments > artdaq::SharedMemoryEventReceiver::GetFragmentsByType | ( | bool & | err, |
| Fragment::type_t | type | ||
| ) |
Get a pointer to the Fragments of a given type in the event.
| err | Flag used to indicate if an error has occurred |
| type | Type of Fragments to get. (Use InvalidFragmentType to get all Fragments) |
Definition at line 141 of file SharedMemoryEventReceiver.cc.
| std::set< artdaq::Fragment::type_t > artdaq::SharedMemoryEventReceiver::GetFragmentTypes | ( | bool & | err | ) |
Get a set of Fragment Types present in the event.
| err | Flag used to indicate if an error has occurred |
Definition at line 109 of file SharedMemoryEventReceiver.cc.
|
inline |
Returns the ID of the reading process.
Definition at line 79 of file SharedMemoryEventReceiver.hh.
|
inline |
Returns the Rank of the writing process.
Definition at line 73 of file SharedMemoryEventReceiver.hh.
|
inline |
Determine if the end of data has been reached (from data shared memory segment)
Definition at line 85 of file SharedMemoryEventReceiver.hh.
| artdaq::detail::RawEventHeader * artdaq::SharedMemoryEventReceiver::ReadHeader | ( | bool & | err | ) |
Get the Event header.
| err | Flag used to indicate if an error has occurred |
Definition at line 90 of file SharedMemoryEventReceiver.cc.
|
inline |
Get the count of available buffers, both broadcasts and data.
Definition at line 91 of file SharedMemoryEventReceiver.hh.
| bool artdaq::SharedMemoryEventReceiver::ReadyForRead | ( | bool | broadcast = false, |
| size_t | timeout_us = 1000000 |
||
| ) |
Determine whether an event is available for reading.
| broadcast | (Default false) Whether to wait for a broadcast buffer only |
| timeout_us | (Default 1000000) Time to wait for buffer to become available. |
Definition at line 20 of file SharedMemoryEventReceiver.cc.
|
inline |
Get the size of the data buffer.
Definition at line 97 of file SharedMemoryEventReceiver.hh.
| std::string artdaq::SharedMemoryEventReceiver::toString | ( | ) |
Write out information about the Shared Memory to a string.
Definition at line 206 of file SharedMemoryEventReceiver.cc.