From f367db9ba86d759430288b16a0e0d4f82fbefc95 Mon Sep 17 00:00:00 2001 From: Jojo-1000 <33495614+Jojo-1000@users.noreply.github.com> Date: Sat, 13 Mar 2021 22:02:48 +0100 Subject: [PATCH] Update documentation after review. --- include/hueplusplus/BaseDevice.h | 4 ++++ include/hueplusplus/Bridge.h | 1 + include/hueplusplus/BridgeConfig.h | 1 + include/hueplusplus/Group.h | 4 ++++ include/hueplusplus/HueDeviceTypes.h | 1 + include/hueplusplus/Light.h | 10 ++++++++-- include/hueplusplus/ResourceList.h | 4 +--- include/hueplusplus/Rule.h | 1 + include/hueplusplus/Scene.h | 1 + include/hueplusplus/Schedule.h | 1 + include/hueplusplus/Sensor.h | 3 +++ 11 files changed, 26 insertions(+), 5 deletions(-) diff --git a/include/hueplusplus/BaseDevice.h b/include/hueplusplus/BaseDevice.h index 09feed6..8ab2ea1 100644 --- a/include/hueplusplus/BaseDevice.h +++ b/include/hueplusplus/BaseDevice.h @@ -120,9 +120,13 @@ public: virtual void refresh(bool force = false); //! \brief Sets custom refresh interval for this device. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. virtual void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); protected: + //! \brief Protected ctor that is used by subclasses, construct with shared cache. + //! \param id Integer that specifies the id of this device + //! \param baseCache Cache of the ResourceList containing this device (must not be null). BaseDevice(int id, const std::shared_ptr& baseCache); //! \brief Protected ctor that is used by subclasses. //! diff --git a/include/hueplusplus/Bridge.h b/include/hueplusplus/Bridge.h index cb268c6..e754fbf 100644 --- a/include/hueplusplus/Bridge.h +++ b/include/hueplusplus/Bridge.h @@ -164,6 +164,7 @@ public: void refresh(); //! \brief Sets refresh interval for the whole bridge state. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); //! \brief Function to get the ip address of the hue bridge diff --git a/include/hueplusplus/BridgeConfig.h b/include/hueplusplus/BridgeConfig.h index 40227b7..664a7da 100644 --- a/include/hueplusplus/BridgeConfig.h +++ b/include/hueplusplus/BridgeConfig.h @@ -68,6 +68,7 @@ public: void refresh(bool force = false); //! \brief Sets custom refresh interval for the config. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); //! \brief Get the list of whitelisted users diff --git a/include/hueplusplus/Group.h b/include/hueplusplus/Group.h index 6b2eb5f..f0c929b 100644 --- a/include/hueplusplus/Group.h +++ b/include/hueplusplus/Group.h @@ -41,6 +41,9 @@ namespace hueplusplus class Group { public: + //! \brief Creates group with shared cache + //! \param id Group id in the bridge + //! \param baseCache Cache of the group list. Group(int id, const std::shared_ptr& baseCache); //! \brief Creates group with id //! \param id Group id in the bridge @@ -59,6 +62,7 @@ public: void refresh(bool force = false); //! \brief Sets custom refresh interval for this group. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); //! \name General information diff --git a/include/hueplusplus/HueDeviceTypes.h b/include/hueplusplus/HueDeviceTypes.h index 3009a72..74ba305 100644 --- a/include/hueplusplus/HueDeviceTypes.h +++ b/include/hueplusplus/HueDeviceTypes.h @@ -41,6 +41,7 @@ public: //! \brief Create a Light with the correct type from the JSON state. //! \param lightState Light JSON as returned from the bridge (not only the "state" part of it). //! \param id Light id. + //! \param baseCache Optional shared cache for the light. //! \returns Light with matching id, strategies and \ref ColorType. //! \throws std::system_error when system or socket operations fail //! \throws HueException when light type is unknown diff --git a/include/hueplusplus/Light.h b/include/hueplusplus/Light.h index 8072bfc..b4822b5 100644 --- a/include/hueplusplus/Light.h +++ b/include/hueplusplus/Light.h @@ -554,7 +554,7 @@ public: ///@} protected: - //! \brief Protected ctor that is used by \ref Bridge class. + //! \brief Protected ctor that is used by \ref LightFactory. //! //! \param id Integer that specifies the id of this light //! \param commands HueCommandAPI for communication with the bridge @@ -562,9 +562,15 @@ protected: //! leaves strategies unset Light(int id, const HueCommandAPI& commands); + //! \brief Protected ctor that is used by \ref LightFactory. + //! + //! \param id Integer that specifies the id of this light + //! \param baseCache Cache of the light list (must not be null). + //! + //! leaves strategies unset Light(int id, const std::shared_ptr& baseCache); - //! \brief Protected ctor that is used by \ref Bridge class, also sets + //! \brief Protected ctor that is used by \ref LightFactory, also sets //! strategies. //! //! \param id Integer that specifies the id of this light diff --git a/include/hueplusplus/ResourceList.h b/include/hueplusplus/ResourceList.h index f97d1f9..d61d3a8 100644 --- a/include/hueplusplus/ResourceList.h +++ b/include/hueplusplus/ResourceList.h @@ -46,9 +46,6 @@ template class ResourceList { public: - struct SharedStateTag - { }; - using ResourceType = Resource; using IdType = IdT; static_assert(std::is_integral::value || std::is_same::value, @@ -95,6 +92,7 @@ public: void refresh() { stateCache->refresh(); } //! \brief Sets custom refresh interval for this list and all resources created. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration) { stateCache->setRefreshDuration(refreshDuration); diff --git a/include/hueplusplus/Rule.h b/include/hueplusplus/Rule.h index 157e9f3..518f8fd 100644 --- a/include/hueplusplus/Rule.h +++ b/include/hueplusplus/Rule.h @@ -59,6 +59,7 @@ public: void refresh(bool force = false); //! \brief Sets custom refresh interval for this rule. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); //! \brief Get rule identifier diff --git a/include/hueplusplus/Scene.h b/include/hueplusplus/Scene.h index 81185d6..162cf3b 100644 --- a/include/hueplusplus/Scene.h +++ b/include/hueplusplus/Scene.h @@ -140,6 +140,7 @@ public: void refresh(bool force = false); //! \brief Sets custom refresh interval for this group. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); //! \brief Get scene identifier diff --git a/include/hueplusplus/Schedule.h b/include/hueplusplus/Schedule.h index 6941629..f272002 100644 --- a/include/hueplusplus/Schedule.h +++ b/include/hueplusplus/Schedule.h @@ -49,6 +49,7 @@ public: void refresh(); //! \brief Sets custom refresh interval for this schedule. + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever. void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); //! \brief Get schedule identifier diff --git a/include/hueplusplus/Sensor.h b/include/hueplusplus/Sensor.h index ea1587f..d0104a3 100644 --- a/include/hueplusplus/Sensor.h +++ b/include/hueplusplus/Sensor.h @@ -59,6 +59,9 @@ Alert alertFromString(const std::string& s); class Sensor : public BaseDevice { public: + //! \brief Construct Sensor with shared cache + //! \param id Integer that specifies the id of this sensor + //! \param baseCache Cache of the SensorList. Sensor(int id, const std::shared_ptr& baseCache); //! \brief Construct Sensor. -- libgit2 0.21.4