matador::di::transient_strategy< T > Class Template Reference
module module_

#include <di.hpp>

Inherits matador::di::strategy.

Public Member Functions

template<typename ... Args>
 transient_strategy (Args &&...args)
 Construct a new transient strategy object.
 
void * acquire () override
 Acquires an instance.
 
- Public Member Functions inherited from matador::di::strategy
virtual ~strategy ()=default
 

Detailed Description

template<class T>
class matador::di::transient_strategy< T >

Implements the transient dependency injection strategy. When ever injected a new instance is created.

Template Parameters
TType of the object to be injected

Constructor & Destructor Documentation

◆ transient_strategy()

template<class T >
template<typename ... Args>
matador::di::transient_strategy< T >::transient_strategy ( Args &&...  args)
inlineexplicit

Construct a new transient strategy object.

Template Parameters
ArgsType of arguments for constructor
Parameters
argsArguments for constructor

Member Function Documentation

◆ acquire()

template<class T >
void * matador::di::transient_strategy< T >::acquire ( )
inlineoverridevirtual

Acquires an instance.

Acquires an instance based on the internal strategy and returns an anonymous pointer to the object

Returns
The current injected object depending of the strategy

Implements matador::di::strategy.


The documentation for this class was generated from the following file:
  • matador/utils/di.hpp