Plugin< Iface > Class Template Referenceabstract

#include <Pt/System/Plugin.h>

Interface for plugins. More...

Inherits PluginId.

Inherited by BasicPlugin< Class, Iface >.

Public Member Functions

 Plugin ()
 Default Constructor.
virtual Iface * create ()=0
 Creates an instance.
virtual void destroy (Iface *instance)=0
 Destroys an instance.
const std::type_info & iface () const
 Returns the type of the plugin interface.
virtual const char * feature () const =0
 Returns the plugin feature string.
virtual const char * info () const =0
 Returns the plugin info string.

Detailed Description

template<typename Iface>
class Pt::System::Plugin< Iface >

Plugin is one entry in a PluginList. The template argument is the interface it implements.

PluginId names the interface type, the feature string, and an info string. feature() is the name used later to construct an instance. info() is an optional description.

create() returns a new instance. destroy() releases that instance. They are the allocator for objects that come from the plugin.

PluginManager registers matching plugins and creates instances by feature.