Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SLPlugin Class Reference
[Plugins system]

This is the base interface each plugin may implement. More...

#include <SLPlugin.hpp>

List of all members.

Public Member Functions

virtual void init (SLConfig &config)=0
virtual void finish ()=0
virtual SLPluginFeaturegetFeature ()=0
virtual void disposeFeature (SLPluginFeature *feature)=0
virtual unsigned int getVersionMajor () const=0
virtual unsigned int getVersionMinor () const=0
virtual const SLStringgetName () const=0
virtual SLPluginFeature::Type::Types getType () const=0
virtual void set_dl_handle (void *dl_handle)=0
virtual void * get_dl_handle () const=0


Detailed Description

This is the base interface each plugin may implement.

Author:
Alexandre Sauve
This purely abstract class It is mainly an adapter. While instancied once at loading time (shared object), it may provide many SLPluginFeature objects once registered with SL_PLUGIN_REGISTER

The plugins system is described in details in the section


Member Function Documentation

virtual void SLPlugin::disposeFeature SLPluginFeature feature  )  [pure virtual]
 

Dispose an instance obtained with getFeature(). These instances "should not" be deleted otherwise.

virtual void SLPlugin::finish  )  [pure virtual]
 

This function will be called just before plugin unloading or at program end. It will be time to flush unsaved data. It may not be called from program userland.

virtual void* SLPlugin::get_dl_handle  )  const [pure virtual]
 

Returns the handle obtained from dl_open

virtual SLPluginFeature* SLPlugin::getFeature  )  [pure virtual]
 

Get a concrete instance of the feature desired. In fact Plugin act as a FeatureFactory.

This method is always called after init()

Returns:
a newly created object.
Warning:
The object has to be "del"eted by the caller. In fact the ::SL_PLUGIN_FEATURE_DISPOSE will be used for this.

SLPluginFeature::Exception may be thrown.

virtual const SLString& SLPlugin::getName  )  const [pure virtual]
 

The name of the plugin should be the one of its parent directory.

virtual SLPluginFeature::Type::Types SLPlugin::getType  )  const [pure virtual]
 

Returns the type of the plugin, usable with ==

virtual unsigned int SLPlugin::getVersionMajor  )  const [pure virtual]
 

The major version number of the plugin

code example :

// plugin version is 1.2 plugin.getVersionMajor(); // => 1 plugin.getVersionMinor(); // => 2

virtual unsigned int SLPlugin::getVersionMinor  )  const [pure virtual]
 

The minor version number of the plugin

virtual void SLPlugin::init SLConfig config  )  [pure virtual]
 

This function should not be called from program userland. It will be called once and only from SLPluginRegister when it fells this is needed.

This method is called before atempting to call getFeature()

Parameters:
config contains the global parameters from config file

virtual void SLPlugin::set_dl_handle void *  dl_handle  )  [pure virtual]
 

set the handle obtained from dl_open


The documentation for this class was generated from the following file:
Generated on Mon Apr 19 01:03:37 2004 for segusoLand by doxygen 1.3.6-20040222