diff options
Diffstat (limited to 'src/events.hpp')
-rw-r--r-- | src/events.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/events.hpp b/src/events.hpp index b6de8de..684a0a8 100644 --- a/src/events.hpp +++ b/src/events.hpp @@ -9,9 +9,17 @@ namespace dbus namespace monitoring { +/** + * @class Event + * @brief An item monitoring triggered event + * @details An event with an associated list of conditions to check + */ class Event : public std::vector<Condition> { public: + /** + * @brief Types of triggers of the event + */ enum class Trigger { START, @@ -25,6 +33,12 @@ class Event : public std::vector<Condition> Event& operator=(Event&&) = delete; virtual ~Event() = default; + /** + * @brief Constructs an event with given conditions and trigger + * + * @param[in] conditions - Conditions for the event + * @param[in] t - Type of trigger of the event + */ Event(const std::vector<Condition>& conditions, Trigger t) : std::vector<Condition>(conditions), @@ -33,6 +47,7 @@ class Event : public std::vector<Condition> // Nothing to do here } + /** @brief Event trigger type */ Trigger trigger; }; @@ -46,6 +61,11 @@ class StartEvent : public Event StartEvent& operator=(StartEvent&&) = delete; ~StartEvent() = default; + /** + * @brief Constructs a derived application started event + * + * @param[in] conditions - Conditions for the event + */ explicit StartEvent(const std::vector<Condition>& conditions) : Event(conditions, Trigger::START) { @@ -63,6 +83,12 @@ class SignalEvent : public Event SignalEvent& operator=(SignalEvent&&) = delete; ~SignalEvent() = default; + /** + * @brief Constructs a derived Dbus signal event + * + * @param[in] signature - Dbus object signature + * @param[in] conditions - Conditions for the event + */ SignalEvent(const char* signature, const std::vector<Condition>& conditions) : Event(conditions, Trigger::SIGNAL), @@ -71,6 +97,7 @@ class SignalEvent : public Event // Nothing to do here } + /** @brief Dbus object signature */ const char* signature; }; |