artdaq  v3_09_00
ArtdaqSharedMemoryService Class Reference

ArtdaqSharedMemoryService extends ArtdaqSharedMemoryServiceInterface. It receives events from shared memory using SharedMemoryEventReceiver. It also manages the artdaq Global varaibles my_rank and app_name. Users should retrieve a ServiceHandle to this class before using artdaq Globals to ensure the correct values are used. More...

#include <artdaq/ArtModules/ArtdaqSharedMemoryService.h>

Inheritance diagram for ArtdaqSharedMemoryService:
ArtdaqSharedMemoryServiceInterface

Classes

struct  Config
 Allowed Configuration parameters of NetMonTransportService. May be used for configuration validation More...
 

Public Types

using Parameters = fhicl::WrappedTable< Config >
 Used for ParameterSet validation (if desired)
 

Public Member Functions

virtual ~ArtdaqSharedMemoryService ()
 NetMonTransportService Destructor. Calls disconnect().
 
 ArtdaqSharedMemoryService (fhicl::ParameterSet const &pset, art::ActivityRegistry &)
 NetMonTransportService Constructor. More...
 
std::unordered_map
< artdaq::Fragment::type_t,
std::unique_ptr
< artdaq::Fragments > > 
ReceiveEvent (bool broadcast) override
 Receive an event from the shared memory. More...
 
size_t GetQueueSize () override
 Get the number of events which are ready to be read. More...
 
size_t GetQueueCapacity () override
 Get the maximum number of events which can be stored in the shared memory. More...
 
std::shared_ptr
< artdaq::detail::RawEventHeader > 
GetEventHeader () override
 Get a shared_ptr to the current event header, if any. More...
 
- Public Member Functions inherited from ArtdaqSharedMemoryServiceInterface
virtual ~ArtdaqSharedMemoryServiceInterface ()=default
 Default virtual destructor.
 

Detailed Description

ArtdaqSharedMemoryService extends ArtdaqSharedMemoryServiceInterface. It receives events from shared memory using SharedMemoryEventReceiver. It also manages the artdaq Global varaibles my_rank and app_name. Users should retrieve a ServiceHandle to this class before using artdaq Globals to ensure the correct values are used.

Definition at line 63 of file ArtdaqSharedMemoryService.h.

Constructor & Destructor Documentation

ArtdaqSharedMemoryService::ArtdaqSharedMemoryService ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry &   
)

NetMonTransportService Constructor.

Parameters
psetParameterSet used to configure NetMonTransportService and DataSenderManager. See NetMonTransportService::Config

Definition at line 17 of file ArtdaqSharedMemoryService_service.cc.

Member Function Documentation

std::shared_ptr<artdaq::detail::RawEventHeader> ArtdaqSharedMemoryService::GetEventHeader ( )
inlineoverridevirtual

Get a shared_ptr to the current event header, if any.

Returns
std::shared_ptr to current event header. May be nullptr if no event is currently being read

Implements ArtdaqSharedMemoryServiceInterface.

Definition at line 113 of file ArtdaqSharedMemoryService.h.

size_t ArtdaqSharedMemoryService::GetQueueCapacity ( )
inlineoverridevirtual

Get the maximum number of events which can be stored in the shared memory.

Returns
The maximum number of events which can be stored in the shared memory

Implements ArtdaqSharedMemoryServiceInterface.

Definition at line 108 of file ArtdaqSharedMemoryService.h.

size_t ArtdaqSharedMemoryService::GetQueueSize ( )
inlineoverridevirtual

Get the number of events which are ready to be read.

Returns
The number of events which can be read

Implements ArtdaqSharedMemoryServiceInterface.

Definition at line 103 of file ArtdaqSharedMemoryService.h.

std::unordered_map< artdaq::Fragment::type_t, std::unique_ptr< artdaq::Fragments > > ArtdaqSharedMemoryService::ReceiveEvent ( bool  broadcast)
overridevirtual

Receive an event from the shared memory.

Parameters
broadcastWhether to only attempt to receive a broadcast (broadcasts are always preferentially received over data)
Returns
Map of Fragment types retrieved from shared memory

Implements ArtdaqSharedMemoryServiceInterface.

Definition at line 73 of file ArtdaqSharedMemoryService_service.cc.


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