aboutsummaryrefslogtreecommitdiff
path: root/src/DI/auto_wirable.hpp
blob: a903242dc39c24067ebc04e702662aa63c6618a7 (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() noexcept = default;
};

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

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

#include "auto_wirable.tpp"