Sauce-0.10.1 A C++ Dependency Injection Framework

- Main Page
- Classes
- Files

- File List

resolved_binding.h
1 #ifndef SAUCE_INTERNAL_RESOLVED_BINDING_H_
2 #define SAUCE_INTERNAL_RESOLVED_BINDING_H_
3
4 #include <sauce/memory.h>
5 #include <sauce/named.h>
6 #include <sauce/internal/key.h>
7 #include <sauce/internal/type_id.h>
8 #include <sauce/internal/opaque_binding.h>
9
10 namespace sauce {
11
12 class Injector;
13
14 namespace internal {
15
19 template<typename Dependency>
20 class ResolvedBinding: public OpaqueBinding {
21 public:
22
23 typedef typename Key<Dependency>::Ptr IfacePtr;
24 typedef sauce::shared_ptr<ResolvedBinding<Dependency> > BindingPtr;
25
26 virtual ~ResolvedBinding() {}
27
31 NamedTypeId getKey() const {
32 return namedTypeIdOf<Dependency>(getName());
33 }
34
41 virtual void validateAcyclic(sauce::shared_ptr<Injector>, TypeIds &) const = 0;
42
48 virtual void get(IfacePtr &, BindingPtr, sauce::shared_ptr<Injector>) const = 0;
49
50 };
51
52 }
53
54 namespace i = ::sauce::internal;
55
56 }
57
58 #endif // SAUCE_INTERNAL_RESOLVED_BINDING_H_
sauce::internal::ResolvedBinding
A binding for an acknowledged interface.
Definition: resolved_binding.h:20
sauce::internal
Definition: binder.h:317
sauce::internal::OpaqueBinding::getName
virtual std::string getName() const =0
The dynamic name of this binding.
sauce::internal::ResolvedBinding::validateAcyclic
virtual void validateAcyclic(sauce::shared_ptr< Injector >, TypeIds &) const =0
Establish that further dependencies do not introduce cycles with ones already accumulated.
sauce::internal::OpaqueBinding
An opaque binding.
Definition: opaque_binding.h:33
sauce
Definition: binder.h:21
sauce::internal::ResolvedBinding::getKey
NamedTypeId getKey() const
The TypeId of the Dependency template parameter.
Definition: resolved_binding.h:31
sauce::internal::Key
A complete specification of a dependency request.
Definition: key.h:15