]> git.proxmox.com Git - ceph.git/blame - ceph/src/librbd/ConfigWatcher.h
Import ceph 15.2.8
[ceph.git] / ceph / src / librbd / ConfigWatcher.h
CommitLineData
f6b5b4d7
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3
4#ifndef CEPH_LIBRBD_CONFIG_WATCHER_H
5#define CEPH_LIBRBD_CONFIG_WATCHER_H
6
7#include <set>
8#include <string>
9
10struct Context;
11
12namespace librbd {
13
14struct ImageCtx;
15
16template <typename ImageCtxT>
17class ConfigWatcher {
18public:
19 static ConfigWatcher* create(ImageCtxT& image_ctx) {
20 return new ConfigWatcher(image_ctx);
21 }
22
23 ConfigWatcher(ImageCtxT& image_ctx);
24 ~ConfigWatcher();
25
26 ConfigWatcher(const ConfigWatcher&) = delete;
27 ConfigWatcher& operator=(const ConfigWatcher&) = delete;
28
29 void init();
30 void shut_down();
31
32private:
33 struct Observer;
34
35 ImageCtxT& m_image_ctx;
36
37 Observer* m_observer = nullptr;
38
39 void handle_global_config_change(std::set<std::string> changed);
40
41};
42
43} // namespace librbd
44
45extern template class librbd::ConfigWatcher<librbd::ImageCtx>;
46
47#endif // CEPH_LIBRBD_CONFIG_WATCHER_H