![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/depend-inject.hpp"
Configuration handle to expose a service implementation through the Depend<SRV> front-end.
This non-copyable (but movable) handle shall be planted within the context operating the service to be exposed. It will immediately create (in RAII style) and manage a heap-allocated instance of the subclass IMP and expose a baseclass pointer to this specific instance through Depend<SRV>. Moreover, the implementation subclass can be accessed through this handle, which acts as smart-ptr. When the handle goes out of scope, the implementation instance is destroyed and the access through Depend<SRV> is closed and inhibited, to prevent on-demand creation of a baseclass SRV singleton.
| IMP | concrete service implementation subclass to build, manage and expose. |
| error::Logic | (LUMIERA_ERROR_LIFECYCLE) when the default factory has already been invoked at the point when calling this (re)configuration function. |
Definition at line 202 of file depend-inject.hpp.
Public Types | |
| enum | StartMode { NOT_YET_STARTED } |
Public Member Functions | |
| template<typename... ARGS> | |
| ServiceInstance (ARGS &&...ctorArgs) | |
| ServiceInstance (StartMode) | |
| create in deactivated state. | |
| ~ServiceInstance () | |
| template<typename... ARGS> | |
| IMP & | createInstance (ARGS &&...ctorArgs) |
| void | shutdown () noexcept |
| operator bool () const | |
| IMP & | operator* () const |
| IMP * | operator-> () const |
Private Attributes | |
| std::unique_ptr< IMP > | instance_ |
Additional Inherited Members | |
Private Member Functions inherited from MoveOnly | |
| ~MoveOnly ()=default | |
| MoveOnly ()=default | |
| MoveOnly (MoveOnly &&)=default | |
| MoveOnly (MoveOnly const &)=delete | |
| MoveOnly & | operator= (MoveOnly &&)=delete |
| MoveOnly & | operator= (MoveOnly const &)=delete |
|
inline |
Definition at line 209 of file depend-inject.hpp.
References DependInject< SRV >::activateServiceAccess(), and DependInject< SRV >::ServiceInstance< IMP >::instance_.
Here is the call graph for this function:create in deactivated state.
Can be activated later
Definition at line 219 of file depend-inject.hpp.
Definition at line 225 of file depend-inject.hpp.
References DependInject< SRV >::ServiceInstance< IMP >::shutdown().
Here is the call graph for this function:| Enumerator | |
|---|---|
| NOT_YET_STARTED | |
Definition at line 216 of file depend-inject.hpp.
|
inline |
Definition at line 232 of file depend-inject.hpp.
References DependInject< SRV >::activateServiceAccess(), and DependInject< SRV >::ServiceInstance< IMP >::instance_.
Referenced by OutputDirector::connectUp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinenoexcept |
Definition at line 240 of file depend-inject.hpp.
References DependInject< SRV >::deactivateServiceAccess(), and DependInject< SRV >::ServiceInstance< IMP >::instance_.
Referenced by DispatcherLoop::~DispatcherLoop(), DependInject< SRV >::ServiceInstance< IMP >::~ServiceInstance(), OutputDirector::bringDown(), and DispatcherLoop::requestStop().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineexplicit |
Definition at line 251 of file depend-inject.hpp.
References DependInject< SRV >::ServiceInstance< IMP >::instance_.
|
inline |
Definition at line 257 of file depend-inject.hpp.
References DependInject< SRV >::ServiceInstance< IMP >::instance_.
|
inline |
Definition at line 264 of file depend-inject.hpp.
References DependInject< SRV >::ServiceInstance< IMP >::instance_.
|
private |
Definition at line 205 of file depend-inject.hpp.
Referenced by DependInject< SRV >::ServiceInstance< IMP >::ServiceInstance(), DependInject< SRV >::ServiceInstance< IMP >::createInstance(), DependInject< SRV >::ServiceInstance< IMP >::operator bool(), DependInject< SRV >::ServiceInstance< IMP >::operator*(), DependInject< SRV >::ServiceInstance< IMP >::operator->(), and DependInject< SRV >::ServiceInstance< IMP >::shutdown().
Inheritance diagram for DependInject< SRV >::ServiceInstance< IMP >:
Collaboration diagram for DependInject< SRV >::ServiceInstance< IMP >: