capydi
Loading...
Searching...
No Matches
ChainableConfig.hpp
Go to the documentation of this file.
1
10
11#ifndef CHAINABLE_CONFIG_HPP_
12#define CHAINABLE_CONFIG_HPP_
13
15
17#include <concepts>
18
19namespace capy::di
20{
21
57template<typename Config>
59 requires() {
60 typename Config::RelatedEntity;
61 typename Config::RelatedKeysPack;
62 Config::CONFIG_TYPE;
63 }
64 // && requires(
65 // const Config& config
66 // meta::Reference<typename Config::RelatedEntity> auto related_entity
67 // ) {
68 // {
69 // config.pipe(related_entity)
70 // } -> meta::Reference<typename Config::RelatedEntity>;
71 // }
72 && std::same_as<std::remove_cv_t<decltype(Config::CONFIG_TYPE)>, ConfigType>
73 && Config::CONFIG_TYPE == ConfigType::CHAINABLE;
74
84template<typename Config>
86{
87 static constexpr bool value = ChainableConfig<Config>;
88};
89
91template<ChainableConfig Config>
92using get_related_entity_t = typename Config::RelatedEntity;
93
95template<ChainableConfig Config>
96using get_related_keys_pack_t = typename Config::RelatedKeysPack;
97
98}
99
100#endif // !CHAINABLE_CONFIG_HPP_
Configuration type enumeration for the dependency injection system.
Concept for configuration objects that transform/decorate dependencies.
Definition ChainableConfig.hpp:58
Definition Decorator.hpp:19
typename Config::RelatedEntity get_related_entity_t
Helper alias to extract the entity type from a ChainableConfig.
Definition ChainableConfig.hpp:92
typename Config::RelatedKeysPack get_related_keys_pack_t
Helper alias to extract the key type from a ChainableConfig.
Definition ChainableConfig.hpp:96
ConfigType
Categorization of configuration strategies in the DI container.
Definition ConfigType.hpp:24
@ CHAINABLE
Chainable configs form a pipeline of transformations applied after creation. Examples: proxies,...
Definition ConfigType.hpp:35
Type trait that checks if a type is a ChainableConfig.
Definition ChainableConfig.hpp:86
static constexpr bool value
Definition ChainableConfig.hpp:87