TFactoryPluginHandler< I > Class Template Reference
Plug-in handling

the Base class for all plugn handlers that deal with factory plugins. More...

`#include <mia/core/factory.hh>`

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

## Constructors

typedef I::Product | Product
| The type of the the object this plug in hander produces.
typedef I::SharedProduct | ProductPtr
| The shared pointer type of the the object this plug in hander produces.
typedef I::UniqueProduct | UniqueProduct
| The unique pointer type of the the object this plug in hander produces.
template<typename Handler, typename Chained, bool chainable>
struct | create_plugin
| TFactoryPluginHandler ()
| Initializes the plugin handler.
ProductPtr | produce (const std::string &plugindescr) const
ProductPtr | produce (const char *plugindescr) const
UniqueProduct | produce_unique (const std::string &plugindescr) const
UniqueProduct | produce_unique (const char *plugindescr) const
void | set_caching (bool enable) const

## Additional Inherited Members

Public Types inherited from TPluginHandler< I >
typedef CPluginMap::const_iterator | const_iterator
| the iterator to walk over the available plug-ins
typedef std::map< std::string, PInterface > | CPluginMap
| 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 inherited from TPluginHandler< I >
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
CPluginHandlerBase & | operator= (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 inherited from TPluginHandler< I >
void | add_plugin_internal (PInterface plugin)
| TPluginHandler ()
| Initializes the plugin handler based on the build-in search path.
TPluginHandler< I >::Interface * | plugin (const char *plugin) const
void | initialise (const CPluginSearchpath &searchpath)

## Detailed Description

template<typename I>
class TFactoryPluginHandler< I >

the Base class for all plugn handlers that deal with factory plugins.

Base class for all plugin handlers that are derived from TFactory.

Definition at line 94 of file factory.hh.

## Member Typedef Documentation

## Product

template<typename I>

typedef I::Product TFactoryPluginHandler< I >::Product

The type of the the object this plug in hander produces.

Definition at line 107 of file factory.hh.

## ProductPtr

template<typename I>

typedef I::SharedProduct TFactoryPluginHandler< I >::ProductPtr

The shared pointer type of the the object this plug in hander produces.

Definition at line 110 of file factory.hh.

## UniqueProduct

template<typename I>

typedef I::UniqueProduct TFactoryPluginHandler< I >::UniqueProduct

The unique pointer type of the the object this plug in hander produces.

Definition at line 113 of file factory.hh.

## Constructor & Destructor Documentation

## TFactoryPluginHandler()

template<typename I>

TFactoryPluginHandler< I >::TFactoryPluginHandler | ( |  | ) |

protected

Initializes the plugin handler.

Definition at line 210 of file factory.hh.

References CPluginHandlerBase::get_descriptor(), and set_caching().

## Member Function Documentation

## produce() [1/2]

template<typename I>

ProductPtr TFactoryPluginHandler< I >::produce | ( | const char * | plugindescr | ) | const

inline

Definition at line 124 of file factory.hh.

References produce().

## produce() [2/2]

template<typename I>

TFactoryPluginHandler< I >::ProductPtr TFactoryPluginHandler< I >::produce | ( | const std::string & | plugindescr | ) | const

Create an object according to the given description. If creation fails, the function will throw an invalid_argument exception

Parameters

  plugindescr | the description of the plug-in

Returns
  a shared pointer containing the product of the plug-in according to the description

Definition at line 225 of file factory.hh.

References cvdebug().

Referenced by produce().

## produce_unique() [1/2]

template<typename I>

UniqueProduct TFactoryPluginHandler< I >::produce_unique | ( | const char * | plugindescr | ) | const

inline

Definition at line 139 of file factory.hh.

References produce_unique().

## produce_unique() [2/2]

template<typename I>

TFactoryPluginHandler< I >::UniqueProduct TFactoryPluginHandler< I >::produce_unique | ( | const std::string & | plugindescr | ) | const

Create an object according to the given description. If creation fails, the function will throw an invalid_argument exception

Parameters

  plugindescr | the description of the plug-in

Returns
  a unique pointer of the product of the plug-in according to the description

Definition at line 240 of file factory.hh.

Referenced by produce_unique().

## set_caching()

template<typename I>

void TFactoryPluginHandler< I >::set_caching | ( | bool | enable | ) | const

Sets whether the created shared pointer products should be cached. Unique products will never be cached.

Parameters

  enable |

Definition at line 217 of file factory.hh.

References cvdebug(), and CPluginHandlerBase::get_descriptor().

Referenced by TFactoryPluginHandler().

## Friends And Related Symbol Documentation

## create_plugin

template<typename I>
template<typename Handler, typename Chained, bool chainable>

friend struct create_plugin

friend

Definition at line 164 of file factory.hh.

References create_plugin.

Referenced by create_plugin.

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

- factory.hh