Sauce-0.10.1
A C++ Dependency Injection Framework
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
sauce::AbstractModule Class Referenceabstract

A base class that modules implemented as classes might derive from. More...

#include <sauce/modules.h>

Public Member Functions

void operator() (Binder &binder) const
 

Protected Member Functions

virtual void configure () const =0
 Override in derived classes to declare bindings.
 
template<typename Iface >
BindClause< Iface > bind () const
 Begin binding the chosen interface. More...
 

Friends

class BinderGuard
 

Detailed Description

A base class that modules implemented as classes might derive from.

Such a module would override configure() and call bind() directly, instead of handling an explicit Binder.

Constructor & Destructor Documentation

◆ AbstractModule()

sauce::AbstractModule::AbstractModule ( )
inlineprotected
48 :
49 binder(NULL) {}

◆ ~AbstractModule()

virtual sauce::AbstractModule::~AbstractModule ( )
inlinevirtual
66{}

Member Function Documentation

◆ bind()

template<typename Iface >
BindClause< Iface > sauce::AbstractModule::bind ( ) const
inlineprotected

Begin binding the chosen interface.

60 {
61 return binder->bind<Iface>();
62 }
BindClause< Iface > bind()
Begin binding the chosen interface.
Definition: binder.h:339
Here is the call graph for this function:

◆ operator()()

void sauce::AbstractModule::operator() ( Binder binder) const
inline
68 {
69 BinderGuard guard(this, &binder);
70 configure();
71 }
virtual void configure() const =0
Override in derived classes to declare bindings.

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