Commit f367db9ba86d759430288b16a0e0d4f82fbefc95

Authored by Jojo-1000
Committed by Moritz Wirger
1 parent b74756e3

Update documentation after review.

include/hueplusplus/BaseDevice.h
@@ -120,9 +120,13 @@ public: @@ -120,9 +120,13 @@ public:
120 virtual void refresh(bool force = false); 120 virtual void refresh(bool force = false);
121 121
122 //! \brief Sets custom refresh interval for this device. 122 //! \brief Sets custom refresh interval for this device.
  123 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
123 virtual void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); 124 virtual void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
124 125
125 protected: 126 protected:
  127 + //! \brief Protected ctor that is used by subclasses, construct with shared cache.
  128 + //! \param id Integer that specifies the id of this device
  129 + //! \param baseCache Cache of the ResourceList containing this device (must not be null).
126 BaseDevice(int id, const std::shared_ptr<APICache>& baseCache); 130 BaseDevice(int id, const std::shared_ptr<APICache>& baseCache);
127 //! \brief Protected ctor that is used by subclasses. 131 //! \brief Protected ctor that is used by subclasses.
128 //! 132 //!
include/hueplusplus/Bridge.h
@@ -164,6 +164,7 @@ public: @@ -164,6 +164,7 @@ public:
164 void refresh(); 164 void refresh();
165 165
166 //! \brief Sets refresh interval for the whole bridge state. 166 //! \brief Sets refresh interval for the whole bridge state.
  167 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
167 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); 168 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
168 169
169 //! \brief Function to get the ip address of the hue bridge 170 //! \brief Function to get the ip address of the hue bridge
include/hueplusplus/BridgeConfig.h
@@ -68,6 +68,7 @@ public: @@ -68,6 +68,7 @@ public:
68 void refresh(bool force = false); 68 void refresh(bool force = false);
69 69
70 //! \brief Sets custom refresh interval for the config. 70 //! \brief Sets custom refresh interval for the config.
  71 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
71 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); 72 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
72 73
73 //! \brief Get the list of whitelisted users 74 //! \brief Get the list of whitelisted users
include/hueplusplus/Group.h
@@ -41,6 +41,9 @@ namespace hueplusplus @@ -41,6 +41,9 @@ namespace hueplusplus
41 class Group 41 class Group
42 { 42 {
43 public: 43 public:
  44 + //! \brief Creates group with shared cache
  45 + //! \param id Group id in the bridge
  46 + //! \param baseCache Cache of the group list.
44 Group(int id, const std::shared_ptr<APICache>& baseCache); 47 Group(int id, const std::shared_ptr<APICache>& baseCache);
45 //! \brief Creates group with id 48 //! \brief Creates group with id
46 //! \param id Group id in the bridge 49 //! \param id Group id in the bridge
@@ -59,6 +62,7 @@ public: @@ -59,6 +62,7 @@ public:
59 void refresh(bool force = false); 62 void refresh(bool force = false);
60 63
61 //! \brief Sets custom refresh interval for this group. 64 //! \brief Sets custom refresh interval for this group.
  65 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
62 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); 66 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
63 67
64 //! \name General information 68 //! \name General information
include/hueplusplus/HueDeviceTypes.h
@@ -41,6 +41,7 @@ public: @@ -41,6 +41,7 @@ public:
41 //! \brief Create a Light with the correct type from the JSON state. 41 //! \brief Create a Light with the correct type from the JSON state.
42 //! \param lightState Light JSON as returned from the bridge (not only the "state" part of it). 42 //! \param lightState Light JSON as returned from the bridge (not only the "state" part of it).
43 //! \param id Light id. 43 //! \param id Light id.
  44 + //! \param baseCache Optional shared cache for the light.
44 //! \returns Light with matching id, strategies and \ref ColorType. 45 //! \returns Light with matching id, strategies and \ref ColorType.
45 //! \throws std::system_error when system or socket operations fail 46 //! \throws std::system_error when system or socket operations fail
46 //! \throws HueException when light type is unknown 47 //! \throws HueException when light type is unknown
include/hueplusplus/Light.h
@@ -554,7 +554,7 @@ public: @@ -554,7 +554,7 @@ public:
554 ///@} 554 ///@}
555 555
556 protected: 556 protected:
557 - //! \brief Protected ctor that is used by \ref Bridge class. 557 + //! \brief Protected ctor that is used by \ref LightFactory.
558 //! 558 //!
559 //! \param id Integer that specifies the id of this light 559 //! \param id Integer that specifies the id of this light
560 //! \param commands HueCommandAPI for communication with the bridge 560 //! \param commands HueCommandAPI for communication with the bridge
@@ -562,9 +562,15 @@ protected: @@ -562,9 +562,15 @@ protected:
562 //! leaves strategies unset 562 //! leaves strategies unset
563 Light(int id, const HueCommandAPI& commands); 563 Light(int id, const HueCommandAPI& commands);
564 564
  565 + //! \brief Protected ctor that is used by \ref LightFactory.
  566 + //!
  567 + //! \param id Integer that specifies the id of this light
  568 + //! \param baseCache Cache of the light list (must not be null).
  569 + //!
  570 + //! leaves strategies unset
565 Light(int id, const std::shared_ptr<APICache>& baseCache); 571 Light(int id, const std::shared_ptr<APICache>& baseCache);
566 572
567 - //! \brief Protected ctor that is used by \ref Bridge class, also sets 573 + //! \brief Protected ctor that is used by \ref LightFactory, also sets
568 //! strategies. 574 //! strategies.
569 //! 575 //!
570 //! \param id Integer that specifies the id of this light 576 //! \param id Integer that specifies the id of this light
include/hueplusplus/ResourceList.h
@@ -46,9 +46,6 @@ template &lt;typename Resource, typename IdT&gt; @@ -46,9 +46,6 @@ template &lt;typename Resource, typename IdT&gt;
46 class ResourceList 46 class ResourceList
47 { 47 {
48 public: 48 public:
49 - struct SharedStateTag  
50 - { };  
51 -  
52 using ResourceType = Resource; 49 using ResourceType = Resource;
53 using IdType = IdT; 50 using IdType = IdT;
54 static_assert(std::is_integral<IdType>::value || std::is_same<std::string, IdType>::value, 51 static_assert(std::is_integral<IdType>::value || std::is_same<std::string, IdType>::value,
@@ -95,6 +92,7 @@ public: @@ -95,6 +92,7 @@ public:
95 void refresh() { stateCache->refresh(); } 92 void refresh() { stateCache->refresh(); }
96 93
97 //! \brief Sets custom refresh interval for this list and all resources created. 94 //! \brief Sets custom refresh interval for this list and all resources created.
  95 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
98 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration) 96 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration)
99 { 97 {
100 stateCache->setRefreshDuration(refreshDuration); 98 stateCache->setRefreshDuration(refreshDuration);
include/hueplusplus/Rule.h
@@ -59,6 +59,7 @@ public: @@ -59,6 +59,7 @@ public:
59 void refresh(bool force = false); 59 void refresh(bool force = false);
60 60
61 //! \brief Sets custom refresh interval for this rule. 61 //! \brief Sets custom refresh interval for this rule.
  62 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
62 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); 63 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
63 64
64 //! \brief Get rule identifier 65 //! \brief Get rule identifier
include/hueplusplus/Scene.h
@@ -140,6 +140,7 @@ public: @@ -140,6 +140,7 @@ public:
140 void refresh(bool force = false); 140 void refresh(bool force = false);
141 141
142 //! \brief Sets custom refresh interval for this group. 142 //! \brief Sets custom refresh interval for this group.
  143 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
143 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); 144 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
144 145
145 //! \brief Get scene identifier 146 //! \brief Get scene identifier
include/hueplusplus/Schedule.h
@@ -49,6 +49,7 @@ public: @@ -49,6 +49,7 @@ public:
49 void refresh(); 49 void refresh();
50 50
51 //! \brief Sets custom refresh interval for this schedule. 51 //! \brief Sets custom refresh interval for this schedule.
  52 + //! \param refreshDuration The new minimum duration between refreshes. May be 0 or \ref c_refreshNever.
52 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration); 53 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
53 54
54 //! \brief Get schedule identifier 55 //! \brief Get schedule identifier
include/hueplusplus/Sensor.h
@@ -59,6 +59,9 @@ Alert alertFromString(const std::string&amp; s); @@ -59,6 +59,9 @@ Alert alertFromString(const std::string&amp; s);
59 class Sensor : public BaseDevice 59 class Sensor : public BaseDevice
60 { 60 {
61 public: 61 public:
  62 + //! \brief Construct Sensor with shared cache
  63 + //! \param id Integer that specifies the id of this sensor
  64 + //! \param baseCache Cache of the SensorList.
62 Sensor(int id, const std::shared_ptr<APICache>& baseCache); 65 Sensor(int id, const std::shared_ptr<APICache>& baseCache);
63 66
64 //! \brief Construct Sensor. 67 //! \brief Construct Sensor.