1 #ifndef artdaq_Application_Routing_RoutingMasterPolicy_hh
2 #define artdaq_Application_Routing_RoutingMasterPolicy_hh
4 #include "artdaq/DAQdata/Globals.hh"
5 #include "artdaq/DAQrate/detail/RoutingPacket.hh"
6 #include "artdaq-core/Data/Fragment.hh"
8 #include "fhiclcpp/fwd.h"
11 #include <unordered_set>
73 mutable std::mutex tokens_mutex_;
74 std::unordered_set<int> receiver_ranks_;
75 std::deque<int> tokens_;
76 size_t max_token_count_;
82 #endif // artdaq_Application_Routing_RoutingMasterPolicy_hh
void AddReceiverToken(int rank, unsigned new_slots_free)
Add a token to the token list.
The interface through which RoutingMasterCore obtains Routing Tables using received Routing Tokens...
virtual detail::RoutingPacket GetCurrentTable()=0
Generate a Routing Table using received tokens.
size_t GetMaxNumberOfTokens() const
Get the largest number of tokens that the RoutingMasterPolicy has seen at any one time...
std::vector< RoutingPacketEntry > RoutingPacket
A RoutingPacket is simply a vector of RoutingPacketEntry objects. It is not suitable for network tran...
Fragment::sequence_id_t next_sequence_id_
The next sequence ID to be assigned.
std::unique_ptr< std::deque< int > > getTokensSnapshot()
Gets the current token list, used for building Routing Tables.
void Reset()
Reset the policy, setting the next sequence ID to be used to 1.
void addUnusedTokens(std::unique_ptr< std::deque< int >> tokens)
If necessary, return unused tokens to the token list, for subsequent updates.
RoutingMasterPolicy(fhicl::ParameterSet ps)
RoutingMasterPolicy Constructor.
virtual ~RoutingMasterPolicy()=default
Default virtual Destructor.
size_t GetReceiverCount() const
Get the number of configured receivers.