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

#include <Container.h>

Public Member Functions

template<typename TInstance >
void registerInstance (std::shared_ptr< TInstance > instance)
 
template<typename TInstance >
RegistrationBuilder< TInstance > registerType ()
 
std::shared_ptr< Container > build ()
 

Detailed Description

Collects registrations and builds an immutable Container from them.

Member Function Documentation

◆ build()

std::shared_ptr< Container > lintel::di::ContainerBuilder::build ( )
inline

Build the immutable container from everything registered so far.

Returns
the ready to use container

◆ registerInstance()

template<typename TInstance >
void lintel::di::ContainerBuilder::registerInstance ( std::shared_ptr< TInstance >  instance)
inline

Register a ready-made instance under its static type.

Template Parameters
TInstancethe concrete type of the instance

◆ registerType()

template<typename TInstance >
RegistrationBuilder< TInstance > lintel::di::ContainerBuilder::registerType ( )
inline

Register a type for on-demand construction.

Template Parameters
TInstancethe concrete type; must be default-constructible or injectable

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