aboutsummaryrefslogtreecommitdiff
path: root/src/DI/object_wrapper.hpp
blob: 4aee9afa18ca7d4d7e4ff46e4f7bbeba9522c9d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include "DI/container.hpp"
#include "DI/interfaces/wrapper.hpp"

#include <memory>

template <class Interface, class ObjectImpl>
class ObjectWrapper : public IWrapper<std::shared_ptr<Interface>>
{
public:
	explicit ObjectWrapper(const Container &container) noexcept : _container(container) {}

	[[nodiscard]] std::shared_ptr<Interface> get() const noexcept override;

private:
	const Container &_container;
};

#include "object_wrapper.tpp"