diff options
author | Matt Spinler <spinler@us.ibm.com> | 2018-06-19 10:52:32 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2018-06-19 10:52:32 -0500 |
commit | a4353bcfd0d1274f9454c9731d26ff49d3d40cb7 (patch) | |
tree | 0d2172c862aee74aa114bd271ca717e4c03d99cc | |
parent | 505523772e7b1ba789d6522397f9932629b96e83 (diff) | |
download | phosphor-hwmon-a4353bcfd0d1274f9454c9731d26ff49d3d40cb7.tar.gz phosphor-hwmon-a4353bcfd0d1274f9454c9731d26ff49d3d40cb7.zip |
Add SensorSet class doxygen comments
Change-Id: Ie484a7add85bef4098571432c9b760245cbee8b8
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r-- | sensorset.hpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sensorset.hpp b/sensorset.hpp index 100ae68..420761f 100644 --- a/sensorset.hpp +++ b/sensorset.hpp @@ -4,6 +4,19 @@ #include <set> #include <string> +/** + * @class SensorSet + * @brief Finds and holds the available hwmon sensors for a device + * @details When passed a hwmon device directory on construction, + * this class will find all hwmon sysfs files in that directory + * and store them in a map. The public begin() and end() methods + * on this class allow traversal of this map. + * + * For example, a file named temp5_input will have a map entry of: + * + * key: pair<string, string> = {"temp", "5"} + * value: std::string = "input" + */ class SensorSet { public: @@ -12,6 +25,14 @@ class SensorSet using mapped_type = container_t::mapped_type; using key_type = container_t::key_type; + /** + * @brief Constructor + * @details Builds a map of the hwmon sysfs files in the passed + * in directory. + * + * @param[in] path - path to the hwmon device directory + * + */ explicit SensorSet(const std::string& path); ~SensorSet() = default; SensorSet() = delete; @@ -20,17 +41,34 @@ class SensorSet SensorSet(SensorSet&&) = default; SensorSet& operator=(SensorSet&&) = default; + /** + * @brief Returns an iterator to the beginning of the map + * + * @return const_iterator + */ container_t::const_iterator begin() { return const_cast<const container_t&>(container).begin(); } + /** + * @brief Returns an iterator to the end of the map + * + * @return const_iterator + */ container_t::const_iterator end() { return const_cast<const container_t&>(container).end(); } private: + + /** + * @brief The map of hwmon files in the directory + * @details For example: + * key = pair("temp", "1") + * value = "input" + */ container_t container; }; |