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

The base class of all actual binding implementations. More...

#include <sauce/internal/binding.h>

Inheritance diagram for sauce::internal::Binding< Dependency_, Scope >:
Inheritance graph
[legend]
Collaboration diagram for sauce::internal::Binding< Dependency_, Scope >:
Collaboration graph
[legend]

Public Types

typedef Key< Dependency_ >::Normalized Dependency
 
typedef Key< Dependency >::Ptr IfacePtr
 
typedef ResolvedBinding< Dependency >::BindingPtr BindingPtr
 
- Public Types inherited from sauce::internal::ResolvedBinding< Dependency_ >
typedef Key< Dependency_ >::Ptr IfacePtr
 
typedef sauce::shared_ptr< ResolvedBinding< Dependency_ > > BindingPtr
 

Public Member Functions

std::string getName () const
 The dynamic name of this binding. More...
 
void setName (std::string const name)
 Set the dynamic name of this binding. More...
 
- Public Member Functions inherited from sauce::internal::ResolvedBinding< Dependency_ >
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.
 

Additional Inherited Members

- Protected Member Functions inherited from sauce::internal::InjectorFriend
template<typename Dependency >
void validateAcyclicHelper (InjectorPtr injector, TypeIds &ids, std::string const name) const
 
template<typename Dependency >
void injectHelper (typename Key< Dependency >::Ptr &injected, InjectorPtr injector, std::string const name) const
 
template<typename Dependency >
void cache (InjectorPtr injector, typename Key< Dependency >::Ptr injected, i::TypeId scope) const
 
template<typename Dependency >
bool probe (InjectorPtr injector, typename Key< Dependency >::Ptr &injected, i::TypeId scope) const
 

Detailed Description

template<typename Dependency_, typename Scope>
class sauce::internal::Binding< Dependency_, Scope >

The base class of all actual binding implementations.

Constructor & Destructor Documentation

◆ Binding()

template<typename Dependency_ , typename Scope >
sauce::internal::Binding< Dependency_, Scope >::Binding ( )
inline
95 :
96 name(unnamed()) {}

◆ ~Binding()

template<typename Dependency_ , typename Scope >
virtual sauce::internal::Binding< Dependency_, Scope >::~Binding ( )
inlinevirtual
98{}

Member Function Documentation

◆ getName()

template<typename Dependency_ , typename Scope >
std::string sauce::internal::Binding< Dependency_, Scope >::getName ( ) const
inlinevirtual

The dynamic name of this binding.

Implements sauce::internal::OpaqueBinding.

103 {
104 return name;
105 }

◆ setName()

template<typename Dependency_ , typename Scope >
void sauce::internal::Binding< Dependency_, Scope >::setName ( std::string const  name)
inlinevirtual

Set the dynamic name of this binding.

Implements sauce::internal::OpaqueBinding.

110 {
111 this->name = name;
112 }

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