]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: add templated Context factory
authorPatrick Donnelly <pdonnell@redhat.com>
Sun, 29 Jul 2018 01:12:13 +0000 (18:12 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 15 Aug 2018 04:20:56 +0000 (21:20 -0700)
For use to create Contexts only when needed.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/include/Context.h

index a801578a598a1bc7e5ee602aa6d2d50f3aec5cfa..4cd77850cb67710788d339c91ef738ed6e6e2545 100644 (file)
@@ -492,6 +492,13 @@ private:
   boost::function<void(int)> m_callback;
 };
 
+template <class ContextType>
+class ContextFactory {
+public:
+  virtual ~ContextFactory() {}
+  virtual ContextType *build() = 0;
+};
+
 #undef mydout
 
 #endif