capydi
Loading...
Searching...
No Matches
CreationalConfig.hpp
Go to the documentation of this file.
1
9
10#ifndef CREATIONAL_CONFIG_HPP_
11#define CREATIONAL_CONFIG_HPP_
12
14
17
18namespace capy::di
19{
20
49template<typename Config>
50concept CreationalConfig = requires() {
51 typename Config::CentralType;
52 typename Config::ResolutionKeysPack;
53 Config::CONFIG_TYPE;
54}
55&& std::same_as<std::remove_cv_t<decltype(Config::CONFIG_TYPE)>, ConfigType>
56&& Config::CONFIG_TYPE == ConfigType::CREATIONAL;
57
67template<typename Config>
69{
70 static constexpr bool value = CreationalConfig<Config>;
71};
72
74template<CreationalConfig Config>
75using central_type_t = typename Config::CentralType;
76
78template<CreationalConfig Config>
79using resolution_keys_pack_t = typename Config::ResolutionKeysPack;
80
81template<CreationalConfig Config>
82using dependencies_pack_t = typename Config::DependenciesPack;
83
84}
85
86#endif // !CREATIONAL_CONFIG_HPP_
Configuration type enumeration for the dependency injection system.
Compile-time type pack utilities and metaprogramming foundations.
Concept for configurations that handle dependency creation and instantiation.
Definition CreationalConfig.hpp:50
Definition Decorator.hpp:19
typename Config::DependenciesPack dependencies_pack_t
Definition CreationalConfig.hpp:82
typename Config::ResolutionKeysPack resolution_keys_pack_t
Helper alias to extract the resolution keys from a CreationalConfig.
Definition CreationalConfig.hpp:79
ConfigType
Categorization of configuration strategies in the DI container.
Definition ConfigType.hpp:24
@ CREATIONAL
Creational configs handle object instantiation and factory patterns. These are responsible for creati...
Definition ConfigType.hpp:27
typename Config::CentralType central_type_t
Helper alias to extract the central type from a CreationalConfig.
Definition CreationalConfig.hpp:75
Type trait that checks if a type is a CreationalConfig.
Definition CreationalConfig.hpp:69
static constexpr bool value
Definition CreationalConfig.hpp:70