Go to the documentation of this file.
11 #ifndef RTCTK_COMPONENTFRAMEWORK_ALERTSERVICEIF_HPP
12 #define RTCTK_COMPONENTFRAMEWORK_ALERTSERVICEIF_HPP
15 #include <sys/types.h>
17 #include <boost/signals2/signal.hpp>
68 using TimePoint = std::chrono::system_clock::time_point;
107 return {m_state, m_since};
125 boost::signals2::connection
Connect(Signal::slot_type
const& slot);
152 explicit AlertDescription(std::string
id, std::string description) noexcept;
157 std::string
const&
GetId() const noexcept {
165 return m_description;
170 std::string m_description;
263 virtual boost::signals2::connection
312 #endif // RTCTK_COMPONENTFRAMEWORK_ALERTSERVICEIF_HPP
Provides macros and utilities for exception handling.
bool IsSet() const noexcept
Query alert status.
Definition: alertServiceIf.hpp:97
std::string const & GetId() const noexcept
Definition: alertServiceIf.hpp:157
RtctkException() noexcept
Definition: exceptions.cpp:99
std::chrono::system_clock::time_point TimePoint
Timestamp type used throughout AlertServiceIf.
Definition: alertServiceIf.hpp:214
Models a single alert source that can be set or cleared.
Definition: alertServiceIf.hpp:42
Definition: commandReplier.cpp:20
virtual ~AlertStatusObserverIf() noexcept=default
Interface to create AlertSource.
Definition: alertServiceIf.hpp:179
The RtctkException class is the base class for all Rtctk exceptions.
Definition: exceptions.hpp:207
boost::signals2::signal< void(bool, TimePoint)> Signal
Signal type emitted on rising and falling alert status flanks.
Definition: alertServiceIf.hpp:117
virtual boost::signals2::connection ConnectReducedStatus(ReducedStatusSignal::slot_type slot)=0
Connects a slot to the reduced alert signal.
virtual ~AlertSourceFactoryIf() noexcept=default
TimePoint since
Time point when status was first set.
Definition: alertServiceIf.hpp:228
Interface to observe alert status.
Definition: alertServiceIf.hpp:198
std::chrono::system_clock::time_point TimePoint
Timestamp type.
Definition: alertServiceIf.hpp:68
boost::signals2::signal< void(ReducedStatus const &, std::vector< AlertStatus > const &)> ReducedStatusSignal
Signal emitted for every change in reduced alert status.
Definition: alertServiceIf.hpp:253
std::pair< bool, TimePoint > GetStatus() const noexcept
Get current status with timestamp of the time the state was last changed.
Definition: alertServiceIf.hpp:106
virtual std::vector< AlertStatus > GetAlertStatuses() const =0
Get status of all alert conditions.
Uniquely describes an alert.
Definition: alertServiceIf.hpp:145
AlertSource & operator=(AlertSource &&other) noexcept
Move assigns from other to this object.
Definition: alertServiceIf.cpp:23
Alert Service interface.
Definition: alertServiceIf.hpp:303
Structure describing an alert condition with status from the corresponding AlertSource.
Definition: alertServiceIf.hpp:219
void Reset()
Clear alert.
Definition: alertServiceIf.hpp:77
Exception indicating that a metric such as counter or thread conflicts with already known metrics.
Definition: alertServiceIf.hpp:27
bool status
Status of an alert.
Definition: alertServiceIf.hpp:223
Definition: mudpiProcessingError.hpp:119
virtual AlertSource MakeAlertSource(AlertDescription const &description)=0
Creates a new alert source for the specified alert condition.
boost::signals2::connection Connect(Signal::slot_type const &slot)
Connect slot to signal.
Definition: alertServiceIf.cpp:51
~AlertSource() noexcept
Resets alert.
Definition: alertServiceIf.cpp:32
virtual ~AlertServiceIf() noexcept=default
AlertSource()
Definition: alertServiceIf.cpp:15
AlertDescription description
Information describing the alert.
Definition: alertServiceIf.hpp:233
void Set(bool state=true)
Set alert status state.
Definition: alertServiceIf.cpp:42
std::string const & GetDescription() const noexcept
Definition: alertServiceIf.hpp:164
AlertDescription(std::string id, std::string description) noexcept
Construct instance.
Definition: alertServiceIf.cpp:55
virtual ReducedStatus GetReducedStatus() const =0
Get the reduced status.
std::optional< bool > ReducedStatus
Represents current alert status.
Definition: alertServiceIf.hpp:209