Public Member Functions | Protected Member Functions
CPluginBase Class Referenceabstract

The base class for all plug-ins. More...

#include <mia/core/plugin_base.hh>

Inheritance diagram for CPluginBase:
TPlugin< D, T > TPlugin< C2DImageFifoFilter::plugin_data, C2DImageFifoFilter::plugin_type > TPlugin< C2DRegTimeStep::plugin_data, C2DRegTimeStep::plugin_type > TPlugin< C2DSplineTransformPenalty::plugin_data, C2DSplineTransformPenalty::plugin_type > TPlugin< C3DRegTimeStep::plugin_data, C3DRegTimeStep::plugin_type > TPlugin< C3DSplineTransformPenalty::plugin_data, C3DSplineTransformPenalty::plugin_type > TPlugin< CSplineBoundaryCondition::plugin_data, CSplineBoundaryCondition::plugin_type > TPlugin< D, io_plugin_type > TPlugin< P::plugin_data, P::plugin_type > TPlugin< TDataFilter< Image >::plugin_data, TDataFilter< Image >::plugin_type > TPlugin< test_io_data, io_plugin_type > TPlugin< test_plugin_data, test_plugin_type > TPlugin< TFullCost< Transform >::plugin_data, TFullCost< Transform >::plugin_type > TPlugin< TTransformCreator< Transform >::plugin_data, TTransformCreator< Transform >::plugin_type >

Public Member Functions

void add_dependend_handlers (HandlerHelpMap &handler_map)
 
void add_parameter (const std::string &name, CParameter *param)
 
void append_interface (CPluginBase *plugin)
 
void check_parameters ()
 
 CPluginBase (const char *name)
 
const std::string get_descr () const
 
virtual void get_help (std::ostream &os) const
 
void get_help_xml (xmlpp::Element &root) const
 
PPluginModule get_module () const
 
const char * get_name () const
 
void get_short_help (std::ostream &os) const
 
bool has_property (const char *property) const
 
CPluginBasenext_interface ()
 
void set_module (const PPluginModule &module)
 
void set_parameters (const CParsedOptions &options)
 
virtual ~CPluginBase ()
 

Protected Member Functions

void add_property (const char *property)
 

Detailed Description

The base class for all plug-ins.

The base class for all plug-ins. It supports handling parameters and a provides a help interface.

Definition at line 52 of file plugin_base.hh.

Constructor & Destructor Documentation

CPluginBase::CPluginBase ( const char *  name)

The constructor initialises the plug-in with its name and sets its link-up to nil ant initialises its parameter map.

Parameters
name
virtual CPluginBase::~CPluginBase ( )
virtual

this destructur exists for the sole purpouse to ensure a virtual destructor for all plug-ins.

Member Function Documentation

void CPluginBase::add_dependend_handlers ( HandlerHelpMap handler_map)

Add all plugin handlers that may be called by this plugin

Parameters
[in,out]handler_map
void CPluginBase::add_parameter ( const std::string &  name,
CParameter param 
)

Add a parameter to the parameter list. If the name of the parameter already exists this function throws an invalid_argument exception.

Parameters
nameName of the new parameter
paramthe actual parameter
void CPluginBase::add_property ( const char *  property)
protected

Add a porperty to the map of supported properties

Parameters
propertya named property
void CPluginBase::append_interface ( CPluginBase plugin)

link up another plug-in in order to be able to put several plug-ins of the same type into the same dynamic library

void CPluginBase::check_parameters ( )

This function checks, whether all requzired parameters have really been set. It throws an invalid_argument

const std::string CPluginBase::get_descr ( ) const
Returns
the name of the plug-in
virtual void CPluginBase::get_help ( std::ostream &  os) const
virtual
void CPluginBase::get_help_xml ( xmlpp::Element &  root) const

Adds the help for this plug-in to an XML tree

Parameters
rootnode to add the help to
PPluginModule CPluginBase::get_module ( ) const
Returns
the module
const char* CPluginBase::get_name ( ) const
Returns
the name of the plug-in
void CPluginBase::get_short_help ( std::ostream &  os) const

Write a help regarding the plugin to the output stream

Parameters
os
bool CPluginBase::has_property ( const char *  property) const
Parameters
propertya named property
Returns
true if the property is supported, false otherwise
CPluginBase* CPluginBase::next_interface ( )
Returns
a pointer to the next plug-in, or NULL, if it doesn't exist
void CPluginBase::set_module ( const PPluginModule module)

set the shared modules containing the code of this plugin This enshures that the modules is not unloaded while the plug-in still exists and needs to call its destructor whos code resides in the module.

Parameters
module
void CPluginBase::set_parameters ( const CParsedOptions options)

Set the parameter according to the given option map. If the parameter name does not exists, the function will throw an invalid_argument exception. Depending on the parameter type setting it might also throw an invalid_argument exception.

Parameters
optionsthe options map

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