DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::iomanager Namespace Reference

Namespaces

namespace  opmon
 

Classes

class  ConfigClient
 
struct  ConnectionId
 
struct  ConnectionInfo
 
struct  ConnectionRegistration
 
struct  ConnectionRequest
 
struct  ConnectionResponse
 
class  FollyQueue
 
class  IOManager
 
class  NetworkManager
 
class  NetworkReceiverModel
 
class  NetworkSenderModel
 
class  Queue
 Implementations of the Queue class are responsible for relaying data between DAQModules within a DAQ Application. More...
 
class  QueueBase
 The QueueBase class allows to address generic behavior of any Queue implementation. More...
 
class  QueueReceiverModel
 
class  QueueRegistry
 The QueueRegistry class manages all Queue instances and gives out handles to the Queues upon request. More...
 
class  QueueSenderModel
 
class  Receiver
 
class  ReceiverConcept
 
class  Sender
 
class  SenderConcept
 
class  StdDeQueue
 A Queue Implementation that uses a std::deque as its backend. More...
 

Typedefs

template<typename T >
using FollySPSCQueue = FollyQueue<T, folly::DSPSCQueue>
 
template<typename T >
using FollyMPMCQueue = FollyQueue<T, folly::DMPMCQueue>
 

Enumerations

enum class  ConnectionType : int { kSendRecv = 0 , kPubSub = 1 , kInvalid = 2 }
 

Functions

ConnectionType string_to_connection_type_enum (std::string type)
 
bool operator< (ConnectionRegistration const &l, ConnectionRegistration const &r)
 
bool operator< (ConnectionId const &l, ConnectionId const &r)
 
bool operator== (ConnectionId const &l, ConnectionId const &r)
 
bool is_match (ConnectionId const &search, ConnectionId const &check)
 
std::string to_string (const ConnectionId &conn_id)
 
std::string get_host_ip (std::string eth_device_name)
 
std::string get_uri_for_connection (const confmodel::NetworkConnection *netCon)
 

Typedef Documentation

◆ FollyMPMCQueue

template<typename T >
using dunedaq::iomanager::FollyMPMCQueue = FollyQueue<T, folly::DMPMCQueue>

Definition at line 100 of file FollyQueue.hpp.

◆ FollySPSCQueue

template<typename T >
using dunedaq::iomanager::FollySPSCQueue = FollyQueue<T, folly::DSPSCQueue>

Definition at line 97 of file FollyQueue.hpp.

Enumeration Type Documentation

◆ ConnectionType

enum class dunedaq::iomanager::ConnectionType : int
strong
Enumerator
kSendRecv 
kPubSub 
kInvalid 

Definition at line 20 of file ConfigClientStructs.hpp.

Function Documentation

◆ get_host_ip()

std::string dunedaq::iomanager::get_host_ip ( std::string eth_device_name)
inline

Definition at line 97 of file SchemaUtils.hpp.

98{
99 std::string ipaddr = "0.0.0.0";
100 char hostname[NI_MAXHOST]; // NOLINT This is a char array for interfacing with the C networking API
101 if (gethostname(&hostname[0], NI_MAXHOST) == 0) {
102 ipaddr = std::string(hostname);
103 }
104 if (eth_device_name != "") {
105 // Work out which ip address goes with this device
106 struct ifaddrs* ifaddr = nullptr;
107 getifaddrs(&ifaddr);
108
109 for (auto ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) {
110 if (ifa->ifa_addr == nullptr || std::string(ifa->ifa_name) != eth_device_name) {
111 continue;
112 }
113
114 char ip[NI_MAXHOST]; // NOLINT This is a char array for interfacing with the C networking API
115 int status = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), ip, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST);
116 if (status != 0) {
117 continue;
118 }
119 ipaddr = std::string(ip);
120 break;
121 }
122 freeifaddrs(ifaddr);
123 }
124 return ipaddr;
125}

◆ get_uri_for_connection()

std::string dunedaq::iomanager::get_uri_for_connection ( const confmodel::NetworkConnection * netCon)
inline

Definition at line 128 of file SchemaUtils.hpp.

129{
130 std::string uri = "";
131 if (netCon) {
132 TLOG_DEBUG(45) << "Getting URI for network connection " << netCon->UID();
133 auto service = netCon->get_associated_service();
134 auto protocol = service->get_protocol();
135 if (protocol == "tcp") {
136
137 std::string port = "*";
138 if (service->get_port() && service->get_port() != 0) {
139 port = std::to_string(service->get_port());
140 }
141 auto iface = service->get_eth_device_name();
142 uri = std::string(service->get_protocol() + "://" + get_host_ip(iface) + ":" + port);
143 } else if (protocol == "inproc") {
144 uri = std::string(service->get_protocol() + "://" + service->get_path());
145 }
146 }
147 return uri;
148}
const std::string & UID() const noexcept
const dunedaq::confmodel::Service * get_associated_service() const
Get "associated_service" relationship value. Service provided by this connection.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
Unsupported std::string uri Execution of command std::string error Failed to create CommandFacility uri
Definition Issues.hpp:77

◆ is_match()

bool dunedaq::iomanager::is_match ( ConnectionId const & search,
ConnectionId const & check )
inline

Definition at line 74 of file SchemaUtils.hpp.

75{
76 if (search.data_type != check.data_type)
77 return false;
78
79 if (search.session != check.session && search.session != "" && check.session != "")
80 return false;
81
82 std::regex search_ex(search.uid);
83 return std::regex_match(check.uid, search_ex);
84}
static void check(std::vector< conffwk::ConfigurationChange * > &changes, const InheritanceData &inheritance, const std::set< std::string > &class_names, const OksConfiguration::SMap &objects, const std::string &obj_class, const std::string &obj_id, const char action)

◆ operator<() [1/2]

bool dunedaq::iomanager::operator< ( ConnectionId const & l,
ConnectionId const & r )
inline

Definition at line 52 of file SchemaUtils.hpp.

54{
55 if (l.session == r.session || l.session == "" || r.session == "") {
56 if (l.data_type == r.data_type) {
57 if (l.uid == r.uid) {
58 return l.tag < r.tag;
59 }
60 return l.uid < r.uid;
61 }
62 return l.data_type < r.data_type;
63 }
64 return l.session < r.session;
65}

◆ operator<() [2/2]

bool dunedaq::iomanager::operator< ( ConnectionRegistration const & l,
ConnectionRegistration const & r )
inline

Definition at line 117 of file ConfigClientStructs.hpp.

119{
120 if (l.data_type == r.data_type) {
121 return l.uid < r.uid;
122 }
123 return l.data_type < r.data_type;
124}

◆ operator==()

bool dunedaq::iomanager::operator== ( ConnectionId const & l,
ConnectionId const & r )
inline

Definition at line 67 of file SchemaUtils.hpp.

68{
69 return (l.session == "" || r.session == "" || l.session == r.session) && l.uid == r.uid && l.tag == r.tag &&
70 l.data_type == r.data_type;
71}

◆ string_to_connection_type_enum()

ConnectionType dunedaq::iomanager::string_to_connection_type_enum ( std::string type)
inline

Definition at line 28 of file ConfigClientStructs.hpp.

29{
30 if (type == confmodel::NetworkConnection::Connection_type::KPubSub)
31 return ConnectionType::kPubSub;
32 if (type == confmodel::NetworkConnection::Connection_type::KSendRecv)
33 return ConnectionType::kSendRecv;
34
35 return ConnectionType::kInvalid;
36}

◆ to_string()

std::string dunedaq::iomanager::to_string ( const ConnectionId & conn_id)
inline

Definition at line 87 of file SchemaUtils.hpp.

88{
89 if (conn_id.session != "") {
90 return conn_id.session + "/" + conn_id.uid + (conn_id.tag != "" ? "+" + conn_id.tag : "") + "@@" +
91 conn_id.data_type;
92 }
93 return conn_id.uid + (conn_id.tag != "" ? "+" + conn_id.tag : "") + "@@" + conn_id.data_type;
94}