Public Types | Public Member Functions
TFactoryPluginHandler< I > Class Template Reference

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

#include <mia/core/factory.hh>

Inheritance diagram for TFactoryPluginHandler< I >:
TPluginHandler< I > CPluginHandlerBase

Public Types

typedef I::Product Product
 The type of the the object this plug in hander produces. More...
 
typedef I::SharedProduct ProductPtr
 The shared pointer type of the the object this plug in hander produces. More...
 
typedef I::UniqueProduct UniqueProduct
 The unique pointer type of the the object this plug in hander produces. More...
 
- Public Types inherited from TPluginHandler< I >
typedef CPluginMap::const_iterator const_iterator
 the iterator to walk over the available plug-ins More...
 
typedef std::map< std::string,
Interface * > 
CPluginMap
 a map containing the names and theavailabe plug-ins More...
 
typedef I Interface
 typedef for the plug-in interface provided by the class More...
 

Public Member Functions

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
 
- Public Member Functions inherited from TPluginHandler< I >
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 std::string &descriptor)
 
 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, xmlpp::Element *root) const
 
void get_xml_help (xmlpp::Element *root) const
 
CPluginHandlerBaseoperator= (const CPluginHandlerBase &other)=delete
 
void print_help (std::ostream &os) const
 
void print_short_help (std::ostream &os) const
 
virtual ~CPluginHandlerBase ()
 

Protected Member Functions

Constructors
 TFactoryPluginHandler ()
 Initializes the plugin handler. More...
 
- Protected Member Functions inherited from TPluginHandler< I >
void add_plugin (Interface *plugin)
 
void initialise (CPathNameArray searchpath)
 
TPluginHandler< I >::Interfaceplugin (const char *plugin) const
 
 TPluginHandler ()
 Initializes the plugin handler based on the build-in search path. More...
 

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 93 of file factory.hh.

Member Typedef Documentation

template<typename I>
typedef I::Product TFactoryPluginHandler< I >::Product

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

Definition at line 105 of file factory.hh.

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 108 of file factory.hh.

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 111 of file factory.hh.

Constructor & Destructor Documentation

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

Initializes the plugin handler.

Definition at line 198 of file factory.hh.

References TFactoryPluginHandler< I >::set_caching().

Member Function Documentation

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
plugindescrthe description of the plug-in
Returns
a shared pointer containing the product of the plug-in according to the description

Definition at line 213 of file factory.hh.

References cvdebug().

template<typename I>
ProductPtr TFactoryPluginHandler< I >::produce ( const char *  plugindescr) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 122 of file factory.hh.

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
plugindescrthe description of the plug-in
Returns
a unique pointer of the product of the plug-in according to the description

Definition at line 226 of file factory.hh.

template<typename I>
UniqueProduct TFactoryPluginHandler< I >::produce_unique ( const char *  plugindescr) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 136 of file factory.hh.

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 205 of file factory.hh.

References cvdebug().

Referenced by TFactoryPluginHandler< I >::TFactoryPluginHandler().


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