1#ifndef CAPYDI_TRANSIENT_HPP_
2#define CAPYDI_TRANSIENT_HPP_
20template<
typename Type>
39 template<
typename... Dependencies>
42 std::tuple<Dependencies...>& dependencies,
47 this->values_.push_back(std::make_unique<Type>(
48 std::apply(Type::create, dependencies)
51 context.flags.just_created =
true;
56 template<
typename... Dependencies>
59 std::tuple<Dependencies...>& dependencies,
65 this->
do_resolve(meta::Pack<Type>{}, dependencies, input).value()
69 template<std::
size_t DependencyIndex>
76 mutable std::vector<std::unique_ptr<Type>> values_;
Configuration type enumeration for the dependency injection system.
Error codes and diagnostics for dependency injection operations.
Compile-time type pack utilities and metaprogramming foundations.
Definition Transient.hpp:25
std::optional< std::tuple<> > get_dependencies_input() const
Definition Transient.hpp:70
std::expected< meta::RuntimeRef< const Type >, Error > do_resolve(meta::Pack< const Type > keys, std::tuple< Dependencies... > &dependencies, meta::wrapped_with< ResolutionContext > auto &context, const auto &input) const
Definition Transient.hpp:57
Type CentralType
Definition Transient.hpp:27
meta::Pack< meta::Pack< Type >, meta::Pack< const Type > > ResolutionKeysPack
Definition Transient.hpp:28
std::expected< meta::RuntimeRef< Type >, Error > do_resolve(meta::Pack< Type > keys, std::tuple< Dependencies... > &dependencies, meta::wrapped_with< ResolutionContext > auto &context, const auto &input) const
Definition Transient.hpp:40
static constexpr ConfigType CONFIG_TYPE
Definition Transient.hpp:36
meta::args_pack_t< decltype(CentralType::create)> DependenciesPack
Definition Transient.hpp:33
Definition Decorator.hpp:19
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
Error
Enumeration of possible errors during dependency injection resolution.
Definition Error.hpp:26
Definition DecoratableConfig.hpp:9