aboutsummaryrefslogtreecommitdiff
path: root/src/DI/function_wrapper.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DI/function_wrapper.hpp')
-rw-r--r--src/DI/function_wrapper.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/DI/function_wrapper.hpp b/src/DI/function_wrapper.hpp
new file mode 100644
index 0000000..e4b6779
--- /dev/null
+++ b/src/DI/function_wrapper.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "DI/container.hpp"
+#include "DI/interfaces/wrapper.hpp"
+
+#include <memory>
+
+template <class Interface>
+class FunctionWrapper : public IWrapper<Interface>
+{
+public:
+ explicit FunctionWrapper(Interface func) : _func(func) {}
+
+ [[nodiscard]] Interface get() const;
+
+private:
+ const Interface _func;
+};
+
+#include "function_wrapper.tpp"