artdaq  v3_12_02
artdaq::NoOpPolicy Class Reference

A RoutingManagerPolicy which simply assigns Sequence IDs to tokens in the order they were received. More...

Inheritance diagram for artdaq::NoOpPolicy:
artdaq::RoutingManagerPolicy

Public Member Functions

 NoOpPolicy (fhicl::ParameterSet const &ps)
 NoOpPolicy Constructor. More...
 
 ~NoOpPolicy () override=default
 Default virtual Destructor.
 
void CreateRoutingTable (detail::RoutingPacket &table) override
 Add entries to the given RoutingPacket using currently-held tokens. More...
 
detail::RoutingPacketEntry CreateRouteForSequenceID (artdaq::Fragment::sequence_id_t seq, int requesting_rank) override
 Get an artdaq::detail::RoutingPacketEntry for a given sequence ID and rank. Used by RequestBasedEventBuilder and DataFlow RoutingManagerMode. 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...
 
size_t GetTokensUsedSinceLastUpdate () const
 Get the number of tokens that have been used since the last update. More...
 
void ResetTokensUsedSinceLastUpdate ()
 Reset the number of tokens used.
 
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.
 
Fragment::sequence_id_t GetNextSequenceID () const
 Get the next sequence ID to be routed. More...
 
size_t GetHeldTokenCount () const
 Get the number of tokens that are waiting to be used. More...
 
detail::RoutingPacket GetCurrentTable ()
 Create a RoutingPacket from currently-owned tokens. Used by EventBuilder and RequestBasedEventBuilder RoutingManagerMode. More...
 
detail::RoutingPacketEntry GetRouteForSequenceID (artdaq::Fragment::sequence_id_t seq, int requesting_rank)
 Get an artdaq::detail::RoutingPacketEntry for a given sequence ID and rank. Used by RequestBasedEventBuilder and DataFlow RoutingManagerMode. More...
 
detail::RoutingManagerMode GetRoutingMode () const
 Get the current RoutingManagerMode of this RoutingManager. More...
 
size_t GetCacheSize () const
 Get the size of the routing cache. For testing. More...
 
bool CacheHasRoute (artdaq::Fragment::sequence_id_t seq) const
 Determine whether the routing cache has a route for the given sequence ID. For testing. More...
 

Additional Inherited Members

- Protected Attributes inherited from artdaq::RoutingManagerPolicy
std::deque< int > tokens_
 The list of tokens which are available for use.
 
std::atomic< size_t > tokens_used_since_last_update_
 Number of tokens consumed since last metric update.
 
Fragment::sequence_id_t next_sequence_id_
 The next sequence ID to be assigned.
 
std::unordered_set< int > receiver_ranks_
 Configured receiver (e.g. EventBuilder for BR->EB routing) ranks.
 
detail::RoutingManagerMode routing_mode_
 Current routing mode.
 

Detailed Description

A RoutingManagerPolicy which simply assigns Sequence IDs to tokens in the order they were received.

Definition at line 15 of file NoOp_policy.cc.

Constructor & Destructor Documentation

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

NoOpPolicy Constructor.

Parameters
psParameterSet used to configure the NoOpPolicy

NoOpPolicy takes no additional Parameters at this time

Definition at line 24 of file NoOp_policy.cc.

Member Function Documentation

detail::RoutingPacketEntry artdaq::NoOpPolicy::CreateRouteForSequenceID ( artdaq::Fragment::sequence_id_t  seq,
int  requesting_rank 
)
overridevirtual

Get an artdaq::detail::RoutingPacketEntry for a given sequence ID and rank. Used by RequestBasedEventBuilder and DataFlow RoutingManagerMode.

Parameters
seqSequence Number to get route for
requesting_rankRank to route for
Returns
artdaq::detail::RoutingPacketEntry connecting sequence ID to destination rank

Implements artdaq::RoutingManagerPolicy.

Definition at line 67 of file NoOp_policy.cc.

void artdaq::NoOpPolicy::CreateRoutingTable ( detail::RoutingPacket table)
overridevirtual

Add entries to the given RoutingPacket using currently-held tokens.

Parameters
tableRoutingPacket to add entries to

NoOp_policy will add entries for all tokens in the order that they were received

Implements artdaq::RoutingManagerPolicy.

Definition at line 56 of file NoOp_policy.cc.


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