|
DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
#include <notification_interface.hpp>
Public Member Functions | |
| NotificationInterface (std::string connection_prefix="snbmodules", int timeout_send=10, int timeout_receive=100) | |
| NotificationInterface (std::vector< std::string > bk_conn, std::set< std::string > client_conn, const std::string &connection_prefix="snbmodules", int timeout_send=10, int timeout_receive=100) | |
| virtual | ~NotificationInterface ()=default |
| std::optional< NotificationData > | listen_for_notification (const std::string &id, const std::string &expected_from="", int timeout=-1, int tries=-1) |
| Listen for a notification. | |
| bool | send_notification (const notification_type::e_notification_type ¬if, const std::string &src, const std::string &dst, const std::string &id_conn, const std::string &data="", int tries=-1) |
| Send a notification during m_timeout_send ms. | |
| virtual bool | action_on_receive_notification (NotificationData notif)=0 |
| Action to do when receiving a notification. | |
| void | lookups_connections () |
| Get the list of every connections, must have the prefix first in the name of the connection and the name of the connection must be in the format: prefix.*bookkeeper.* or prefix.*client.*. | |
| const std::vector< std::string > & | get_bookkeepers_conn () const |
| Init the connection interface, Only used for standalone application. | |
| const std::set< std::string > & | get_clients_conn () const |
Private Attributes | |
| std::vector< std::string > | m_bookkeepers_conn |
| List of bookkeepers connections. | |
| std::set< std::string > | m_clients_conn |
| List of clients connections. | |
| int | m_timeout_send = 10 |
| Timeout for sending a notification in ms. | |
| int | m_timeout_receive = 100 |
| Timeout for receiving a notification in ms. | |
| std::string | m_connection_prefix = "snbmodules" |
| Prefix for the connection name. | |
| int | m_max_tries = 3 |
Definition at line 67 of file notification_interface.hpp.
|
inlineexplicit |
Definition at line 71 of file notification_interface.hpp.
|
inline |
Definition at line 80 of file notification_interface.hpp.
|
virtualdefault |
|
pure virtual |
Action to do when receiving a notification.
| notif | Notification received |
Implemented in dunedaq::snbmodules::Bookkeeper, dunedaq::snbmodules::TransferClient, and dunedaq::snbmodules::TransferSession.
|
inline |
Init the connection interface, Only used for standalone application.
| session_name | Name of the session |
| use_connectivity_service | Use the connectivity service |
| ip | IP of the connectivity service |
Definition at line 189 of file notification_interface.hpp.
|
inline |
Definition at line 190 of file notification_interface.hpp.
| std::optional< NotificationData > dunedaq::snbmodules::NotificationInterface::listen_for_notification | ( | const std::string & | id, |
| const std::string & | expected_from = "", | ||
| int | timeout = -1, | ||
| int | tries = -1 ) |
Listen for a notification.
| id | ID of the connection |
| expected_from | Expected source of the notification, if empty, accept any source |
| timeout | Timeout for receiving the notification in ms, if -1, use the default timeout |
Definition at line 21 of file notification_interface.cpp.
|
inline |
Get the list of every connections, must have the prefix first in the name of the connection and the name of the connection must be in the format: prefix.*bookkeeper.* or prefix.*client.*.
Definition at line 126 of file notification_interface.hpp.
| bool dunedaq::snbmodules::NotificationInterface::send_notification | ( | const notification_type::e_notification_type & | notif, |
| const std::string & | src, | ||
| const std::string & | dst, | ||
| const std::string & | id_conn, | ||
| const std::string & | data = "", | ||
| int | tries = -1 ) |
Send a notification during m_timeout_send ms.
| notif | Type of the notification |
| src | name of the source or uuid of the connection |
| dst | name of the destination or uuid of the connection |
| id_conn | ID of the connection |
| data | Data of the notification (optional) |
Definition at line 57 of file notification_interface.cpp.
|
private |
List of bookkeepers connections.
Definition at line 194 of file notification_interface.hpp.
|
private |
List of clients connections.
Definition at line 196 of file notification_interface.hpp.
|
private |
Prefix for the connection name.
Definition at line 203 of file notification_interface.hpp.
|
private |
Definition at line 205 of file notification_interface.hpp.
|
private |
Timeout for receiving a notification in ms.
Definition at line 201 of file notification_interface.hpp.
|
private |
Timeout for sending a notification in ms.
Definition at line 199 of file notification_interface.hpp.