![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/depend.hpp"
Helper to abstract creation and lifecycle of a dependency.
Holds a configurable constructor function and optionally an automatically invoked deleter function.
Definition at line 125 of file depend.hpp.
Classes | |
| struct | canDefaultConstruct |
| metafunction: can we instantiate the desired object here? More... | |
Public Attributes | |
| ZombieCheck | zombieCheck {util::typeStr<OBJ>()} |
Public Member Functions | |
| DependencyFactory ()=default | |
| ~DependencyFactory () | |
| OBJ * | buildTarget () |
| template<typename FUN > | |
| void | defineCreator (FUN &&ctor) |
| template<typename FUN > | |
| void | defineCreatorAndManage (FUN &&ctor) |
| void | disable () |
| template<typename FUN > | |
| void | atDestruction (FUN &&additionalAction) |
| void | transferDefinition (DependencyFactory &&source) |
Private Types | |
| using | Creator = std::function< OBJ *()> |
| using | Deleter = std::function< void()> |
Private Member Functions | |
| OBJ * | buildAndManage () |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
Static Private Member Functions | |
| template<class X , typename = decltype(X())> | |
| static std::true_type | __try_instantiate (int) |
| template<class > | |
| static std::false_type | __try_instantiate (...) |
| template<class TAR > | |
| static meta::enable_if< canDefaultConstruct< TAR >, TAR * > | buildInstance () |
| template<class ABS > | |
| static meta::enable_if< std::is_abstract< ABS >, ABS * > | buildInstance () |
| template<class ABS > | |
| static meta::disable_if< std::__or_< std::is_abstract< ABS >, canDefaultConstruct< ABS > >, ABS * > | buildInstance () |
Private Attributes | |
| Creator | creator_ |
| Deleter | deleter_ |
|
default |
|
inline |
Definition at line 138 of file depend.hpp.
References DependencyFactory< OBJ >::deleter_.
|
private |
Definition at line 128 of file depend.hpp.
|
private |
Definition at line 129 of file depend.hpp.
|
inline |
Definition at line 145 of file depend.hpp.
References DependencyFactory< OBJ >::buildAndManage(), and DependencyFactory< OBJ >::creator_.
Here is the call graph for this function:
|
inline |
Definition at line 153 of file depend.hpp.
References DependencyFactory< OBJ >::creator_.
|
inline |
Definition at line 160 of file depend.hpp.
References DependencyFactory< OBJ >::atDestruction(), and DependencyFactory< OBJ >::creator_.
Here is the call graph for this function:
|
inline |
Definition at line 171 of file depend.hpp.
References DependencyFactory< OBJ >::creator_, and LERR_.
|
inline |
Definition at line 182 of file depend.hpp.
References DependencyFactory< OBJ >::deleter_.
Referenced by DependencyFactory< OBJ >::buildAndManage(), and DependencyFactory< OBJ >::defineCreatorAndManage().
Here is the caller graph for this function:
|
inline |
Definition at line 198 of file depend.hpp.
References DependencyFactory< OBJ >::creator_, and DependencyFactory< OBJ >::deleter_.
|
inlineprivate |
Definition at line 208 of file depend.hpp.
References DependencyFactory< OBJ >::atDestruction().
Referenced by DependencyFactory< OBJ >::buildTarget().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
|
staticprivate |
|
inlinestaticprivate |
Definition at line 234 of file depend.hpp.
|
inlinestaticprivate |
Definition at line 242 of file depend.hpp.
|
inlinestaticprivate |
Definition at line 250 of file depend.hpp.
|
private |
Definition at line 131 of file depend.hpp.
Referenced by DependencyFactory< OBJ >::buildTarget(), DependencyFactory< OBJ >::defineCreator(), DependencyFactory< OBJ >::defineCreatorAndManage(), DependencyFactory< OBJ >::disable(), and DependencyFactory< OBJ >::transferDefinition().
|
private |
Definition at line 132 of file depend.hpp.
Referenced by DependencyFactory< OBJ >::~DependencyFactory(), DependencyFactory< OBJ >::atDestruction(), and DependencyFactory< OBJ >::transferDefinition().
| ZombieCheck zombieCheck {util::typeStr<OBJ>()} |
Definition at line 135 of file depend.hpp.
Inheritance diagram for DependencyFactory< OBJ >:
Collaboration diagram for DependencyFactory< OBJ >: