Minimal Dependency Injection Framework for C++
Single file library for implementing the dependency injection pattern
dip::Injector< Service > Struct Template Reference

Custom injector. More...

#include <dip.hpp>

Public Types

typedef std::function< Service *()> AcquireFunction
 Type of a function able to retrieve instances.
 
typedef std::function< void(Service *)> ReleaseFunction
 Type of a function able to remove unneeded instances.
 

Public Attributes

AcquireFunction acquire
 Custom function to retrieve instances. More...
 
ReleaseFunction release
 Custom function to remove uneeded instances. More...
 

Detailed Description

template<class Service>
struct dip::Injector< Service >

Custom injector.

Template Parameters
ServiceService to be injected

Member Data Documentation

◆ acquire

template<class Service >
AcquireFunction dip::Injector< Service >::acquire

Custom function to retrieve instances.

Note
Mandatory. Must return non-null.

◆ release

template<class Service >
ReleaseFunction dip::Injector< Service >::release

Custom function to remove uneeded instances.

Note
Optional

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