RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
alertServiceIf.hpp
Go to the documentation of this file.
1
12#ifndef RTCTK_COMPONENTFRAMEWORK_ALERTSERVICEIF_HPP
13#define RTCTK_COMPONENTFRAMEWORK_ALERTSERVICEIF_HPP
14
15#include <string>
16
18
20
27public:
28 explicit AlertConflictException(const std::string& id);
29};
30
31class AlertStatus;
32
48public:
50 AlertSource(AlertStatus& status, const std::string& id, const std::string& desc);
51
56
60 AlertSource(const AlertSource& other) = delete;
62
68 AlertSource(AlertSource&& other) noexcept = default;
69
75 AlertSource& operator=(AlertSource&& other) noexcept = default;
76
86 void Set(bool state = true);
87
95 void Clear();
96
102 bool IsSet();
103
104private:
105 AlertStatus* m_status;
106 std::string m_id;
107};
108
129public:
130 virtual ~AlertServiceIf() = default;
131
142 virtual AlertSource MakeAlertSource(const std::string& id, const std::string& text) = 0;
143
149 virtual bool GetStatus() = 0;
150
154 virtual void ClearAll() = 0;
155};
156
157} // namespace rtctk::componentFramework
158
159#endif // RTCTK_COMPONENTFRAMEWORK_ALERTSERVICEIF_HPP
Exception indicating that an alert conflicts with already known alert.
Definition alertServiceIf.hpp:26
AlertConflictException(const std::string &id)
Definition alertService.cpp:27
Alert Service interface.
Definition alertServiceIf.hpp:128
virtual void ClearAll()=0
Clears all active alerts.
virtual bool GetStatus()=0
Returns the overall alert status.
virtual AlertSource MakeAlertSource(const std::string &id, const std::string &text)=0
Creates a new alert source for a specified alert condition.
Models a single alert source that can be set or cleared.
Definition alertServiceIf.hpp:47
void Set(bool state=true)
Set alert status state.
Definition alertService.cpp:178
void Clear()
Clear alert.
Definition alertService.cpp:182
AlertSource()
Definition alertService.cpp:166
~AlertSource()
Resets alert.
Definition alertService.cpp:169
AlertSource(const AlertSource &other)=delete
No copy of alert sources allowed, they must be moved.
bool IsSet()
Query alert status.
Definition alertService.cpp:186
AlertSource & operator=(AlertSource &&other) noexcept=default
Move assigns from other to this object.
AlertSource & operator=(const AlertSource &other)=delete
AlertSource(AlertSource &&other) noexcept=default
Move constructs from other to this object.
Definition alertService.hpp:107
The RtctkException class is the base class for all Rtctk exceptions.
Definition exceptions.hpp:211
Provides macros and utilities for exception handling.
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23