1 #ifndef SAUCE_BINDER_H_
2 #define SAUCE_BINDER_H_
8 #include <sauce/named.h>
9 #include <sauce/provider.h>
10 #include <sauce/scopes.h>
11 #include <sauce/internal/bindings.h>
12 #include <sauce/internal/clause.h>
13 #include <sauce/internal/implicit_provider_binding.h>
14 #include <sauce/internal/injector_binding.h>
15 #include <sauce/internal/key.h>
16 #include <sauce/internal/new_binding.h>
17 #include <sauce/internal/opaque_binding.h>
18 #include <sauce/internal/pending_thrower.h>
19 #include <sauce/internal/provider_binding.h>
26 template<
typename Dependency,
typename Scope,
typename Ctor,
typename Allocator>
28 virtual void onComplete() {
30 this->getState()->bind(pendingBinding);
37 template<
typename Dependency,
typename Scope,
typename Ctor>
41 virtual void onComplete() {
42 i::OpaqueBindingPtr pendingBinding(
new i::NewBinding<Dependency, Scope, Ctor, std::allocator<int> >());
43 this->getState()->bind(pendingBinding);
48 template<
typename Allocator>
57 template<
typename Prov
iderDependency,
typename Scope,
typename Prov
iderCtor>
65 i::OpaqueBindingPtr pendingBinding(
new i::NewBinding<ProviderDependency, Scope, ProviderCtor, std::allocator<int> >());
66 this->getState()->bind(pendingBinding);
69 this->getState()->bindProvider(providerBinding);
74 template<
typename Allocator>
83 template<
typename Dependency,
typename Scope>
91 template<
typename Ctor>
96 template<
typename Prov
iderCtor>
102 template<
typename Dependency>
105 template<
typename Iface>
111 template<
typename Dependency,
typename Signature>
114 typedef typename MethodBinding_::Method Method;
118 friend class BindClause<typename i::Key<Dependency>::Iface>;
122 this->getState()->bind(methodBinding);
133 template<
typename Dependency,
typename Signature>
136 typedef typename MethodBinding_::Method Method;
140 friend class BindClause<typename i::Key<Dependency>::Iface>;
144 this->getState()->bind(methodBinding);
160 template<
typename Dependency>
168 this->getState()->bind(instanceBinding);
185 template<
typename Dependency>
198 template<
typename Method>
203 template<
typename Signature>
205 typename ToMethodNamingClause<Dependency, Signature>::Method method) {
209 template<
typename SetDependency>
212 std::string name = unnamed()) {
214 toMethodNamingClause = this->pass(toMethodNamingClause);
215 toMethodNamingClause.bindDynamicDependencyName(0, name);
216 return toMethodNamingClause;
219 template<
typename Iface,
typename Name>
225 template<
typename Scope>
230 template<
typename Ctor>
235 template<
typename Prov
iderCtor>
246 template<
typename Iface>
258 template<
typename Name>
264 this->setDynamicName(name);
272 template<
typename Method>
277 template<
typename Signature>
283 template<
typename SetDependency>
286 std::string name = unnamed()) {
288 toMethodNamingClause = this->pass(toMethodNamingClause);
289 toMethodNamingClause.bindDynamicDependencyName(0, name);
290 return toMethodNamingClause;
293 template<
typename SetIface,
typename Name>
299 template<
typename Scope>
304 template<
typename Ctor>
309 template<
typename Prov
iderCtor>
318 class ImplicitBindings;
331 bindings(bindings) {}
338 template<
typename Iface>
340 i::ClauseStatePtr clauseState(
new i::ClauseState(bindings, *
this));
348 #endif // SAUCE_BINDER_H_