DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneV3Interface.hxx
Go to the documentation of this file.
1
8
9template<class T>
10T
12 daphne::MessageTypeV2 sent_type,
13 daphne::MessageTypeV2 received_type)
14{
15
16 std::unique_lock<std::mutex> lock(m_access_mutex);
17
18 _send(std::move(message), sent_type);
19
20 auto ret = _receive();
21
22 lock.unlock();
23
24 const auto ty = ret.type();
25 T out;
26 if (ty != received_type) {
27 throw FailedDecoding(ERS_HERE,
28 out.GetTypeName(),
29 ret.payload(),
30 TypeMismatch(ERS_HERE, MessageTypeV2_Name(ty), MessageTypeV2_Name(received_type)));
31 }
32
33 if (!out.ParseFromString(ret.payload())) {
34 throw FailedDecoding(ERS_HERE, out.GetTypeName(), ret.payload());
35 }
36
37 return out;
38}
#define ERS_HERE
daphne::ControlEnvelopeV2 send(std::string &&message, daphne::MessageTypeV2)
void _send(std::string &&message, daphne::MessageTypeV2)
FELIX Initialization std::string initerror FELIX queue timed out