Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/depend.hpp"
Access point to singletons and other kinds of dependencies designated by type.
Actually this is a Factory object, which is typically placed into a static field of the Singleton (target) class or some otherwise suitable interface.
SRV | the class of the Service or Singleton instance |
Definition at line 280 of file depend.hpp.
Public Member Functions | |
Depend () | |
operator bool () const | |
allow to "peek" if a dependency is already available and exposed. More... | |
SRV & | operator() () |
Interface to be used by clients for retrieving the service instance. More... | |
Friends | |
class | DependInject< SRV > |
Private Types | |
using | Factory = DependencyFactory< SRV > |
using | Instance = std::atomic< SRV * > |
using | Lock = ClassLock< SRV, NonrecursiveLock_NoWait > |
Static Private Member Functions | |
static Factory & | factory () |
Static Private Attributes | |
static Instance | instance |
shared per type | |
|
inline |
Depend<TY>
Definition at line 342 of file depend.hpp.
|
inline |
Interface to be used by clients for retrieving the service instance.
Manages the instance creation, lifecycle and access in multithreaded context.
SRV
. When used in default configuration, the returned service instance is a singleton. Definition at line 307 of file depend.hpp.
|
inlineexplicit |
allow to "peek" if a dependency is already available and exposed.
Definition at line 334 of file depend.hpp.