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

Binds to a specific single instance. More...

#include <sauce/binder.h>

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

Public Member Functions

 ToInstanceClause (IfacePtr iface)
 
- 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::ToInstanceClause< Dependency >

Binds to a specific single instance.

By virtue of always returning the passed instance, this dependency is inheretingly singleton scoped. It also means there is no need to use the actual singleton scope cache, and so we actually declare it as NoScope here.

The constructor template parameter is unused, but a default constructor for the interface is assumed.

Constructor & Destructor Documentation

◆ ToInstanceClause()

template<typename Dependency >
sauce::ToInstanceClause< Dependency >::ToInstanceClause ( IfacePtr  iface)
inline
173 :
175 iface(iface) {}
Base class for parts of the fluent binding API.
Definition: clause.h:98

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