summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/collection_info_cache.h
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2018-04-30 18:34:19 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2018-04-30 18:34:19 -0400
commit00ca22fc7097455ab1301931015a86d84e038744 (patch)
treeb3886adb9020c09eab0e77d8ceb08d31cf8ebc7c /src/mongo/db/catalog/collection_info_cache.h
parentc68c5f493b042350f61dff7aaa32aa2e3e6d651e (diff)
downloadmongo-00ca22fc7097455ab1301931015a86d84e038744.tar.gz
SERVER-32645 Create a shim helper framework.
The `MONGO_DECLARE_SHIM`, `MONGO_DEFINE_SHIM`, and `MONGO_REGISTER_SHIM` macros can be used to create specialized types which are customization and auto-registration points for late-binding functions. In some sense they work like weak-symbols; however, they also are useful for tracking dependencies upon shimmed-out implementations.
Diffstat (limited to 'src/mongo/db/catalog/collection_info_cache.h')
-rw-r--r--src/mongo/db/catalog/collection_info_cache.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/catalog/collection_info_cache.h b/src/mongo/db/catalog/collection_info_cache.h
index 9bc07e80c61..6fb0fa5278e 100644
--- a/src/mongo/db/catalog/collection_info_cache.h
+++ b/src/mongo/db/catalog/collection_info_cache.h
@@ -28,6 +28,7 @@
#pragma once
+#include "mongo/base/shim.h"
#include "mongo/db/collection_index_usage_tracker.h"
#include "mongo/db/query/plan_cache.h"
#include "mongo/db/query/query_settings.h"
@@ -69,16 +70,15 @@ public:
const std::set<std::string>& indexesUsed) = 0;
};
-private:
- static std::unique_ptr<Impl> makeImpl(Collection* collection, const NamespaceString& ns);
public:
- using factory_function_type = decltype(makeImpl);
-
- static void registerFactory(stdx::function<factory_function_type> factory);
+ static MONGO_DECLARE_SHIM((Collection * collection,
+ const NamespaceString& ns,
+ PrivateTo<CollectionInfoCache>)
+ ->std::unique_ptr<Impl>) makeImpl;
explicit inline CollectionInfoCache(Collection* const collection, const NamespaceString& ns)
- : _pimpl(makeImpl(collection, ns)) {}
+ : _pimpl(makeImpl(collection, ns, PrivateCall<CollectionInfoCache>{})) {}
inline ~CollectionInfoCache() = default;