artdaq  v3_09_00
artdaq::TokenReceiver Class Reference

Receives event builder "free buffer" tokens and adds them to a specified RoutingPolicy. More...

#include <artdaq/DAQrate/TokenReceiver.hh>

Classes

struct  Config
 Configuration of the TokenReceiver. May be used for parameter validation. More...
 

Public Types

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

Public Member Functions

 TokenReceiver (const fhicl::ParameterSet &ps, std::shared_ptr< RoutingManagerPolicy > policy, detail::RoutingManagerMode routing_mode, size_t number_of_senders, size_t update_interval_msec)
 TokenReceiver Constructor. More...
 
virtual ~TokenReceiver ()
 TokenReceiver Destructor.
 
void startTokenReception ()
 Starts the reception of event builder tokens.
 
void pauseTokenReception ()
 Temporarily suspends the reception of event builder tokens.
 
void resumeTokenReception ()
 Resumes the reception of event builder tokens after a suspension.
 
void stopTokenReception (bool force=false)
 Stops the reception of event builder tokens. More...
 
void setStatsHelper (std::shared_ptr< StatisticsHelper > const &helper, std::string const &stat_key)
 Specifies a StatisticsHelper instance to use when gathering statistics. More...
 
void setRunNumber (uint32_t run)
 Sets the current run number. More...
 
size_t getReceivedTokenCount () const
 Returns the number of tokens that have been received. More...
 

Detailed Description

Receives event builder "free buffer" tokens and adds them to a specified RoutingPolicy.

Definition at line 18 of file TokenReceiver.hh.

Constructor & Destructor Documentation

artdaq::TokenReceiver::TokenReceiver ( const fhicl::ParameterSet &  ps,
std::shared_ptr< RoutingManagerPolicy policy,
detail::RoutingManagerMode  routing_mode,
size_t  number_of_senders,
size_t  update_interval_msec 
)
explicit

TokenReceiver Constructor.

Parameters
psParameterSet used to configure TokenReceiver. See artdaq::TokenReceiver::Config
policyRoutingManagerPolicy that manages the received tokens
routing_modeWhether routing should occur by Sequence ID (i.e. BR->EB), or by send count (EB->DL). RouteBySendCount assumes no event building on receiver
number_of_sendersFor RouteBySendCount routing mode, the number of tokens needed to issue a new routing table entry
update_interval_msecThe amount of time to wait in epoll_wait for a new update to arrive

Definition at line 12 of file TokenReceiver.cc.

Member Function Documentation

size_t artdaq::TokenReceiver::getReceivedTokenCount ( ) const
inline

Returns the number of tokens that have been received.

Returns
The number of tokens that have been received since the most recent start

Definition at line 90 of file TokenReceiver.hh.

void artdaq::TokenReceiver::setRunNumber ( uint32_t  run)
inline

Sets the current run number.

Parameters
runThe current run number

Definition at line 84 of file TokenReceiver.hh.

void artdaq::TokenReceiver::setStatsHelper ( std::shared_ptr< StatisticsHelper > const &  helper,
std::string const &  stat_key 
)
inline

Specifies a StatisticsHelper instance to use when gathering statistics.

Parameters
helperA shared pointer to the StatisticsHelper instance
stat_keyName to use for gathering statistics on tokens received

Definition at line 74 of file TokenReceiver.hh.

void artdaq::TokenReceiver::stopTokenReception ( bool  force = false)

Stops the reception of event builder tokens.

Parameters
forceWhether to suppress any error messages (used if called from destructor)

Definition at line 63 of file TokenReceiver.cc.


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