1 #ifndef ARTDAQ_DAQRATE_DATASENDERMANAGER_HH
2 #define ARTDAQ_DAQRATE_DATASENDERMANAGER_HH
7 #include <netinet/in.h>
9 #include <fhiclcpp/fwd.h>
11 #include "artdaq-core/Data/Fragment.hh"
12 #include "artdaq/TransferPlugins/TransferInterface.hh"
13 #include "artdaq/DAQrate/detail/FragCounter.hh"
14 #include "artdaq-utilities/Plugins/MetricManager.hh"
15 #include "../Application/Routing/RoutingPacket.hh"
19 class DataSenderManager;
98 int calcDest_(Fragment::sequence_id_t)
const;
100 void setupTableListener_();
102 void startTableReceiverThread_();
104 void receiveTableUpdatesLoop_();
107 std::map<int, std::unique_ptr<artdaq::TransferInterface>> destinations_;
108 std::set<int> enabled_destinations_;
112 bool broadcast_sends_;
113 bool non_blocking_mode_;
115 bool use_routing_master_;
116 detail::RoutingMasterMode routing_master_mode_;
117 std::atomic<bool> should_stop_;
119 std::string table_address_;
120 struct sockaddr_in table_addr_;
122 std::string ack_address_;
123 struct sockaddr_in ack_addr_;
126 std::map<Fragment::sequence_id_t, int> routing_table_;
127 mutable std::mutex routing_mutex_;
128 std::thread routing_thread_;
129 mutable std::atomic<size_t> routing_wait_time_;
131 int routing_timeout_ms_;
139 return sent_frag_count_.
count();
147 return sent_frag_count_.slotCount(rank);
149 #endif //ARTDAQ_DAQRATE_DATASENDERMANAGER_HH
size_t destinationCount() const
Get the number of configured destinations.
Sends Fragment objects using TransferInterface plugins. Uses Routing Tables if confgiured, otherwise will Round-Robin Fragments to the destinations.
virtual ~DataSenderManager()
DataSenderManager Destructor.
size_t slotCount(size_t rank) const
Get the count of Fragment objects sent by this DataSenderManager to a given destination.
Keep track of the count of Fragments received from a set of sources.
int sendFragment(Fragment &&frag)
Send the given Fragment. Return the rank of the destination to which the Fragment was sent...
DataSenderManager(const fhicl::ParameterSet &ps)
DataSenderManager Constructor.
size_t GetRoutingTableEntryCount() const
Gets the current size of the Routing Table, in case other parts of the system want to use this inform...
size_t count() const
Return the count of Fragment objects sent by this DataSenderManagerq.
std::set< int > enabled_destinations() const
Get the list of enabled destinations.
size_t count() const
Get the total number of Fragments received.