A simple Component that creates, hold, and distributes an object of user type T. The component has a name equal to the constexpr std::string_view result of user-defined ContainerName(Of<T>{}).
Definition in file container.hpp.
Go to the source code of this file.
#include <userver/components/component_base.hpp>#include <userver/components/component_config.hpp>#include <userver/components/component_context.hpp>#include <userver/formats/common/meta.hpp>Classes | |
| struct | components::Of< T > |
| class | components::Container< T > |
A simple Component that creates, hold, and distributes an object of user type T. The component has a name equal to the constexpr std::string_view result of user-defined ContainerName(Of<T>{}). More... | |
Namespaces | |
| namespace | components |
| Contains functions and types to start a userver based service/tool. | |
Functions | |
| template<typename T > | |
| std::enable_if_t< formats::common::impl::kHasParse< yaml_config::YamlConfig, T > &&std::is_class_v< T >, T > | components::LocateDependency (WithType< T >, const ComponentConfig &config, const ComponentContext &) |
A function that extracts an in-component-stored data (probably, reference) of type T, T&, or const T& from components::ComponentContext. | |
| template<typename T > | |
| std::enable_if_t< impl::ContainerHasName< T >::value, T & > | components::LocateDependency (WithType< T >, const ComponentConfig &, const ComponentContext &context) |
| template<typename T > | |
| std::enable_if_t< std::is_base_of_v< RawComponentBase, T >, T & > | components::LocateDependency (WithType< T >, const ComponentConfig &, const ComponentContext &context) |