$treeview $search $mathjax $extrastylesheet
artdaq_core  v3_06_01
$projectbrief
$projectbrief
$searchbox

artdaq::SharedMemoryEventReceiver Class Reference

SharedMemoryEventReceiver can receive events (as written by SharedMemoryEventManager) from Shared Memory. More...

#include <artdaq-core/Core/SharedMemoryEventReceiver.hh>

List of all members.

Public Member Functions

 SharedMemoryEventReceiver (uint32_t shm_key, uint32_t broadcast_shm_key)
 Connect to a Shared Memory segment using the given parameters.
virtual ~SharedMemoryEventReceiver ()
 SharedMemoryEventReceiver Destructor.
bool ReadyForRead (bool broadcast=false, size_t timeout_us=1000000)
 Determine whether an event is available for reading.
detail::RawEventHeaderReadHeader (bool &err)
 Get the Event header.
std::set< Fragment::type_tGetFragmentTypes (bool &err)
 Get a set of Fragment Types present in the event.
std::unique_ptr< FragmentsGetFragmentsByType (bool &err, Fragment::type_t type)
 Get a pointer to the Fragments of a given type in the event.
std::string toString ()
 Write out information about the Shared Memory to a string.
void ReleaseBuffer ()
 Release the buffer currently being read to the Empty state.
int GetRank ()
 Returns the Rank of the writing process.
int GetMyId ()
 Returns the ID of the reading process.
bool IsEndOfData ()
 Determine if the end of data has been reached (from data shared memory segment).
int ReadReadyCount ()
 Get the count of available buffers, both broadcasts and data.
size_t size ()
 Get the size of the data buffer.

Detailed Description

SharedMemoryEventReceiver can receive events (as written by SharedMemoryEventManager) from Shared Memory.

Definition at line 14 of file SharedMemoryEventReceiver.hh.


Constructor & Destructor Documentation

artdaq::SharedMemoryEventReceiver::SharedMemoryEventReceiver ( uint32_t  shm_key,
uint32_t  broadcast_shm_key 
)

Connect to a Shared Memory segment using the given parameters.

Parameters:
shm_key Key of the Shared Memory segment
broadcast_shm_key Key of the broadcast Shared Memory segment

Definition at line 11 of file SharedMemoryEventReceiver.cc.


Member Function Documentation

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.

Parameters:
err Flag used to indicate if an error has occurred
type Type of Fragments to get. (Use InvalidFragmentType to get all Fragments)
Returns:
std::unique_ptr to a Fragments object containing returned Fragment objects

Definition at line 137 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.

Parameters:
err Flag used to indicate if an error has occurred
Returns:
std::set of Fragment::type_t of all Fragment types in the event

Definition at line 105 of file SharedMemoryEventReceiver.cc.

int artdaq::SharedMemoryEventReceiver::GetMyId (  )  [inline]

Returns the ID of the reading process.

Returns:
The ID of the reading process

Definition at line 79 of file SharedMemoryEventReceiver.hh.

int artdaq::SharedMemoryEventReceiver::GetRank (  )  [inline]

Returns the Rank of the writing process.

Returns:
The rank of the writer process

Definition at line 73 of file SharedMemoryEventReceiver.hh.

bool artdaq::SharedMemoryEventReceiver::IsEndOfData (  )  [inline]

Determine if the end of data has been reached (from data shared memory segment).

Returns:
Whether the EndOfData flag has been raised by the data shared memory segment

Definition at line 85 of file SharedMemoryEventReceiver.hh.

artdaq::detail::RawEventHeader * artdaq::SharedMemoryEventReceiver::ReadHeader ( bool &  err  ) 

Get the Event header.

Parameters:
err Flag used to indicate if an error has occurred
Returns:
Pointer to RawEventHeader from buffer

Definition at line 86 of file SharedMemoryEventReceiver.cc.

int artdaq::SharedMemoryEventReceiver::ReadReadyCount (  )  [inline]

Get the count of available buffers, both broadcasts and data.

Returns:
The sum of the available data buffer count and the available broadcast buffer count

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.

Parameters:
broadcast (Default false) Whether to wait for a broadcast buffer only
timeout_us (Default 1000000) Time to wait for buffer to become available.
Returns:
Whether an event is available for reading

Definition at line 22 of file SharedMemoryEventReceiver.cc.

size_t artdaq::SharedMemoryEventReceiver::size (  )  [inline]

Get the size of the data buffer.

Returns:
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.

Returns:
String containing information about the current Shared Memory buffers

Definition at line 202 of file SharedMemoryEventReceiver.cc.


The documentation for this class was generated from the following files:

Generated on 24 Aug 2020 for artdaq_core by  doxygen 1.6.1