Sauce-0.10.1
A C++ Dependency Injection Framework
Public Member Functions | List of all members
sauce::NamedClause< Dependency > Class Template Reference

Names the binding. More...

#include <sauce/binder.h>

Inheritance diagram for sauce::NamedClause< Dependency >:
Inheritance graph
[legend]
Collaboration diagram for sauce::NamedClause< Dependency >:
Collaboration graph
[legend]

Public Member Functions

ToInstanceClause< Dependency > toInstance (IfacePtr iface)
 
template<typename Method >
ToMethodClause< Dependency, Method > toMethod (Method method)
 
template<typename Signature >
ToMethodNamingClause< Dependency, Signature > toMethodNaming (typename ToMethodNamingClause< Dependency, Signature >::Method method)
 
template<typename SetDependency >
ToMethodNamingClause< Dependency, void(Iface::*)(SetDependency)> setting (typename ToMethodNamingClause< Dependency, void(Iface::*)(SetDependency)>::Method method, std::string name=unnamed())
 
template<typename Iface , typename Name >
ToMethodNamingClause< Dependency, void(Iface::*)(Named< Iface, Name >)> setting (typename ToMethodNamingClause< Dependency, void(Iface::*)(Named< Iface, Name >)>::Method method)
 
template<typename Scope >
InClause< Dependency, Scope > in ()
 
template<typename Ctor >
ToClause< Dependency, NoScope, Ctor > to ()
 
template<typename ProviderCtor >
ToProviderClause< ProviderDependency, NoScope, ProviderCtor > toProvider ()
 
- Public Member Functions inherited from sauce::internal::Clause< Dependency >
Clause< Dependency > & naming (unsigned int position, std::string const name)
 
void setState (ClauseStatePtr state)
 

Additional Inherited Members

- Protected Member Functions inherited from sauce::internal::Clause< Dependency >
virtual void onComplete ()
 
 Clause (ClauseStatePtr state)
 
ClauseStatePtr getState ()
 
template<typename Next >
Next pass (Next next)
 
void setDynamicName (std::string const name)
 
template<typename Exception >
void throwLater (Exception)
 
void bindDynamicDependencyName (unsigned int position, std::string const name)
 

Detailed Description

template<typename Dependency>
class sauce::NamedClause< Dependency >

Names the binding.

There are two kinds of names: static and dynamic. Static names are given by template parameter type tags. Dynamic ones are string arguments. Each binding can use only one kind, but bindings using both kinds can be mixed in the same module.

Member Function Documentation

◆ in()

template<typename Dependency >
template<typename Scope >
InClause< Dependency, Scope > sauce::NamedClause< Dependency >::in ( )
inline
226 {
227 return this->pass(InClause<Dependency, Scope>());
228 }

◆ setting() [1/2]

template<typename Dependency >
template<typename Iface , typename Name >
ToMethodNamingClause< Dependency, void(Iface::*)(Named< Iface, Name >)> sauce::NamedClause< Dependency >::setting ( typename ToMethodNamingClause< Dependency, void(Iface::*)(Named< Iface, Name >)>::Method  method)
inline
221 {
222 return this->pass(ToMethodNamingClause<Dependency, void(Iface::*) (Named<Iface, Name>)>(method));
223 }

◆ setting() [2/2]

template<typename Dependency >
template<typename SetDependency >
ToMethodNamingClause< Dependency, void(Iface::*)(SetDependency)> sauce::NamedClause< Dependency >::setting ( typename ToMethodNamingClause< Dependency, void(Iface::*)(SetDependency)>::Method  method,
std::string  name = unnamed() 
)
inline
212 {
213 ToMethodNamingClause<Dependency, void(Iface::*) (SetDependency)> toMethodNamingClause(method);
214 toMethodNamingClause = this->pass(toMethodNamingClause);
215 toMethodNamingClause.bindDynamicDependencyName(0, name);
216 return toMethodNamingClause;
217 }

◆ to()

template<typename Dependency >
template<typename Ctor >
ToClause< Dependency, NoScope, Ctor > sauce::NamedClause< Dependency >::to ( )
inline
231 {
232 return this->pass(ToClause<Dependency, NoScope, Ctor>());
233 }

◆ toInstance()

template<typename Dependency >
ToInstanceClause< Dependency > sauce::NamedClause< Dependency >::toInstance ( IfacePtr  iface)
inline
194 {
195 return this->pass(ToInstanceClause<Dependency>(iface));
196 }

◆ toMethod()

template<typename Dependency >
template<typename Method >
ToMethodClause< Dependency, Method > sauce::NamedClause< Dependency >::toMethod ( Method  method)
inline
199 {
200 return this->pass(ToMethodClause<Dependency, Method>(method));
201 }

◆ toMethodNaming()

template<typename Dependency >
template<typename Signature >
ToMethodNamingClause< Dependency, Signature > sauce::NamedClause< Dependency >::toMethodNaming ( typename ToMethodNamingClause< Dependency, Signature >::Method  method)
inline
205 {
206 return this->pass(ToMethodNamingClause<Dependency, Signature>(method));
207 }

◆ toProvider()

template<typename Dependency >
template<typename ProviderCtor >
ToProviderClause< ProviderDependency, NoScope, ProviderCtor > sauce::NamedClause< Dependency >::toProvider ( )
inline
236 {
237 return this->pass(ToProviderClause<ProviderDependency, NoScope, ProviderCtor>());
238 }

The documentation for this class was generated from the following file: