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
 
MonitorableObjectoperator= (const MonitorableObject &)=delete
 
 MonitorableObject (MonitorableObject &&)=delete
 
MonitorableObjectoperator= (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 193 of file MonitorableObject.hpp.

Member Function Documentation

◆ register_node()

void MonitorableObject::register_node ( ElementId name,
NewNodePtr p )

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

Definition at line 113 of file MonitorableObject.cpp.

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

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