artdaq  v3_09_01
artdaq::RoundRobinPolicy Class Reference

A RoutingManagerPolicy which evenly distributes Sequence IDs to all receivers. If an uneven number of tokens have been received, extra tokens are stored for the next table update. More...

Inheritance diagram for artdaq::RoundRobinPolicy:
artdaq::RoutingManagerPolicy

Public Member Functions

 RoundRobinPolicy (const fhicl::ParameterSet &ps)
 RoundRobinPolicy Constructor. More...
 
 ~RoundRobinPolicy () override=default
 Default virtual Destructor.
 
detail::RoutingPacket GetCurrentTable () override
 Create a Routing Table using the tokens that have been received. More...
 
- Public Member Functions inherited from artdaq::RoutingManagerPolicy
 RoutingManagerPolicy (const fhicl::ParameterSet &ps)
 RoutingManagerPolicy Constructor. More...
 
virtual ~RoutingManagerPolicy ()=default
 Default virtual Destructor.
 
size_t GetReceiverCount () const
 Get the number of configured receivers. More...
 
size_t GetMaxNumberOfTokens () const
 Get the largest number of tokens that the RoutingManagerPolicy has seen at any one time. More...
 
void AddReceiverToken (int rank, unsigned new_slots_free)
 Add a token to the token list. More...
 
void Reset ()
 Reset the policy, setting the next sequence ID to be used to 1, and removing any tokens.
 

Additional Inherited Members

- Protected Member Functions inherited from artdaq::RoutingManagerPolicy
std::unique_ptr< std::deque
< int > > 
getTokensSnapshot ()
 Gets the current token list, used for building Routing Tables.
 
void addUnusedTokens (std::unique_ptr< std::deque< int >> tokens)
 If necessary, return unused tokens to the token list, for subsequent updates.
 
- Protected Attributes inherited from artdaq::RoutingManagerPolicy
Fragment::sequence_id_t next_sequence_id_
 The next sequence ID to be assigned.
 

Detailed Description

A RoutingManagerPolicy which evenly distributes Sequence IDs to all receivers. If an uneven number of tokens have been received, extra tokens are stored for the next table update.

Definition at line 15 of file RoundRobin_policy.cc.

Constructor & Destructor Documentation

artdaq::RoundRobinPolicy::RoundRobinPolicy ( const fhicl::ParameterSet &  ps)
inlineexplicit

RoundRobinPolicy Constructor.

Parameters
psParameterSet used to configure RoundRobinPolicy

RoundRobinPolicy accepts the following Parameter: "minimum_participants" (Default: 0): Minimum number of receivers to distribute between. Use negative number to indicate how many can be missing from total. If the number of allowed missing receivers is greater than the number that exist, then the minimum number of participants will be set to 1.

Definition at line 25 of file RoundRobin_policy.cc.

Member Function Documentation

detail::RoutingPacket artdaq::RoundRobinPolicy::GetCurrentTable ( )
overridevirtual

Create a Routing Table using the tokens that have been received.

Returns
A detail::RoutingPacket containing the table update

RoundRobinPolicy will go through the list of receivers as many times as it can, until one or more receivers have no tokens. It always does full "turns" through the recevier list.

Implements artdaq::RoutingManagerPolicy.

Definition at line 55 of file RoundRobin_policy.cc.


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