artdaq_demo  v3_06_00
artdaq::NthEventTransfer Class Reference

Demonstration TransferInterface plugin showing how to discard events Intended for use in the transfer_to_dispatcher case, NOT for primary data stream! More...

Inheritance diagram for artdaq::NthEventTransfer:
artdaq::TransferInterface

Public Member Functions

 NthEventTransfer (fhicl::ParameterSet const &ps, artdaq::TransferInterface::Role role)
 NthEventTransfer Constructor. More...
 
TransferInterface::CopyStatus transfer_fragment_min_blocking_mode (artdaq::Fragment const &fragment, size_t send_timeout_usec) override
 Transfer a Fragment to the destination. May not necessarily be reliable, but will not block longer than send_timeout_usec. More...
 
TransferInterface::CopyStatus transfer_fragment_reliable_mode (artdaq::Fragment &&fragment) override
 Copy a fragment, using the reliable channel. moveFragment assumes ownership of the fragment. More...
 
int receiveFragment (artdaq::Fragment &fragment, size_t receiveTimeout) override
 Receive a fragment from the transfer plugin. More...
 
int receiveFragmentHeader (detail::RawFragmentHeader &header, size_t receiveTimeout) override
 Receive a Fragment Header from the transport mechanism. More...
 
int receiveFragmentData (RawDataType *destination, size_t wordCount) override
 Receive the body of a Fragment to the given destination pointer. More...
 
int source_rank () const override
 Get the source rank from the physical transfer. More...
 
int destination_rank () const override
 Get the destination rank from the physical transfer. More...
 
bool isRunning () override
 Determine whether the TransferInterface plugin is able to send/receive data. More...
 
void flush_buffers () override
 Flush any in-flight data. This should be used by the receiver after the receive loop has ended.
 

Detailed Description

Demonstration TransferInterface plugin showing how to discard events Intended for use in the transfer_to_dispatcher case, NOT for primary data stream!

Definition at line 28 of file NthEvent_transfer.cc.

Constructor & Destructor Documentation

artdaq::NthEventTransfer::NthEventTransfer ( fhicl::ParameterSet const &  ps,
artdaq::TransferInterface::Role  role 
)

NthEventTransfer Constructor.

Parameters
psfhicl::ParameterSet used to configure TransferInterface. Contains "nth", the interval at which events will be transferred, and "physical_transfer_plugin", a table configuring the TransferInterface plugin used for those transfers
roleEither kSend or kReceive, see TransferInterface constructor

Definition at line 126 of file NthEvent_transfer.cc.

Member Function Documentation

int artdaq::NthEventTransfer::destination_rank ( ) const
inlineoverride

Get the destination rank from the physical transfer.

Returns
The destination rank from the physical transfer

Definition at line 102 of file NthEvent_transfer.cc.

bool artdaq::NthEventTransfer::isRunning ( )
inlineoverridevirtual

Determine whether the TransferInterface plugin is able to send/receive data.

Returns
True if the TransferInterface plugin is currently able to send/receive data

Reimplemented from artdaq::TransferInterface.

Definition at line 109 of file NthEvent_transfer.cc.

int artdaq::NthEventTransfer::receiveFragment ( artdaq::Fragment fragment,
size_t  receiveTimeout 
)
inlineoverride

Receive a fragment from the transfer plugin.

Parameters
fragmentReference to output Fragment object
receiveTimeoutTimeout before aborting receive
Returns
Rank of sender or RECV_TIMEOUT

Definition at line 63 of file NthEvent_transfer.cc.

int artdaq::NthEventTransfer::receiveFragmentData ( RawDataType destination,
size_t  wordCount 
)
inlineoverride

Receive the body of a Fragment to the given destination pointer.

Parameters
destinationPointer to memory region where Fragment data should be stored
wordCountNumber of words of Fragment data to receive
Returns
The rank the Fragment was received from (should be source_rank), or RECV_TIMEOUT

Definition at line 87 of file NthEvent_transfer.cc.

int artdaq::NthEventTransfer::receiveFragmentHeader ( detail::RawFragmentHeader header,
size_t  receiveTimeout 
)
inlineoverride

Receive a Fragment Header from the transport mechanism.

Parameters
[out]headerReceived Fragment Header
receiveTimeoutTimeout for receive
Returns
The rank the Fragment was received from (should be source_rank), or RECV_TIMEOUT

Definition at line 76 of file NthEvent_transfer.cc.

int artdaq::NthEventTransfer::source_rank ( ) const
inlineoverride

Get the source rank from the physical transfer.

Returns
The source rank from the physical transfer

Definition at line 96 of file NthEvent_transfer.cc.

TransferInterface::CopyStatus artdaq::NthEventTransfer::transfer_fragment_min_blocking_mode ( artdaq::Fragment const &  fragment,
size_t  send_timeout_usec 
)
overridevirtual

Transfer a Fragment to the destination. May not necessarily be reliable, but will not block longer than send_timeout_usec.

Parameters
fragmentFragment to transfer
send_timeout_usecTimeout for send, in microseconds
Returns
CopyStatus detailing result of transfer

Implements artdaq::TransferInterface.

Definition at line 152 of file NthEvent_transfer.cc.

TransferInterface::CopyStatus artdaq::NthEventTransfer::transfer_fragment_reliable_mode ( artdaq::Fragment &&  fragment)
overridevirtual

Copy a fragment, using the reliable channel. moveFragment assumes ownership of the fragment.

Parameters
fragmentFragment to copy
Returns
CopyStatus (either kSuccess, kTimeout, kErrorNotRequiringException or an exception)

Implements artdaq::TransferInterface.

Definition at line 167 of file NthEvent_transfer.cc.


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