Sauce-0.10.1
A C++ Dependency Injection Framework
|
An opaque binding. More...
#include <sauce/internal/opaque_binding.h>
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. | |
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.
|
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.
|
inlinevirtual |