My Project
TPluginHandler< I > Class Template Reference

The basic template of all plugin handlers. More...

#include <mia/core/handler.hh>

Inheritance diagram for TPluginHandler< I >:
[legend]
Collaboration diagram for TPluginHandler< I >:
[legend]

Public Types

typedef CPluginMap::const_iterator const_iterator
 the iterator to walk over the available plug-ins
typedef std::map< std::string, PInterfaceCPluginMap
 a map containing the names and the available plug-ins
typedef I Interface
 typedef for the plug-in interface provided by the class
typedef std::shared_ptr< I > PInterface

Public Member Functions

bool add_plugin (PInterface plugin)
const_iterator begin () const
const_iterator end () const
const std::string get_plugin_names () const
const std::set< std::string > get_set () const
size_t size () const
virtual ~TPluginHandler ()
Public Member Functions inherited from CPluginHandlerBase
void add_dependend_handlers (HandlerHelpMap &handler_map) const
 CPluginHandlerBase (const char *data_descr, const char *type_descr)
 CPluginHandlerBase (const CPluginHandlerBase &other)=delete
const std::string & get_descriptor () const
std::string get_handler_type_string () const
void get_string_help_description_xml (std::ostream &os, CXMLElement &root) const
void get_xml_help (CXMLElement &root) const
CPluginHandlerBaseoperator= (const CPluginHandlerBase &other)=delete
void print_help (std::ostream &os) const
void print_short_help (std::ostream &os) const
bool validate_parameter_string (const std::string &s) const
virtual ~CPluginHandlerBase ()

Protected Member Functions

void add_plugin_internal (PInterface plugin)

Constructors

 TPluginHandler ()
 Initializes the plugin handler based on the build-in search path.
TPluginHandler< I >::Interfaceplugin (const char *plugin) const
void initialise (const CPluginSearchpath &searchpath)

Detailed Description

template<typename I>
class TPluginHandler< I >

The basic template of all plugin handlers.

The template TPluginHandler provides the base interface to all plug-in handlers.

Template Parameters
Ithe plugin interface derived from
See also
CPluginBase.

Definition at line 56 of file handler.hh.

Member Typedef Documentation

◆ const_iterator

template<typename I>
typedef CPluginMap::const_iterator TPluginHandler< I >::const_iterator

the iterator to walk over the available plug-ins

Definition at line 68 of file handler.hh.

◆ CPluginMap

template<typename I>
typedef std::map<std::string, PInterface> TPluginHandler< I >::CPluginMap

a map containing the names and the available plug-ins

Definition at line 65 of file handler.hh.

◆ Interface

template<typename I>
typedef I TPluginHandler< I >::Interface

typedef for the plug-in interface provided by the class

Definition at line 60 of file handler.hh.

◆ PInterface

template<typename I>
typedef std::shared_ptr<I> TPluginHandler< I >::PInterface

Definition at line 62 of file handler.hh.

Constructor & Destructor Documentation

◆ ~TPluginHandler()

template<typename I>
virtual TPluginHandler< I >::~TPluginHandler ( )
virtual

The destructor frees the modules and plug-ins

◆ TPluginHandler()

template<typename I>
TPluginHandler< I >::TPluginHandler ( )
protected

Initializes the plugin handler based on the build-in search path.

Member Function Documentation

◆ add_plugin()

template<typename I>
bool TPluginHandler< I >::add_plugin ( PInterface plugin)

Add a given plug-in to the handler.

Parameters
plugin
Returns
true if the plug-in was added, false if a plug-in with a higher or equal priority and the same name already existed.

◆ add_plugin_internal()

template<typename I>
void TPluginHandler< I >::add_plugin_internal ( PInterface plugin)
protected

Add a given plug-in to the handler. The pointer must not be freed in client code.

Parameters
plugin

◆ begin()

◆ end()

template<typename I>
const_iterator TPluginHandler< I >::end ( ) const
Returns
the behind-end iterator to the plug-ins

Referenced by range_iterator< T >::end(), T2DImage< bool >::end(), and T3DImage< bool >::end().

◆ get_plugin_names()

template<typename I>
const std::string TPluginHandler< I >::get_plugin_names ( ) const
Returns
the names of the plug-ins as a space delimited string, ordered case sensitive and alphabetically.

◆ get_set()

template<typename I>
const std::set< std::string > TPluginHandler< I >::get_set ( ) const
Returns
the names of the plug-ins as a set

◆ initialise()

template<typename I>
void TPluginHandler< I >::initialise ( const CPluginSearchpath & searchpath)
protected

◆ plugin()

template<typename I>
TPluginHandler< I >::Interface * TPluginHandler< I >::plugin ( const char * plugin) const
protected

find a plugin by name. If the plug-in is not available, the method throws an invalid_argument exception.

Parameters
pluginname of the plugin
Returns
pointer to the plug-in

◆ size()

template<typename I>
size_t TPluginHandler< I >::size ( ) const
Returns
the number of available plug-ins

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