Public Member Functions | List of all members
BindingBuilder< BaseT, DeleterT > Class Template Referencefinal

An injector binding candidate created via the injector configuration. More...

#include <BindingBuilder.hpp>

Inherits BindingBuilderBase.

Public Member Functions

template<typename DerivedT >
void toEagerSingleton ()
 Bind an interface to a concrete singleton type. More...
 
template<typename DerivedT , typename SharedDeleterT >
void toEagerSingleton ()
 Bind an interface to a concrete singleton type, using the supplied deleter type. More...
 
void toEagerSingleton ()
 Bind a concrete singleton type. More...
 
void toReference (BaseT &reference)
 Bind a reference type to a reference value. More...
 
template<typename DerivedT >
void toSingleton ()
 Bind an interface to a concrete singleton type. More...
 
template<typename DerivedT , typename SharedDeleterT >
void toSingleton ()
 Bind an interface to a concrete singleton type, using the supplied deleter type. More...
 
void toSingleton ()
 Bind a concrete singleton type. More...
 
void toSingleton (std::shared_ptr< BaseT > instance)
 Bind an interface to a specific instance. More...
 
void toSingleton (BaseT *instance)
 Bind an interface to a specific instance, via a pointer container type syntax. More...
 
template<typename SharedDeleterT >
void toSingleton (BaseT *instance)
 Bind an interface to a specific instance, via a pointer container type syntax and using the supplied deleter type. More...
 
template<typename ProviderT >
void toSingletonProvider ()
 Bind an interface to a singleton provider class. More...
 
template<typename ProviderT >
void toSingletonProvider (std::shared_ptr< ProviderT > provider)
 Bind an interface to a singleton provider class instance. More...
 
void toSingletonProvider (const std::function< std::shared_ptr< BaseT >()> &provider)
 Bind an interface to a singleton provider function. More...
 
template<typename DerivedT >
void toThreadLocal ()
 Bind an interface to a concrete type with thread-local singleton semantics. More...
 
template<typename DerivedT , typename SharedDeleterT >
void toThreadLocal ()
 Bind an interface to a concrete type with thread-local singleton semantics, using the supplied deleter type. More...
 
void toThreadLocal ()
 Bind a concrete type with thread-local singleton semantics. More...
 
template<typename DerivedT >
void toUnique ()
 Bind an interface to an implementing class. More...
 
void toUniqueProvider (UniquePtrProviderFunction provider)
 Bind an interface to a unique pointer provider function. More...
 
template<typename ProviderT >
void toUniqueProvider ()
 Bind an interface to a unique pointer provider class. More...
 
template<typename ProviderT >
void toUniqueProvider (std::shared_ptr< ProviderT > provider)
 Bind an interface to a unique pointer provider class instance. More...
 
void toValue ()
 Bind a concrete type. More...
 
template<typename ValueT = BaseT>
void toValue (ValueT prototype)
 Bind a concrete type to a prototype value. More...
 
template<typename ProviderFunctionT >
void toValueProvider (ProviderFunctionT provider)
 Bind a concrete type to a value provider function. More...
 
template<typename ProviderT >
void toValueProvider ()
 Bind a concrete type to a value provider class. More...
 
template<typename ProviderT >
void toValueProvider (std::shared_ptr< ProviderT > provider)
 Bind a concrete type to a value provider class instance. More...
 

Detailed Description

template<typename BaseT, typename DeleterT>
class Balau::BindingBuilder< BaseT, DeleterT >

An injector binding candidate created via the injector configuration.

The deleter type is only used for unique bindings.

Member Function Documentation

◆ toEagerSingleton() [1/3]

void toEagerSingleton ( )
inline

Bind an interface to a concrete singleton type.

The singleton will be instantiated eagerly.

◆ toEagerSingleton() [2/3]

void toEagerSingleton ( )
inline

Bind an interface to a concrete singleton type, using the supplied deleter type.

The singleton will be instantiated eagerly.

◆ toEagerSingleton() [3/3]

void toEagerSingleton ( )
inline

Bind a concrete singleton type.

The singleton will be instantiated eagerly.

◆ toReference()

void toReference ( BaseT &  reference)
inline

Bind a reference type to a reference value.

The reference will be provided each time it is requested.

◆ toSingleton() [1/6]

void toSingleton ( )
inline

Bind an interface to a concrete singleton type.

The singleton will be instantiated lazily.

◆ toSingleton() [2/6]

void toSingleton ( )
inline

Bind an interface to a concrete singleton type, using the supplied deleter type.

The singleton will be instantiated lazily.

◆ toSingleton() [3/6]

void toSingleton ( )
inline

Bind a concrete singleton type.

The singleton will be instantiated lazily.

◆ toSingleton() [4/6]

void toSingleton ( std::shared_ptr< BaseT >  instance)
inline

Bind an interface to a specific instance.

This binding call allows the instance to be created and configured before being bound.

The injector has shared ownership of the supplied pointer.

◆ toSingleton() [5/6]

void toSingleton ( BaseT *  instance)
inline

Bind an interface to a specific instance, via a pointer container type syntax.

The injector takes ownership of the supplied pointer.

Do not use this binding call in order to bind an owned raw pointer, as such a call will result in a defective application. Only use this call as if you are initialising a pointer container with a new object.

◆ toSingleton() [6/6]

void toSingleton ( BaseT *  instance)
inline

Bind an interface to a specific instance, via a pointer container type syntax and using the supplied deleter type.

The injector takes ownership of the supplied pointer.

Do not use this binding call in order to bind an owned raw pointer, as such a call will result in a defective application. Only use this call as if you are initialising a pointer container with a new object.

◆ toSingletonProvider() [1/3]

void toSingletonProvider ( )
inline

Bind an interface to a singleton provider class.

The provider will be called once when the singleton is first requested.

◆ toSingletonProvider() [2/3]

void toSingletonProvider ( std::shared_ptr< ProviderT >  provider)
inline

Bind an interface to a singleton provider class instance.

The provider instance is supplied as a shared pointer, allowing the caller to maintain shared ownership if required.

The provider will be called once when the singleton is first requested.

◆ toSingletonProvider() [3/3]

void toSingletonProvider ( const std::function< std::shared_ptr< BaseT >()> &  provider)
inline

Bind an interface to a singleton provider function.

The provider will be called once when the singleton is first requested.

◆ toThreadLocal() [1/3]

void toThreadLocal ( )
inline

Bind an interface to a concrete type with thread-local singleton semantics.

The thread-local singleton will be instantiated lazily for each new calling thread.

◆ toThreadLocal() [2/3]

void toThreadLocal ( )
inline

Bind an interface to a concrete type with thread-local singleton semantics, using the supplied deleter type.

The thread-local singleton will be instantiated lazily for each new calling thread.

◆ toThreadLocal() [3/3]

void toThreadLocal ( )
inline

Bind a concrete type with thread-local singleton semantics.

The thread-local singleton will be instantiated lazily for each new calling thread.

◆ toUnique()

void toUnique ( )
inline

Bind an interface to an implementing class.

A new instance of the polymorphic type will be created each time a value is requested.

◆ toUniqueProvider() [1/3]

void toUniqueProvider ( UniquePtrProviderFunction  provider)
inline

Bind an interface to a unique pointer provider function.

The provider will be called each time a new polymorphic instance is requested.

◆ toUniqueProvider() [2/3]

void toUniqueProvider ( )
inline

Bind an interface to a unique pointer provider class.

The provider will be called each time a new polymorphic instance is requested.

◆ toUniqueProvider() [3/3]

void toUniqueProvider ( std::shared_ptr< ProviderT >  provider)
inline

Bind an interface to a unique pointer provider class instance.

The provider instance is supplied as a shared pointer, allowing the caller to maintain shared ownership if required.

The provider will be called each time a new polymorphic instance is requested.

◆ toValue() [1/2]

void toValue ( )
inline

Bind a concrete type.

A new instance of the type will be created each time a value is requested.

◆ toValue() [2/2]

void toValue ( ValueT  prototype)
inline

Bind a concrete type to a prototype value.

A copy of the prototype value will be created via copy semantics each time a value is requested.

◆ toValueProvider() [1/3]

void toValueProvider ( ProviderFunctionT  provider)
inline

Bind a concrete type to a value provider function.

The provider will be called each time a value is requested.

◆ toValueProvider() [2/3]

void toValueProvider ( )
inline

Bind a concrete type to a value provider class.

The provider will be called each time a value is requested.

◆ toValueProvider() [3/3]

void toValueProvider ( std::shared_ptr< ProviderT >  provider)
inline

Bind a concrete type to a value provider class instance.

The provider instance is supplied as a shared pointer, allowing the caller to maintain shared ownership if required.

The provider will be called each time a value is requested.


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