Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::sys::Plugin Class Reference

#include <>>

Classes

class  make
 

Public Types

typedef genstruct::Table< stringaliases_t
 

Public Member Functions

 Plugin (string name, const Version &plugger_version, CString hook="", const aliases_t &aliases=aliases_t::EMPTY)
 
 Plugin (const make &maker)
 
virtual ~Plugin (void)
 
string name (void) const
 
CString description (void) const
 
CString licence (void) const
 
const VersionpluginVersion (void) const
 
const VersionpluggerVersion (void) const
 
CString hook (void) const
 
const aliases_taliases (void) const
 
bool matches (const string &name) const
 
void unplug (void)
 
const Pathpath (void) const
 

Static Public Attributes

static const t::uint32 MAGIC = 0xCAFEBABE
 

Protected Member Functions

virtual void startup (void)
 
virtual void cleanup (void)
 

Protected Attributes

CString _description
 
CString _licence
 
Version _plugin_version
 

Detailed Description

The class Plugin allows implementing plug-ins in OS-independent way. See Plugins for more details.

Member Typedef Documentation

Constructor & Destructor Documentation

elm::sys::Plugin::Plugin ( string  name,
const Version plugger_version,
CString  hook = "",
const aliases_t aliases = aliases_t::EMPTY 
)

Build a new plugin.

Parameters
namePlugin name.
plugger_versionPlugger version (used for checking compatibility between plugin and user application API).
hookHook of a matching plugger
aliasesName aliases for the plugin.
elm::sys::Plugin::Plugin ( const make maker)

New-style builder for plugin using Plugin::Maker.

Parameters
makerMaker for plugin.

References elm::genstruct::Vector< T >::addAll(), and elm::genstruct::Vector< T >::detach().

elm::sys::Plugin::~Plugin ( void  )
virtual

Member Function Documentation

const aliases_t & elm::sys::Plugin::aliases ( void  ) const

Get the table of aliases of the plugin.

Returns
Table of aliases.
void elm::sys::Plugin::cleanup ( void  )
protectedvirtual

This method is called just before the plugin removal from the user application. It may be overriden for performing specific clean up.

Referenced by unplug().

String elm::sys::Plugin::description ( void  ) const

Get the plugin description.

Returns
Plugin description.

References _description.

String elm::sys::Plugin::hook ( void  ) const

Get the hook of the current plugin.

Returns
Plugin hook.
String elm::sys::Plugin::licence ( void  ) const

Get the plugin licence.

Returns
Plugin licence.

References _licence.

bool elm::sys::Plugin::matches ( const string name) const

Test if the current plugin matches the given name, that is, if the name or one of the aliases matches the name.

Parameters
nameName to test.
Returns
True if the name is matched, false else.
string elm::sys::Plugin::name ( void  ) const

Get the plugin name.

Returns
Plugin name.
const Path& elm::sys::Plugin::path ( void  ) const
Version & elm::sys::Plugin::pluggerVersion ( void  ) const

Get the plugger version.

Returns
Plugger version.

Referenced by elm::sys::Plugger::plugFile().

Version & elm::sys::Plugin::pluginVersion ( void  ) const

Get the plugin version.

Returns
Plugin version.

References _plugin_version.

void elm::sys::Plugin::startup ( void  )
protectedvirtual

This method is called just after the plugin has been plugged into the user application. It may be overriden for performing specific initializations.

void elm::sys::Plugin::unplug ( void  )

Call it when the plugin is no more used.

References cleanup().

Member Data Documentation

CString elm::sys::Plugin::_description
protected

Referenced by description().

CString elm::sys::Plugin::_licence
protected

Referenced by licence().

Version elm::sys::Plugin::_plugin_version
protected

Referenced by pluginVersion().

const t::uint32 elm::sys::Plugin::MAGIC = 0xCAFEBABE
static

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