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

Implements the singleton strategy. More...

#include <di.hpp>

Inherits matador::di::strategy.

Public Member Functions

template<typename ... Args>
 singleton_strategy (Args &&...args)
 
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::singleton_strategy< T >

Implements the singleton strategy.

The singleton strategy provides only one instance of the type.

Template Parameters
TType of the object to be injected

Member Function Documentation

◆ acquire()

template<class T >
void * matador::di::singleton_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