diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2017-04-17 12:22:50 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-05-15 16:58:22 -0400 |
commit | c5736432ac09d19cd0e513e11082a7637a196829 (patch) | |
tree | 913b2ca0f861f74a7effdd4d6999b4ab569c0ddb /src/functor.hpp | |
parent | b0b82be89c328ff8205821803592ba08963464ee (diff) | |
download | phosphor-dbus-monitor-c5736432ac09d19cd0e513e11082a7637a196829.tar.gz phosphor-dbus-monitor-c5736432ac09d19cd0e513e11082a7637a196829.zip |
Documentation only, no functional change
Added copyrights and comments within headers
Change-Id: Iebb17ba34b82a6c80718ad32338105a5245e640c
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'src/functor.hpp')
-rw-r--r-- | src/functor.hpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/functor.hpp b/src/functor.hpp index b3ad9a0..3faf39b 100644 --- a/src/functor.hpp +++ b/src/functor.hpp @@ -11,18 +11,39 @@ namespace monitoring class Monitor; +/** + * @brief Create a condition function object + * + * @param[in] condition - The condition being created + * + * @return - The created condition function object + */ template <typename T> auto make_condition(T&& condition) { return Condition(std::forward<T>(condition)); } +/** + * @brief Create an action function object + * + * @param[in] action - The action being created + * + * @return - The created action function object + */ template <typename T> auto make_action(T&& action) { return Action(std::forward<T>(action)); } +/** + * @struct Property Changed Condtion + * @brief A match filter functor to test Dbus property value changed signals + * + * @tparam T - The type of the property value + * @tparam U - The type of the condition + */ template <typename T, typename U> struct PropertyChangedCondition { @@ -76,6 +97,12 @@ private: U _condition; }; +/** + * @struct Property Condition Base + * @brief A match filter functor to test property values + * @details The base property condition struct that retrieves the property value + * for a property condition + */ struct PropertyConditionBase { PropertyConditionBase() = delete; @@ -128,6 +155,13 @@ private: const char* _service; }; +/** + * @struct Property Condtion + * @brief A match filter functor to test property values + * + * @tparam T - The type of the property value + * @tparam U - The type of the condition + */ template <typename T, typename U> struct PropertyCondition final : public PropertyConditionBase { @@ -177,6 +211,16 @@ private: U _condition; }; +/** + * @brief Used to process a Dbus property changed signal event + * + * @param[in] iface - Item value interface + * @param[in] property - Item value property + * @param[in] condition - Condition function to perform + * + * @tparam T - The type of the property + * @tparam U - The type of the condition + */ template <typename T, typename U> auto propertySignal(const char* iface, const char* property, @@ -187,6 +231,18 @@ auto propertySignal(const char* iface, std::move(condition)); } +/** + * @brief Used to process conditions on a start event + * + * @param[in] path - Item's Dbus path + * @param[in] iface - Item value interface + * @param[in] property - Item value property + * @param[in] condition - Condition function to perform + * @param[in] service - Service to lookup Dbus object + * + * @tparam T - The type of the property + * @tparam U - The type of the condition + */ template <typename T, typename U> auto propertyStart(const char* path, const char* iface, |