TFactory< P > Class Template Referenceabstract

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 More...
 
typedef std::shared_ptr< P > SharedProduct
 typedef for the shared version of the product More...
 
typedef std::unique_ptr< P > UniqueProduct
 typedef for the unique version of the product More...
 
- 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. More...
 
typedef P::plugin_type PlugType
 Typedef for the plugin type descriptor handled by this plug-in. More...
 

Public Member Functions

virtual Productcreate (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
 
CPluginBasenext_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
CParamListget_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
Pthe object type created by the factory.

Definition at line 49 of file factory.hh.

Member Typedef Documentation

template<typename P>
typedef P TFactory< P >::Product

typedef to describe the product of the factory

Definition at line 54 of file factory.hh.

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

typedef for the shared version of the product

Definition at line 57 of file factory.hh.

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

typedef for the unique version of the product

Definition at line 61 of file factory.hh.

Constructor & Destructor Documentation

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

Member Function Documentation

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
optionsthe options to initialise the plugin
paramsoriginal parameter string
Returns
an instance of the requested object

Definition at line 175 of file factory.hh.

References cverr().


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