Lunchbox
1.14.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
Manages a class deriving from a T interface. More...
#include <plugin.h>
Public Types | |
typedef std::function< T *(const typename T::InitDataT &)> | Constructor |
The constructor method / concrete factory for Plugin objects. More... | |
typedef std::function< bool(const typename T::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 |
T * | construct (const typename T::InitDataT &data) |
Construct a new plugin instance. More... | |
bool | handles (const typename T::InitDataT &data) |
Manages a class deriving from a T interface.
Plugin classes deriving from T must implement the following prototype for their constructor:
T must also implement the following method to be registered:
Note this requires a 'typedef [foo] InitDataT' in T.
typedef std::function< T* ( const typename T::InitDataT& )> lunchbox::Plugin< T >::Constructor |
typedef std::function< bool ( const typename T::InitDataT& )> lunchbox::Plugin< T >::HandlesFunc |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |