]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/common/config_proxy: add a helper for get_val<>()
authorKefu Chai <kchai@redhat.com>
Fri, 7 May 2021 05:14:33 +0000 (13:14 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 7 May 2021 05:55:51 +0000 (13:55 +0800)
otherwise we have to put something like

local_conf().template get_val<T>(name)

which is not quite convenient or readable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/config_proxy.h

index f50a634318824afa49e0dfac3ec4163cb86a1a5a..f7611a6b4fc55c6f317932d72847eff4cb7f6f39 100644 (file)
@@ -197,4 +197,9 @@ inline ConfigProxy::ShardedConfig& sharded_conf() {
   return ConfigProxy::sharded_conf;
 }
 
+template<typename T>
+const T get_conf(const std::string& key) {
+  return local_conf().template get_val<T>(key);
+}
+
 }