DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::opmonlib::OpMonLink Class Reference

#include <MonitorableObject.hpp>

Inheritance diagram for dunedaq::opmonlib::OpMonLink:
[legend]
Collaboration diagram for dunedaq::opmonlib::OpMonLink:
[legend]

Public Member Functions

void register_node (ElementId name, NewNodePtr)
Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject (const MonitorableObject &)=delete
MonitorableObject & operator= (const MonitorableObject &)=delete
 MonitorableObject (MonitorableObject &&)=delete
MonitorableObject & operator= (MonitorableObject &&)=delete
virtual ~MonitorableObject ()=default
auto get_opmon_id () const noexcept
auto get_opmon_level () const noexcept

Additional Inherited Members

Public Types inherited from dunedaq::opmonlib::MonitorableObject
using NodePtr = std::weak_ptr<MonitorableObject>
using NewNodePtr = std::shared_ptr<MonitorableObject>
using ElementId = std::string
Static Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
static bool publishable_metric (OpMonLevel entry, OpMonLevel system) noexcept
Protected Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject ()=default
void register_node (ElementId name, NewNodePtr)
void publish (google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
virtual void generate_opmon_data ()

Detailed Description

Definition at line 186 of file MonitorableObject.hpp.

Member Function Documentation

◆ register_node()

Append a register object to the chain The children will be modified using information from the this parent

Definition at line 106 of file MonitorableObject.cpp.

34{
35
36 std::lock_guard<std::mutex> lock(m_node_mutex);
37
38 // check if the name is already present to ensure uniqueness
39 auto it = m_nodes.find(name);
40 if (it != m_nodes.end()) {
41 // This not desired because names are suppposed to be unique
42 // But if the pointer is expired, there is no harm in override it
43 if (it->second.expired()) {
44 ers::warning(NonUniqueNodeName(ERS_HERE, name, to_string(get_opmon_id())));
45 } else {
46 throw NonUniqueNodeName(ERS_HERE, name, to_string(get_opmon_id()));
47 }
48 }
49
50 m_nodes[name] = p;
51
52 p->m_opmon_name = name;
53 p->inherit_parent_properties(*this);
54
55 TLOG() << "Node " << name << " registered to " << to_string(get_opmon_id());
56}
#define ERS_HERE
std::map< ElementId, NodePtr > m_nodes
#define TLOG(...)
Definition macro.hpp:21
std::string to_string(const dunedaq::opmon::OpMonId &)
Definition Utils.cpp:166
void warning(const Issue &issue)
Definition ers.hpp:150

The documentation for this class was generated from the following file: