1 #ifndef SAUCE_INTERNAL_IMPLICIT_BINDINGS_H_
2 #define SAUCE_INTERNAL_IMPLICIT_BINDINGS_H_
7 #include <sauce/exceptions.h>
8 #include <sauce/injector.h>
9 #include <sauce/memory.h>
10 #include <sauce/provider.h>
11 #include <sauce/scopes.h>
12 #include <sauce/internal/resolved_binding.h>
13 #include <sauce/internal/binding.h>
14 #include <sauce/internal/bindings.h>
15 #include <sauce/internal/key.h>
20 class ImplicitBindings;
22 typedef Bindings<ImplicitBindings> Concrete;
24 template<
typename ImplicitInjection_>
27 typedef ImplicitInjection_ ImplicitInjection;
28 typedef typename ImplicitInjection::Dependency Dependency;
29 typedef typename ResolvedBinding<Dependency>::BindingPtr BindingPtr;
35 template<
typename Dependency>
39 typedef sauce::shared_ptr<ResolvedBinding<Dependency> > BindingPtr;
44 static BindingPtr
get(
Concrete const &, std::string
const name) {
59 template<
typename Dependency>
61 Concrete const & bindings, std::string
const name)
const {
68 template<
typename Dependency>
69 std::vector<sauce::shared_ptr<ResolvedBinding<Dependency> > >
getModifyings(
70 Concrete const &, std::string
const)
const {
71 return std::vector<sauce::shared_ptr<ResolvedBinding<Dependency> > >();
82 static BindingPtr
get(
Concrete const &, std::string
const name) {
83 if (name != unnamed()) {
94 template<
typename Prov
idedDependency,
typename Name>
98 typedef typename Traits::ImplicitInjection ImplicitInjection;
99 typedef typename Traits::Dependency Dependency;
100 typedef typename Traits::BindingPtr BindingPtr;
102 static BindingPtr
get(
Concrete const & bindings, std::string
const name) {
106 ProvidedBindingPtr providedBinding(bindings.getProvidingBinding<Normalized>(name));
107 BindingPtr binding(
new ImplicitInjection(providedBinding));
114 namespace i = ::sauce::internal;
118 #endif // SAUCE_INTERNAL_IMPLICIT_BINDINGS_H_