DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Specifically, if you're using DEP_PKGS appfwk
in your daq_codegen
call, you will have to add iomanager
to the DEP_PKGS
list.
Since all communication is now handled by IOManager's Sender and Receiver classes in a transport-agnostic way, the NQ classes are no longer needed.
Instead, all data structs which may be transmitted over the network should have the DUNE_DAQ_SERIALIZABLE macro called:
DUNE_DAQ_SERIALIZE_NON_INTRUSIVE
do not need to be updated, DUNE_DAQ_SERIALIZABLE
is called as part of that macro.Any tests that directly configure QueueRegistry and/or NetworkManager should instead configure IOManager. This translation is fairly straightforward, see IOManager's unit test for examples.
For modules which loop over ModInit::qinfos
, they should now loop over ModInit::conn_refs
(or update to using DAQModuleHelper, below)
Instead of appfwk::queue_index
or appfwk::queue_inst
, use appfwk::connection_index
or appfwk::connection_inst
. These methods return the iomanager::ConnectionRef objects needed to get the Sender and Receiver objects from the IOManager.
Unfortunately, the signature changes are not easily replaceable with sed
.
#include "appfwk/DAQSink.hpp</tt> becomes <tt>\#include "iomanager/Sender.hpp"</tt>
* <tt>queue_.reset(new DAQSink\<T\>("name"));</tt> must become <tt>queue_ = IOManager::get()-\>get_sender\<T\>(uid);</tt>
* Instead of <tt>std::unique_ptr\<DAQSink\<T\>\></tt>, use <tt>std::shared_ptr\<iomanager::SenderConcept\<T\>\></tt>
* <tt>queue_-\>push(std::move(obj), timeout);</tt> becomes <tt>queue_-\>send(obj, timeout);</tt>
@subsection autotoc_md322 DAQSource
* <tt>\#include "appfwk/DAQSource.hpp
becomes #include "iomanager/Receiver.hpp"
queue_.reset(new DAQSource<T>("name"));
must become queue_ = IOManager::get()->get_receiver<T>(uid);
std::unique_ptr<DAQSource<T>>
, use std::shared_ptr<iomanager::ReceiverConcept<T>>
queue_->pop(result, timeout);
becomes result = queue_->receive(timeout);
can_push()
and can_pop()
are not supported by Sender and Receiver. Their usage should be replaced with try..catch
blocks:
becomes
NetworkManager::get().send_to(conn_name, data)
with IOManager::get()->get_sender<T>(conn_name)->send(data)
ipm::Receiver::Response res = NetworkManager::get().receive_from(conn_name, tmo)
with T res_T = IOManager::get()->get_receiver<T>(conn_name)->receive(tmo)
ipm::Receiver::Response message
to whatever type is desired on that connection. Updating the method itself should be straightforward; simply remove the code that takes the message and deserializes it (since that is now handled internally in iomanager::Receiver classes).m_receiver = IOManager::get()->get_receiver<T>(conn_ref); m_receiver->add_callback(&method)
iomanager::IOManager::get()->get_sender<T>(ref)->send(data)
, you can simply call get_iom_sender<T>(ref)->send(data)
iomanager::IOManager::get()
-> get_iomanager()
iomanager::IOManager::get()->get_sender<T>(uid)
-> get_iom_sender<T>(uid)
iomanager::IOManager::get()->get_receiver<T>(uid)
-> get_iom_receiver<T>(uid)