lintel 0.2.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
lintel::Features Class Reference

#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 &registerTypeFunc, 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 ()
 

Detailed Description

Features class for configuration support of Features, which are active

Usage:

Member Typedef Documentation

◆ InitializeFunc

Function type for initializing a feature with the resolved container

◆ RegisterTypeFunc

Function type for registering types with the DI container

Member Enumeration Documentation

◆ Value

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

Constructor & Destructor Documentation

◆ Features()

lintel::Features::Features ( )
inline

Initialize the Features manager with all known enum values

Member Function Documentation

◆ allOf()

std::vector< std::string > lintel::Features::allOf ( )
inline

Get all registered feature names

Returns
Vector of all feature names

◆ initializeOf()

void lintel::Features::initializeOf ( const std::string &  featureName,
std::shared_ptr< lintel::di::Container >  container 
)
inline

Initialize a specific feature by name

Parameters
featureNameThe name of the feature to initialize
containerThe resolved DI container

◆ registerFeature()

template<typename T , std::enable_if_t< std::is_enum_v< T > > * = nullptr>
void lintel::Features::registerFeature ( T  x,
const RegisterTypeFunc &  registerTypeFunc,
const InitializeFunc &  initializeFunc 
)
inline

Register a feature identified by its enum value

Template Parameters
TThe enum type
Parameters
xThe enum value identifying the feature
registerTypeFuncCallback to register DI types
initializeFuncCallback to initialize the feature

◆ registerType()

void lintel::Features::registerType ( const std::string &  featureName,
lintel::di::ContainerBuilder &  builder 
)
inline

Register types for a specific feature by name

Parameters
featureNameThe name of the feature
builderThe DI container builder

The documentation for this class was generated from the following file: