header_utils
Loading...
Searching...
No Matches
ghassanpl::di::Container Struct Reference

TODO: Split into ContainerBuilder and Container (or [Dependency]Registry and [Dependency]Container) Oooh, idea: Container container = Container(Registry1(), Registry2(), ...);. More...

#include <di.h>

Public Member Functions

template<typename INTERFACE , typename IMPLEMENTATION , typename... ARGS>
void RegisterType (ARGS &&... args)
 Registers.
 
template<typename INTERFACE >
bool HasAnyImplementationsOf () const
 
template<typename INTERFACE >
std::shared_ptr< INTERFACEResolve ()
 Resolves.
 
template<typename INTERFACE >
std::shared_ptr< INTERFACEResolveByName (std::string_view name)
 
template<typename INTERFACE >
std::vector< std::shared_ptr< INTERFACE > > ResolveAll ()
 
template<typename TYPE >
std::shared_ptr< TYPECreate ()
 Other.
 
template<typename TYPE >
std::unique_ptr< TYPECreateRaw ()
 
void DestroyAll ()
 
auto constContainers () const
 
auto constDebugStore () const
 

Public Attributes

Lifetime DefaultLifetime
 

Detailed Description

TODO: Split into ContainerBuilder and Container (or [Dependency]Registry and [Dependency]Container) Oooh, idea: Container container = Container(Registry1(), Registry2(), ...);.

Definition at line 50 of file di.h.

Member Function Documentation

◆ Containers()

auto const & ghassanpl::di::Container::Containers ( ) const
inline

Definition at line 87 of file di.h.

◆ Create()

template<typename TYPE >
std::shared_ptr< TYPE > ghassanpl::di::Container::Create

Other.

Definition at line 410 of file di_impl.h.

◆ CreateRaw()

template<typename TYPE >
std::unique_ptr< TYPE > ghassanpl::di::Container::CreateRaw

Definition at line 416 of file di_impl.h.

◆ DebugStore()

auto const & ghassanpl::di::Container::DebugStore ( ) const
inline

Definition at line 88 of file di.h.

◆ DestroyAll()

void ghassanpl::di::Container::DestroyAll ( )
inline

Definition at line 81 of file di.h.

◆ HasAnyImplementationsOf()

template<typename INTERFACE >
bool ghassanpl::di::Container::HasAnyImplementationsOf

Definition at line 358 of file di_impl.h.

◆ RegisterType()

void ghassanpl::di::Container::RegisterType ( ARGS &&...  args)

Registers.

Definition at line 366 of file di_impl.h.

◆ Resolve()

template<typename INTERFACE >
std::shared_ptr< INTERFACE > ghassanpl::di::Container::Resolve

Resolves.

Definition at line 386 of file di_impl.h.

◆ ResolveAll()

template<typename INTERFACE >
std::vector< std::shared_ptr< INTERFACE > > ghassanpl::di::Container::ResolveAll

Definition at line 404 of file di_impl.h.

◆ ResolveByName()

template<typename INTERFACE >
std::shared_ptr< INTERFACE > ghassanpl::di::Container::ResolveByName ( std::string_view  name)

Definition at line 392 of file di_impl.h.

Member Data Documentation

◆ DefaultLifetime

Lifetime ghassanpl::di::Container::DefaultLifetime

Definition at line 52 of file di.h.