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_uri_for_connection (const confmodel::NetworkConnection *netCon)
 

Typedef Documentation

◆ FollyMPMCQueue

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

Definition at line 99 of file FollyQueue.hpp.

◆ FollySPSCQueue

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

Definition at line 96 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_uri_for_connection()

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

Definition at line 97 of file SchemaUtils.hpp.

98{
99 std::string uri = "";
100 if (netCon) {
101 TLOG_DEBUG(45) << "Getting URI for network connection " << netCon->UID();
102 auto service = netCon->get_associated_service();
103 if (service->get_protocol() == "tcp") {
104
105 std::string port = "*";
106 if (service->get_port() && service->get_port() != 0) {
107 port = std::to_string(service->get_port());
108 }
109 std::string ipaddr = "0.0.0.0";
110 char hostname[256];
111 if (gethostname(&hostname[0], 256) == 0) {
112 ipaddr = std::string(hostname);
113 }
114 auto iface = service->get_eth_device_name();
115 if (iface != "") {
116 // Work out which ip address goes with this device
117 struct ifaddrs* ifaddr;
118 getifaddrs(&ifaddr);
119 for (auto ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
120 if (ifa->ifa_addr == NULL) {
121 continue;
122 }
123 if (std::string(ifa->ifa_name) == iface) {
124 char ip[NI_MAXHOST];
125 int status =
126 getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), ip, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
127 if (status != 0) {
128 continue;
129 }
130 ipaddr = std::string(ip);
131 break;
132 }
133 }
134 freeifaddrs(ifaddr);
135 }
136 uri = std::string(service->get_protocol() + "://" + ipaddr + ":" + port);
137 } else if (service->get_protocol() == "inproc") {
138 uri = std::string(service->get_protocol() + "://" + service->get_path());
139 }
140 }
141 return uri;
142}
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 112 of file ConfigClientStructs.hpp.

114{
115 if (l.data_type == r.data_type) {
116 return l.uid < r.uid;
117 }
118 return l.data_type < r.data_type;
119}

◆ 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}