Application configurations specify application injector bindings. More...
#include <ApplicationConfiguration.hpp>
Protected Member Functions | |
template<typename BaseT , typename DeleterT = std::default_delete<BaseT>> | |
BindingBuilder< BaseT, DeleterT > & | bind (std::string_view name=std::string_view()) const |
Create a binding specification for the specified named or unnamed interface. More... | |
void | registerPostConstructionCall (const std::function< void(const Injector &)> &call) const |
Register with the injector a callback that will be called by the injector at the end of construction. More... | |
void | registerPreDestructionCall (const std::function< void()> &call) const |
Register with the injector a callback that will be called in the injector's destructor, before the bindings are deleted. More... | |
template<typename T > | |
void | registerStaticSingleton (std::shared_ptr< T > *ptrPtr, std::string_view name=std::string_view()) const |
Register a static singleton pointer that the injector will set up post-construction and invalidate pre-destruction. More... | |
Additional Inherited Members | |
Public Member Functions inherited from InjectorConfiguration | |
virtual void | configure () const =0 |
Configure the injector configuration. More... | |
Application configurations specify application injector bindings.
One or more application configuration implementations are passed to the injector create function.
To implement a concrete application configuration class, implement this class and place the binding calls in the implemented configure() method.
|
inlineprotected |
Create a binding specification for the specified named or unnamed interface.
The deleter type is only used for unique bindings, otherwise it is ignored.
|
inlineprotected |
Register with the injector a callback that will be called by the injector at the end of construction.
In order to use this method, inject the injector into the injectable via a weak pointer and call the method.
call | the callback |
|
inlineprotected |
Register with the injector a callback that will be called in the injector's destructor, before the bindings are deleted.
Although pre-destruction callbacks must be noexcept(true), the pre-destruction function signature does not contain noexcept(true), as this is not yet handled by std::function in C++17. Despite this, functions registered as pre-destruction callbacks must nevertheless be noexcept(true).
In order to use this method, inject the injector into the injectable via a weak pointer and call the method.
call | the callback |
|
inlineprotected |
Register a static singleton pointer that the injector will set up post-construction and invalidate pre-destruction.
The static pointer will be valid immediately after injection construction up to the start of injector destruction.
This call is a convenience method for calling the registerPostConstructionCall and registerPreDestructionCall methods in order to set up and tear down the static singleton pointer.
T | the binding type |
ptrPtr | a raw pointer to the statically allocated shared pointer |
name | an optional binding name |