Lunchbox  1.13.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
lunchbox::Plugin< PluginT, InitDataT > Class Template Reference

Manages a class deriving from a PluginT interface. More...

#include <plugin.h>

+ Collaboration diagram for lunchbox::Plugin< PluginT, InitDataT >:

Public Types

typedef boost::function< PluginT *(const InitDataT &) > Constructor
 The constructor method / concrete factory for Plugin objects. More...
 
typedef boost::function< bool(const InitDataT &) > HandlesFunc
 The method to check if the plugin can handle a given initData. More...
 

Public Member Functions

 Plugin (const Constructor &constructor_, const HandlesFunc &handles_)
 Construct a new Plugin. More...
 
bool operator== (const Plugin &rhs) const
 
bool operator!= (const Plugin &rhs) const
 

Friends

class PluginFactory< PluginT, InitDataT >
 

Detailed Description

template<class PluginT, class InitDataT = servus::URI>
class lunchbox::Plugin< PluginT, InitDataT >

Manages a class deriving from a PluginT interface.

Plugin classes deriving from PluginT must implement the following prototype for their constructor:

DerivedPluginClass( const InitDataT& initData );

PluginT must also implement the following method to be registered:

static bool handles( const InitDataT& initData );
Version
1.11.0

Definition at line 47 of file plugin.h.

Member Typedef Documentation

template<class PluginT, class InitDataT = servus::URI>
typedef boost::function< PluginT* ( const InitDataT& ) > lunchbox::Plugin< PluginT, InitDataT >::Constructor

The constructor method / concrete factory for Plugin objects.

Version
1.11.0

Definition at line 54 of file plugin.h.

template<class PluginT, class InitDataT = servus::URI>
typedef boost::function< bool ( const InitDataT& ) > lunchbox::Plugin< PluginT, InitDataT >::HandlesFunc

The method to check if the plugin can handle a given initData.

Version
1.11.0

Definition at line 60 of file plugin.h.

Constructor & Destructor Documentation

template<class PluginT, class InitDataT = servus::URI>
lunchbox::Plugin< PluginT, InitDataT >::Plugin ( const Constructor constructor_,
const HandlesFunc handles_ 
)
inline

Construct a new Plugin.

Parameters
constructor_The constructor method for Plugin objects.
handles_The method to check if the plugin can handle the initData.
Version
1.11.0

Definition at line 69 of file plugin.h.

Member Function Documentation

template<class PluginT, class InitDataT = servus::URI>
bool lunchbox::Plugin< PluginT, InitDataT >::operator!= ( const Plugin< PluginT, InitDataT > &  rhs) const
inline
Returns
false if the plugins do wrap the same plugin.
Version
1.11.0

Definition at line 78 of file plugin.h.

template<class PluginT, class InitDataT = servus::URI>
bool lunchbox::Plugin< PluginT, InitDataT >::operator== ( const Plugin< PluginT, InitDataT > &  rhs) const
inline
Returns
true if the plugins wrap the same plugin.
Version
1.11.0

Definition at line 74 of file plugin.h.


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