Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::event_handler< EventType > Class Template Reference

Type-safe event handler wrapper. More...

#include <event_bus_interface.h>

Collaboration diagram for kcenon::monitoring::event_handler< EventType >:
Collaboration graph

Public Types

using handler_func = std::function<void(const EventType&)>
 

Public Member Functions

 event_handler (handler_func handler, event_priority priority=event_priority::normal)
 
void operator() (const EventType &event) const
 
event_priority get_priority () const
 
uint64_t get_id () const
 

Static Private Member Functions

static uint64_t generate_id ()
 

Private Attributes

handler_func handler_
 
event_priority priority_
 
uint64_t id_
 

Detailed Description

template<typename EventType>
class kcenon::monitoring::event_handler< EventType >

Type-safe event handler wrapper.

Definition at line 163 of file event_bus_interface.h.

Member Typedef Documentation

◆ handler_func

template<typename EventType >
using kcenon::monitoring::event_handler< EventType >::handler_func = std::function<void(const EventType&)>

Constructor & Destructor Documentation

◆ event_handler()

Member Function Documentation

◆ generate_id()

template<typename EventType >
static uint64_t kcenon::monitoring::event_handler< EventType >::generate_id ( )
inlinestaticprivate
Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/interfaces/event_bus_interface.h.

Definition at line 180 of file event_bus_interface.h.

180 {
181 static std::atomic<uint64_t> counter{0};
182 return counter.fetch_add(1, std::memory_order_relaxed);
183 }
@ counter
Monotonically increasing counter.

References kcenon::monitoring::counter.

◆ get_id()

◆ get_priority()

◆ operator()()

template<typename EventType >
void kcenon::monitoring::event_handler< EventType >::operator() ( const EventType & event) const
inline

Member Data Documentation

◆ handler_

◆ id_

◆ priority_


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