]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
docs: Document md_config_obs_t. 5326/head
authorKrzysztof Kosiński <krzysztof.kosinski@intel.com>
Thu, 23 Jul 2015 13:20:20 +0000 (15:20 +0200)
committerKrzysztof Kosiński <krzysztof.kosinski@intel.com>
Thu, 23 Jul 2015 13:20:20 +0000 (15:20 +0200)
Signed-off-by: Krzysztof Kosiński <krzysztof.kosinski@intel.com>
src/common/config_obs.h

index 0328d32d835382a5cc62ada8bff7b0945347733a..723f7391ea5217c2170799b1715070d9adff3ac0 100644 (file)
 
 struct md_config_t;
 
+/** @brief Base class for configuration observers.
+ * Use this as a base class for your object if it has to respond to configuration changes,
+ * for example by updating some values or modifying its behavior.
+ * Subscribe for configuration changes by calling the md_config_t::add_observer() method
+ * and unsubscribe using md_config_t::remove_observer().
+ */
 class md_config_obs_t {
 public:
   virtual ~md_config_obs_t() {}
+  /** @brief Get a table of strings specifying the configuration keys in which the object is interested.
+   * This is called when the object is subscribed to configuration changes with add_observer().
+   * The returned table should not be freed until the observer is removed with remove_observer().
+   * Note that it is not possible to change the set of tracked keys without re-subscribing. */
   virtual const char** get_tracked_conf_keys() const = 0;
+  /// React to a configuration change.
   virtual void handle_conf_change(const struct md_config_t *conf,
                                  const std::set <std::string> &changed) = 0;
+  /// Unused for now
   virtual void handle_subsys_change(const struct md_config_t *conf,
                                    const std::set<int>& changed) { }
 };