Sauce-0.10.1
A C++ Dependency Injection Framework
Public Types | Public Member Functions | List of all members
sauce::internal::ResolvedBinding< Dependency > Class Template Referenceabstract

A binding for an acknowledged interface. More...

#include <sauce/internal/resolved_binding.h>

Inheritance diagram for sauce::internal::ResolvedBinding< Dependency >:
Inheritance graph
[legend]
Collaboration diagram for sauce::internal::ResolvedBinding< Dependency >:
Collaboration graph
[legend]

Public Types

typedef Key< Dependency >::Ptr IfacePtr
 
typedef sauce::shared_ptr< ResolvedBinding< Dependency > > BindingPtr
 

Public Member Functions

NamedTypeId getKey () const
 The TypeId of the Dependency template parameter. More...
 
virtual void validateAcyclic (sauce::shared_ptr< Injector >, TypeIds &) const =0
 Establish that further dependencies do not introduce cycles with ones already accumulated. More...
 
virtual void get (IfacePtr &, BindingPtr, sauce::shared_ptr< Injector >) const =0
 Get an Iface, using the given injector to provide dependencies. More...
 
- Public Member Functions inherited from sauce::internal::OpaqueBinding
virtual std::string getName () const =0
 The dynamic name of this binding. More...
 
virtual void setName (std::string)=0
 Set the dynamic name of this binding. More...
 
virtual NamedTypeId getKey () const =0
 The NamedTypeId of the (hidden) provided interface. More...
 
virtual bool isModifier () const
 Does this binding modify an existing value? More...
 
virtual TypeId getScopeKey () const =0
 The TypeId of the (hidden) scope.
 
virtual void eagerlyInject (OpaqueBindingPtr, sauce::shared_ptr< Injector >) const =0
 Provide, but do not return the hidden interface. More...
 
virtual void setDynamicDependencyNames (std::vector< std::string > const &)=0
 Accept the list of dynamic dependency names this binding was created with.
 

Detailed Description

template<typename Dependency>
class sauce::internal::ResolvedBinding< Dependency >

A binding for an acknowledged interface.

Constructor & Destructor Documentation

◆ ~ResolvedBinding()

template<typename Dependency >
virtual sauce::internal::ResolvedBinding< Dependency >::~ResolvedBinding ( )
inlinevirtual
26{}

Member Function Documentation

◆ get()

template<typename Dependency >
virtual void sauce::internal::ResolvedBinding< Dependency >::get ( IfacePtr &  ,
BindingPtr  ,
sauce::shared_ptr< Injector  
) const
pure virtual

Get an Iface, using the given injector to provide dependencies.

The binding pointer must point to this same binding instance.

◆ getKey()

template<typename Dependency >
NamedTypeId sauce::internal::ResolvedBinding< Dependency >::getKey ( ) const
inlinevirtual

The TypeId of the Dependency template parameter.

Implements sauce::internal::OpaqueBinding.

31 {
32 return namedTypeIdOf<Dependency>(getName());
33 }
virtual std::string getName() const =0
The dynamic name of this binding.
Here is the call graph for this function:

◆ validateAcyclic()

template<typename Dependency >
virtual void sauce::internal::ResolvedBinding< Dependency >::validateAcyclic ( sauce::shared_ptr< Injector ,
TypeIds &   
) const
pure virtual

Establish that further dependencies do not introduce cycles with ones already accumulated.

This is Tarjan's algorithm using the call stack. When a cycle is detected a CircularDependencyException is thrown.


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