TFactory< P > Class Template Referenceabstract
Plug-in handling

This is tha base of all plugins that create "things", like filters, cost functions time step operatores and the like. More...

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

Inheritance diagram for TFactory< P >:
[legend]
Collaboration diagram for TFactory< P >:
[legend]

## Public Types

typedef P | Product
| typedef to describe the product of the factory
typedef std::shared_ptr< P > | SharedProduct
| typedef for the shared version of the product
typedef std::unique_ptr< P > | UniqueProduct
| typedef for the unique version of the product
Public Types inherited from TPlugin< P::plugin_data, P::plugin_type >
typedef P::plugin_data | PlugData
| Typedef for the data type descriptor handled by this plug-in.
typedef P::plugin_type | PlugType
| Typedef for the plugin type descriptor handled by this plug-in.

## Public Member Functions

virtual Product * | create (const CParsedOptions &options, char const *params) __attribute__((warn_unused_result))
| TFactory (char const *const name)
Public Member Functions inherited from TPlugin< P::plugin_data, P::plugin_type >
virtual void | get_help (std::ostream &os) const
const std::string | get_long_name () const
| TPlugin (const char *name)
Public Member Functions inherited from CPluginBase
void | add_dependend_handlers (HandlerHelpMap &handler_map)
void | add_property (const char *property)
void | append_interface (CPluginBase *plugin)
| CPluginBase (const char *name)
PPluginModule | get_module () const
unsigned | get_priority () const
bool | has_property (const char *property) const
CPluginBase * | next_interface ()
void | set_module (const PPluginModule &module)
void | set_priority (unsigned p)
virtual | ~CPluginBase ()
Public Member Functions inherited from CParamTranslator
void | add_parameter (const std::string &name, CParameter *param)
void | check_parameters ()
| CParamTranslator (const char *name)
virtual void | do_get_help_xml (CXMLElement &root) const
const std::string | get_descr () const
void | get_help (std::ostream &os) const
void | get_help_xml (CXMLElement &root) const
const char * | get_name () const
void | get_short_help (std::ostream &os) const
void | set_parameters (const CParsedOptions &options)
virtual | ~CParamTranslator ()

## Additional Inherited Members

Static Public Member Functions inherited from TPlugin< P::plugin_data, P::plugin_type >
static const char * | get_data_path_part ()
static const char * | get_type_path_part ()
Protected Member Functions inherited from CParamTranslator
CParamList & | get_parameters ()

## Detailed Description

template<typename P>
class TFactory< P >

This is tha base of all plugins that create "things", like filters, cost functions time step operatores and the like.

This template is the model for all factory plugins, i.e. plugins that create certain objects.

Template Parameters

  P | the object type created by the factory.

Definition at line 49 of file factory.hh.

## Member Typedef Documentation

## Product

template<typename P>

typedef P TFactory< P >::Product

typedef to describe the product of the factory

Definition at line 55 of file factory.hh.

## SharedProduct

template<typename P>

typedef std::shared_ptr<P > TFactory< P >::SharedProduct

typedef for the shared version of the product

Definition at line 58 of file factory.hh.

## UniqueProduct

template<typename P>

typedef std::unique_ptr<P > TFactory< P >::UniqueProduct

typedef for the unique version of the product

Definition at line 62 of file factory.hh.

## Constructor & Destructor Documentation

## TFactory()

template<typename I>

TFactory< I >::TFactory | ( | char const *const | name | ) |

initialise the plugin by the names

Remarks
  what are these names and types good for?

Definition at line 173 of file factory.hh.

References TPlugin< P::plugin_data, P::plugin_type >::TPlugin().

Referenced by TDataFilterPlugin< C2DImage >::TDataFilterPlugin().

## Member Function Documentation

## create()

template<typename I>

TFactory< I >::Product * TFactory< I >::create | ( | const CParsedOptions & | options,
|  | char const * | params )

virtual

This function creates the object handled by this plugin It uses options to set its parameters and, if successfull, sets the init string of the object to params and returns the newly created object as a shared pointer.

Parameters

  options | the options to initialise the plugin
  params | original parameter string

Returns
  an instance of the requested object

Definition at line 179 of file factory.hh.

References CParamTranslator::check_parameters(), cverr(), CPluginBase::get_module(), and CParamTranslator::set_parameters().

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

- factory.hh