|
lintel 0.2.0
|
#include <Features.h>
Public Types | |
| enum | Value : std::uint8_t { Base , Http , Property , Cli } |
| using | RegisterTypeFunc = std::function< void(lintel::di::ContainerBuilder &)> |
| using | InitializeFunc = std::function< void(std::shared_ptr< lintel::di::Container >)> |
Public Member Functions | |
| template<typename T , std::enable_if_t< std::is_enum_v< T > > * = nullptr> | |
| void | registerFeature (T x, const RegisterTypeFunc ®isterTypeFunc, const InitializeFunc &initializeFunc) |
| Features () | |
| void | initializeOf (const std::string &featureName, std::shared_ptr< lintel::di::Container > container) |
| void | registerType (const std::string &featureName, lintel::di::ContainerBuilder &builder) |
| std::vector< std::string > | allOf () |
Features class for configuration support of Features, which are active
Usage:
| using lintel::Features::InitializeFunc = std::function<void(std::shared_ptr<lintel::di::Container>)> |
Function type for initializing a feature with the resolved container
| using lintel::Features::RegisterTypeFunc = std::function<void(lintel::di::ContainerBuilder &)> |
Function type for registering types with the DI container
| enum lintel::Features::Value : std::uint8_t |
Enumeration of known features
| Enumerator | |
|---|---|
| Base | Base library feature |
| Http | HTTP feature |
| Property | Property feature |
| Cli | CLI feature |
|
inline |
Initialize the Features manager with all known enum values
|
inline |
Get all registered feature names
|
inline |
Initialize a specific feature by name
| featureName | The name of the feature to initialize |
| container | The resolved DI container |
|
inline |
Register a feature identified by its enum value
| T | The enum type |
| x | The enum value identifying the feature |
| registerTypeFunc | Callback to register DI types |
| initializeFunc | Callback to initialize the feature |
|
inline |
Register types for a specific feature by name
| featureName | The name of the feature |
| builder | The DI container builder |