Image Component Library (ICL)
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
icl::utils::PluginRegister< T > Class Template Reference

Utility class for plugin registration. More...

#include <PluginRegister.h>

Classes

struct  Plugin
 internally used instance type: More...
 

Public Types

typedef std::map< std::string, std::string > Data
 data used for instance creation More...
 
typedef utils::Function< T *, const Data & > CreateFunction
 creator function for instances More...
 

Public Member Functions

void add (const std::string &name, CreateFunction create, const std::string &description, const std::string &creationSyntax)
 adds a new plugin More...
 
T * createInstance (const std::string &name, const Data &data)
 creates an instance (or throws More...
 
std::string getRegisteredInstanceDescription ()
 returns a string representation of all registered types More...
 
const std::map< std::string, Plugin > & getRegisteredPlugins () const
 returns a all registered plugins More...
 

Static Public Member Functions

static PluginRegister< T > & instance ()
 returns the static instance for the specific type More...
 

Private Member Functions

 PluginRegister ()
 private constructor (use singelton creator function instance()) More...
 

Private Attributes

std::map< std::string, Pluginplugins
 internal plugin list More...
 

Detailed Description

template<class T>
class icl::utils::PluginRegister< T >

Utility class for plugin registration.

Member Typedef Documentation

◆ CreateFunction

template<class T>
typedef utils::Function<T*,const Data&> icl::utils::PluginRegister< T >::CreateFunction

creator function for instances

◆ Data

template<class T>
typedef std::map<std::string,std::string> icl::utils::PluginRegister< T >::Data

data used for instance creation

Constructor & Destructor Documentation

◆ PluginRegister()

template<class T>
icl::utils::PluginRegister< T >::PluginRegister ( )
inlineprivate

private constructor (use singelton creator function instance())

Member Function Documentation

◆ add()

template<class T>
void icl::utils::PluginRegister< T >::add ( const std::string &  name,
CreateFunction  create,
const std::string &  description,
const std::string &  creationSyntax 
)
inline

adds a new plugin

◆ createInstance()

template<class T>
T* icl::utils::PluginRegister< T >::createInstance ( const std::string &  name,
const Data data 
)
inline

creates an instance (or throws

◆ getRegisteredInstanceDescription()

template<class T>
std::string icl::utils::PluginRegister< T >::getRegisteredInstanceDescription ( )
inline

returns a string representation of all registered types

◆ getRegisteredPlugins()

template<class T>
const std::map<std::string,Plugin>& icl::utils::PluginRegister< T >::getRegisteredPlugins ( ) const
inline

returns a all registered plugins

◆ instance()

template<class T>
static PluginRegister<T>& icl::utils::PluginRegister< T >::instance ( )
inlinestatic

returns the static instance for the specific type

Member Data Documentation

◆ plugins

template<class T>
std::map<std::string,Plugin> icl::utils::PluginRegister< T >::plugins
private

internal plugin list


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