aboutsummaryrefslogtreecommitdiff
path: root/src/DI/auto_wirable.hpp
blob: 13d252e2648e5458d90fe2eb1667bffc763fe1c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "DI/container.hpp"

#include <memory>

// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IGenericAutoWirable
{
public:
	virtual ~IGenericAutoWirable() = default;
};

template <class Interface>
class IAutoWirable : public IGenericAutoWirable
{
public:
	static Interface resolve();
};

template <class Interface, class ObjectImpl, class... Dependencies>
class AutoWirable : public IAutoWirable<Interface>
{
public:
	static std::shared_ptr<Interface> resolve(const Container &container);
};

#include "auto_wirable.tpp"