Lumiera  0.pre.03
»edit your freedom«
DependInject< SRV >::Local< MOC > Class Template Reference

#include "lib/depend-inject.hpp"

Description

template<class SRV>
template<class MOC = SRV>
class lib::DependInject< SRV >::Local< MOC >

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 290 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
 
MoveOnlyoperator= (MoveOnly &&)=delete
 
MoveOnlyoperator= (MoveOnly const &)=delete
 
+ Inheritance diagram for DependInject< SRV >::Local< MOC >:
+ Collaboration diagram for DependInject< SRV >::Local< MOC >:

The documentation for this class was generated from the following file: