Line data Source code
1 : /**
2 : * @file NetworkDetectorToDaqConnection.cpp
3 : *
4 : * Implementation of NetworkDetectorToDaqConnection methods
5 : *
6 : * This is part of the DUNE DAQ Software Suite, copyright 2023.
7 : * Licensing/copyright details are in the COPYING file that you should have
8 : * received with this code.
9 : */
10 :
11 : #include "appmodel/NetworkDetectorToDaqConnection.hpp"
12 : #include "appmodel/NWDetDataReceiver.hpp"
13 : #include "appmodel/NWDetDataSender.hpp"
14 : #include "confmodel/DetDataReceiver.hpp"
15 : #include "confmodel/DetDataSender.hpp"
16 :
17 : namespace dunedaq::appmodel {
18 :
19 : std::vector<const dunedaq::confmodel::DetDataSender*>
20 61 : NetworkDetectorToDaqConnection::senders() const {
21 61 : std::vector<const dunedaq::confmodel::DetDataSender*> senders;
22 61 : if (m_net_senders.empty()) {
23 19 : std::lock_guard scoped_lock(m_mutex);
24 19 : check_init();
25 19 : }
26 122 : for (auto sender: m_net_senders) {
27 61 : senders.push_back(
28 61 : dynamic_cast<const dunedaq::confmodel::DetDataSender*>(sender));
29 : }
30 61 : TLOG_DEBUG(6) << "Found " << senders.size() << " senders\n";
31 61 : return senders;
32 0 : }
33 :
34 : const confmodel::DetDataReceiver*
35 0 : NetworkDetectorToDaqConnection::receiver() const {
36 0 : if (m_net_senders.empty()) {
37 0 : std::lock_guard scoped_lock(m_mutex);
38 0 : check_init();
39 0 : }
40 0 : return (m_net_receiver);
41 : }
42 :
43 : } // namespace dunedaq::appmodel
|