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 114 : NetworkDetectorToDaqConnection::senders() const
21 : {
22 114 : std::vector<const dunedaq::confmodel::DetDataSender*> senders;
23 114 : if (m_net_senders.empty()) {
24 22 : std::lock_guard scoped_lock(m_mutex);
25 22 : check_init();
26 22 : }
27 228 : for (auto sender : m_net_senders) {
28 114 : senders.push_back(dynamic_cast<const dunedaq::confmodel::DetDataSender*>(sender));
29 : }
30 114 : TLOG_DEBUG(6) << "Found " << senders.size() << " senders\n";
31 114 : return senders;
32 0 : }
33 :
34 : const confmodel::DetDataReceiver*
35 50 : NetworkDetectorToDaqConnection::receiver() const
36 : {
37 50 : if (m_net_senders.empty()) {
38 0 : std::lock_guard scoped_lock(m_mutex);
39 0 : check_init();
40 0 : }
41 50 : return (m_net_receiver);
42 : }
43 :
44 : } // namespace dunedaq::appmodel
|