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>
26template<
typename Dependency,
typename Scope,
typename Ctor,
typename Allocator>
28 virtual void onComplete() {
30 this->getState()->bind(pendingBinding);
37template<
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>
57template<
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>
83template<
typename Dependency,
typename Scope>
91 template<
typename Ctor>
96 template<
typename Prov
iderCtor>
102template<
typename Dependency>
105template<
typename Iface>
111template<
typename Dependency,
typename Signature>
114 typedef typename MethodBinding_::Method Method;
118 friend class BindClause<typename i::Key<Dependency>::Iface>;
122 this->getState()->bind(methodBinding);
133template<
typename Dependency,
typename Signature>
136 typedef typename MethodBinding_::Method Method;
140 friend class BindClause<typename i::Key<Dependency>::Iface>;
144 this->getState()->bind(methodBinding);
160template<
typename Dependency>
168 this->getState()->bind(instanceBinding);
185template<
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>
246template<
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>
318class ImplicitBindings;
331 bindings(bindings) {}
338 template<
typename Iface>
340 i::ClauseStatePtr clauseState(
new i::ClauseState(bindings, *
this));
Binds to a specific constructor and allocator.
Definition: binder.h:27
A builder that creates a single binding.
Definition: binder.h:247
Passed to modules to create bindings.
Definition: binder.h:324
BindClause< Iface > bind()
Begin binding the chosen interface.
Definition: binder.h:339
Scopes the binding.
Definition: binder.h:84
A factory that accepts Modules and creates Injectors.
Definition: modules.h:77
Names the binding.
Definition: binder.h:186
Wrap dependency requests with Named to choose one of several (statically) named alternatives.
Definition: named.h:12
The scope of unscoped bindings.
Definition: scopes.h:11
An interface for including custom factories in an Injector.
Definition: provider.h:21
i::Key< Dependency >::Iface Provides
Indicates to template magic that this type exposes sauce::shared_ptr<Provides> get().
Definition: provider.h:27
Binds to a specific constructor, allocating from the heap.
Definition: binder.h:38
Binds to a specific single instance.
Definition: binder.h:161
Binds to a specific method.
Definition: binder.h:112
Binds to a specific method with possible static dependency names.
Definition: binder.h:134
Binds to a provider with a specific constructor, allocating from the heap.
Definition: binder.h:58
The name of all statically unnamed dependencies.
Definition: named.h:17
A container for bindings.
Definition: bindings.h:50
Base class for parts of the fluent binding API.
Definition: clause.h:98
The accumulated state passed between Clauses that ultimately results in a new Binding.
Definition: clause.h:26
An injection that provides the value passed at construction.
Definition: instance_binding.h:17
A complete specification of a dependency request.
Definition: key.h:15
Definition: method_binding.h:14
Definition: new_binding.h:19
A mixin to defer and throw pending exceptions.
Definition: pending_thrower.h:23
An injection that provides from the configured provider.
Definition: provider_binding.h:18