Lumiera
0.pre.03
»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 | |
template<class FUN > | |
Local (FUN &&buildInstance) | |
operator bool () const | |
MOC & | operator* () const |
MOC * | operator-> () const |
MOC & | triggerCreate () |
trigger lazy service object instantiation | |
Private Attributes | |
std::unique_ptr< MOC > | mock_ |
Factory | origFactory_ |
SRV * | origInstance_ |
Additional Inherited Members | |
Private Member Functions inherited from MoveOnly | |
MoveOnly (MoveOnly &&)=default | |
MoveOnly (MoveOnly const &)=delete | |
MoveOnly & | operator= (MoveOnly &&)=delete |
MoveOnly & | operator= (MoveOnly const &)=delete |