Sauce-0.10.1
A C++ Dependency Injection Framework
Public Member Functions | List of all members
sauce::internal::OpaqueBinding Class Referenceabstract

An opaque binding. More...

#include <sauce/internal/opaque_binding.h>

Inheritance diagram for sauce::internal::OpaqueBinding:
sauce::internal::ResolvedBinding< Dependency_ > sauce::internal::ResolvedBinding< Key< Injector >::Normalized > sauce::internal::ResolvedBinding< Named< Provider< Dependency >, Name > > sauce::internal::ResolvedBinding< Normalized > sauce::internal::ResolvedBinding< Dependency > sauce::internal::Binding< Dependency_, Scope > sauce::internal::Binding< Key< Injector >::Normalized, NoScope > sauce::internal::Binding< Named< Provider< Dependency >, Name >, NoScope > sauce::internal::Binding< Dependency, NoScope > sauce::internal::Binding< Dependency, Scope > sauce::internal::InjectorBinding sauce::internal::ImplicitProviderBinding< Dependency, Name > sauce::internal::InstanceBinding< Dependency > sauce::internal::MethodBinding< Dependency, Signature > sauce::internal::NewBinding< Dependency, Scope, Constructor, Allocator > sauce::internal::ProviderBinding< Dependency, Scope, Provider >

Public Member Functions

virtual std::string getName () const =0
 The dynamic name of this binding.
 
virtual void setName (std::string)=0
 Set the dynamic name of this binding.
 
virtual NamedTypeId getKey () const =0
 The NamedTypeId of the (hidden) provided interface.
 
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

An opaque binding.

Bindings associate an interface with an implementation. How that provision comes about is determine by derived types. Binding itself is a pure interface.

To be type-homogenous, OpaqueBinding is not a template, and particularly not a template of any specific interface or implementation types. It however has a TypeId, which indirectly identifies the interface it is bound to. The interface is raised to the type system in ResolvedBinding, a class template deriving from OpaqueBinding.

Member Function Documentation

virtual void sauce::internal::OpaqueBinding::eagerlyInject ( OpaqueBindingPtr  ,
sauce::shared_ptr< Injector  
) const
pure virtual

Provide, but do not return the hidden interface.

Instead, cache the instance in its appropriate scope, if any. If the binding is not scoped, do nothing.

virtual bool sauce::internal::OpaqueBinding::isModifier ( ) const
inlinevirtual

Does this binding modify an existing value?

If not, it must provide a new value, and so is "providing" binding.

58  {
59  return false;
60  }

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