|
DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
A simplified API for passing messages between DAQModules
Sender/Receiver instances using ConnectionRefs or uid (defined below)Queues and NetworkManager automatically in configuredunedaq::get_iomanager() will return a pointer to the IOManager singletonIOManager::get_sender<DataType>(std::string uid) and IOManager::get_receiver<DataType>(std::string uid) should be used to get Sender and Receiver objects connected to the appropriate connections. Note that ConnectionId objects are not required, as they will be constructed from the provided DataType and uid arguments.".*") to a specific connection UID, depending on the desired scope of the subscription. Topics are automatically assigned by IOManager as the string representation of DataType.appfwk will give DAQModules a list of appfwk::app::ConnectionReference objects, which associate a "name" to connection UIDs. Methods in DAQModuleHelper.hpp take DAQModule configuration objects and extract specific UIDs for given names. serialization library provides a new macro DUNE_DAQ_TYPESTRING(Type, string) which is included in the standard DUNE_DAQ_SERIALIZABLE and DUNE_DAQ_SERIALIZE_NON_INTRUSIVE macros (called from the dunedaq namespace only). These macros define the function datatype_to_string<T> which is used by IOManager to translate a datatype to the appropriate string. This template function must be visible in every compilation unit sending or receiving a given type!daqconf, all connections and queues must have a declared data type that matches a call to DUNE_DAQ_TYPESTRING. add_endpoint and connect_modules have changed their API to accomodate this.ConnectionId uniquely identifies a network connection or queueuid: String identifier for connectiondata_type: String representation of data typeConnection defines a network connection, with required initializationid: ConnectionIdconnection_type: Describes what kind of connection (kSendReceive, kPubSub)uri: Field is used by lower-level code to configure the connectiontcp://localhost:1234 (name translation is provided by IPM)QueueConfig represents an app-internal queueid: ConectionIdqueue_type: Type of the queue implementation (e.g. kStdDeQueue, kFollySPSCQueue, kFollyMPMCQueue)capacity: Capacity of the queueReceiver is base type without template (for use in IOManager::m_receivers)ReceiverConcept introduces template and serves as class given by IOManager::get_receiverQueueReceiverModel and NetworkReceiverModel implement receives and callback loop for queues and networkNetworkReceiverModel::read_network determines if type is serializable using template metaprogrammingReceiversQueueSenderModel and NetworkSenderModel implement sends for queues and networkNetworkReceiverModel::write_network determines if type is serializable using template metaprogramming
The standard send() and receive() methods will throw an ERS exception if they time out. This is ideal for cases where timeouts are an exceptional condition (this applies to most, if not all send calls, for example). In cases where the timeout condition can be safely ignored (such as the callback-driving methods which are retrying the receive in a tight loop), the try_send and try_receive methods may be used. Note that these methods are not noexcept, any non-timeout issues will result in an ERS exception.
The API used for queues is documented here. Network connections use IPM and NetworkManager