]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/config_obs: NoopConfigObserver
authorSage Weil <sage@redhat.com>
Thu, 11 Jan 2018 15:42:55 +0000 (09:42 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:49 +0000 (14:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_obs.h

index 723f7391ea5217c2170799b1715070d9adff3ac0..ddc7823ac5dacd3f8f76612a27bd1d1ca5162866 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <set>
 #include <string>
+#include <list>
 
 struct md_config_t;
 
@@ -42,4 +43,29 @@ public:
                                    const std::set<int>& changed) { }
 };
 
+class NoopConfigObserver : public md_config_obs_t {
+  std::list<std::string> options;
+  const char **ptrs = 0;
+
+public:
+  NoopConfigObserver(std::list<std::string> l) : options(l) {
+    ptrs = new const char*[options.size() + 1];
+    unsigned j = 0;
+    for (auto& i : options) {
+      ptrs[j++] = i.c_str();
+    }
+    ptrs[j] = 0;
+  }
+  ~NoopConfigObserver() {
+    delete[] ptrs;
+  }
+
+  const char** get_tracked_conf_keys() const override {
+    return ptrs;
+  }
+  void handle_conf_change(const struct md_config_t *conf,
+                         const std::set <std::string> &changed) override {
+  }
+};
+
 #endif