![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/depend-inject.hpp"
Configuration handle for temporarily shadowing a dependency by a test mock instance.
This non-copyable (but movable) handle shall be planted within the immediate test context. It immediately stashes away the existing state and configuration from Depend<SRV>, but waits for actual invocation of the Depend<SRV>-front-end to create a heap-allocated instance of the MOC subclass, which it manages and exposes like a smart-ptr. When the handle goes out of scope, the original state and configuration is restored
Definition at line 281 of file depend-inject.hpp.
Public Member Functions | |
| Local () | |
| template<class FUN > | |
| Local (FUN &&_buildInstance) | |
| ~Local () | |
| operator bool () const | |
| MOC & | triggerCreate () |
| trigger lazy service object instantiation | |
| MOC & | operator* () const |
| MOC * | operator-> () const |
Private Attributes | |
| std::unique_ptr< MOC > | mock_ |
| SRV * | origInstance_ |
| Factory | origFactory_ |
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 |
Definition at line 290 of file depend-inject.hpp.
|
inlineexplicit |
Definition at line 296 of file depend-inject.hpp.
References DependInject< SRV >::Local< MOC >::mock_, DependInject< SRV >::Local< MOC >::origFactory_, DependInject< SRV >::Local< MOC >::origInstance_, and DependInject< SRV >::temporarilyInstallAlternateFactory().
Here is the call graph for this function:Definition at line 308 of file depend-inject.hpp.
References DependInject< SRV >::Local< MOC >::origFactory_, DependInject< SRV >::Local< MOC >::origInstance_, and DependInject< SRV >::restoreOriginalFactory().
Here is the call graph for this function:
|
inlineexplicit |
Definition at line 314 of file depend-inject.hpp.
References DependInject< SRV >::Local< MOC >::mock_.
|
inline |
trigger lazy service object instantiation
Definition at line 321 of file depend-inject.hpp.
References DependInject< SRV >::Local< MOC >::mock_.
Referenced by ViewSpecDSL_test::verify_genericInvocation(), ElementAccess_test::verify_simpleAccess(), and ElementAccess_test::verify_standardUsage().
Here is the caller graph for this function:
|
inline |
Definition at line 329 of file depend-inject.hpp.
References DependInject< SRV >::Local< MOC >::mock_.
|
inline |
Definition at line 336 of file depend-inject.hpp.
References DependInject< SRV >::Local< MOC >::mock_.
|
private |
Definition at line 284 of file depend-inject.hpp.
Referenced by DependInject< SRV >::Local< MOC >::Local(), DependInject< SRV >::Local< MOC >::operator bool(), DependInject< SRV >::Local< MOC >::operator*(), DependInject< SRV >::Local< MOC >::operator->(), and DependInject< SRV >::Local< MOC >::triggerCreate().
|
private |
Definition at line 286 of file depend-inject.hpp.
Referenced by DependInject< SRV >::Local< MOC >::Local(), and DependInject< SRV >::Local< MOC >::~Local().
Definition at line 287 of file depend-inject.hpp.
Referenced by DependInject< SRV >::Local< MOC >::Local(), and DependInject< SRV >::Local< MOC >::~Local().
Inheritance diagram for DependInject< SRV >::Local< MOC >:
Collaboration diagram for DependInject< SRV >::Local< MOC >: