artdaq  v3_09_00
artdaq::RoutingManagerPolicy Class Referenceabstract

The interface through which RoutingManagerCore obtains Routing Tables using received Routing Tokens. More...

#include <artdaq/RoutingPolicies/RoutingManagerPolicy.hh>

Inheritance diagram for artdaq::RoutingManagerPolicy:
artdaq::CapacityTestPolicy artdaq::NoOpPolicy artdaq::RoundRobinPolicy

Public Member Functions

 RoutingManagerPolicy (const fhicl::ParameterSet &ps)
 RoutingManagerPolicy Constructor. More...
 
virtual ~RoutingManagerPolicy ()=default
 Default virtual Destructor.
 
virtual detail::RoutingPacket GetCurrentTable ()=0
 Generate a Routing Table using received tokens. More...
 
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.
 

Protected Member Functions

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

Fragment::sequence_id_t next_sequence_id_
 The next sequence ID to be assigned.
 

Detailed Description

The interface through which RoutingManagerCore obtains Routing Tables using received Routing Tokens.

Definition at line 17 of file RoutingManagerPolicy.hh.

Constructor & Destructor Documentation

artdaq::RoutingManagerPolicy::RoutingManagerPolicy ( const fhicl::ParameterSet &  ps)
explicit

RoutingManagerPolicy Constructor.

Parameters
psParameterSet used to configure the RoutingManagerPolicy
* RoutingManagerPolicy accepts the following Parameters:
* "receiver_ranks" (REQUIRED): A list of integers indicating the ranks that the RoutingManagerPolicy should expect tokens from
* 

Definition at line 6 of file RoutingManagerPolicy.cc.

Member Function Documentation

void artdaq::RoutingManagerPolicy::AddReceiverToken ( int  rank,
unsigned  new_slots_free 
)

Add a token to the token list.

Parameters
rankRank that the token is from
new_slots_freeNumber of slots that are now free (should usually be 1)

Definition at line 14 of file RoutingManagerPolicy.cc.

virtual detail::RoutingPacket artdaq::RoutingManagerPolicy::GetCurrentTable ( )
pure virtual

Generate a Routing Table using received tokens.

Returns
A detail::RoutingPacket containing the Routing Table

This function is pure virtual, it should be overridden by derived classes.

Implemented in artdaq::RoundRobinPolicy, artdaq::CapacityTestPolicy, and artdaq::NoOpPolicy.

size_t artdaq::RoutingManagerPolicy::GetMaxNumberOfTokens ( ) const
inline

Get the largest number of tokens that the RoutingManagerPolicy has seen at any one time.

Returns
The largest number of tokens that the RoutingManagerPolicy has seen at any one time

Definition at line 53 of file RoutingManagerPolicy.hh.

size_t artdaq::RoutingManagerPolicy::GetReceiverCount ( ) const
inline

Get the number of configured receivers.

Returns
The size of the receiver_ranks list

Definition at line 47 of file RoutingManagerPolicy.hh.


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