Base API nvidia_logo_transpbg.gif Up
Plugin Support

Support for dynamically loaded plugins. More...

Classes

class  mi::base::Plugin
 The abstract base class for plugins. More...
 
class  mi::base::IPlugin_descriptor
 Represents a plugin. More...
 

Typedefs

typedef Pluginmi::base::Plugin_factory(unsigned int index, void *context)
 Typedef for the initializer function to be provided by every plugin. More...
 

Functions

virtual Sint32 mi::base::Plugin::get_plugin_system_version () const
 Returns the version of the plugin system used to compile this. More...
 
virtual const char * mi::base::Plugin::get_name () const =0
 Returns the name of the plugin. More...
 
virtual const char * mi::base::Plugin::get_type () const =0
 Returns the type of the plugin. More...
 
virtual Sint32 mi::base::Plugin::get_version () const
 Returns the version number of the plugin. More...
 
virtual const char * mi::base::Plugin::get_compiler () const
 Returns the compiler used to compile the plugin. More...
 
virtual void mi::base::Plugin::release ()=0
 Destroys the plugin instance. More...
 
virtual const char * mi::base::Plugin::get_string_property (Sint32 index, const char **value)
 Returns a plugin property. More...
 
virtual base::Pluginmi::base::IPlugin_descriptor::get_plugin () const =0
 Returns the plugin itself. More...
 
virtual const char * mi::base::IPlugin_descriptor::get_plugin_library_path () const =0
 Returns the library path of the plugin. More...
 

Detailed Description

Support for dynamically loaded plugins.

Typedef Documentation

 Plugin_factory

typedef Plugin * mi::base::Plugin_factory(unsigned int index, void *context)

Typedef for the initializer function to be provided by every plugin.

The initializer function is used to obtain an instance of every plugin class. Note that the actual definition of the initializer function needs to be marked as

extern "C"
MI_DLL_EXPORT
Parameters
indexThe index of the plugin.
contextThe execution context for the plugin.

Function Documentation

 get_compiler()

virtual const char * mi::base::Plugin::get_compiler ( ) const
inlinevirtual

Returns the compiler used to compile the plugin.

 get_name()

virtual const char * mi::base::Plugin::get_name ( ) const
pure virtual

Returns the name of the plugin.

 get_plugin()

virtual base::Plugin * mi::base::IPlugin_descriptor::get_plugin ( ) const
pure virtual

Returns the plugin itself.

Note
The returned pointer is not referenced-counted. It is only valid as long as the plugin descriptor is valid.
Returns
The plugin.

 get_plugin_library_path()

virtual const char * mi::base::IPlugin_descriptor::get_plugin_library_path ( ) const
pure virtual

Returns the library path of the plugin.

Returns
The library path of the plugin, or NULL in case of failure.

 get_plugin_system_version()

virtual Sint32 mi::base::Plugin::get_plugin_system_version ( ) const
inlinevirtual

Returns the version of the plugin system used to compile this.

This can be useful when the plugin system is extended/changed at some point to be able to still support older plugins or at least to reject them. The only thing which must not be changed is that the first virtual function is this one.

Returns
The version number of the plugin system.

 get_string_property()

virtual const char * mi::base::Plugin::get_string_property ( Sint32  index,
const char **  value 
)
inlinevirtual

Returns a plugin property.

Plugin properties are represented as key-value pairs. The caller can iterate over all such existing pairs by calling with indexes starting at 0 and increasing by 1 until the call returns 0.

Parameters
indexThe index to query.
valueThe property value for index.
Returns
The property key for index.

 get_type()

virtual const char * mi::base::Plugin::get_type ( ) const
pure virtual

Returns the type of the plugin.

See the documentation of derived interfaces for possible values.

 get_version()

virtual Sint32 mi::base::Plugin::get_version ( ) const
inlinevirtual

Returns the version number of the plugin.

 release()

virtual void mi::base::Plugin::release ( )
pure virtual

Destroys the plugin instance.

This method should not be confused with mi::base::IInterface::release() which decrements the reference count. Plugins are not reference counted and this method here rather destroys the plugin instance.