Plugin interface. More...
#include <plugin.h>

Public Member Functions | |
| virtual | ~plugin_int () |
| Destructor. | |
| virtual void | load (const std::string &file_name)=0 throw (plugin_exception) |
| Load plugin. | |
| virtual disposable * | create_object (const std::string &object_name)=0 |
| Create object. | |
| virtual void | destroy_object (disposable *object)=0 |
| Destroy object. | |
Plugin interface.
The plugin interface introduces pure virtual methods that are implemented by concrete plugin class.
| virtual disposable* dbp::plugin_int::create_object | ( | const std::string & | object_name | ) | [pure virtual] |
Create object.
This function creates an object by its name. Each object created by this function should be properly destroyed by calling destroy_object to avoid memory leaks.
| object_name | a name of the object to create. |
Implemented in dbp::plugin.
| virtual void dbp::plugin_int::destroy_object | ( | disposable * | object | ) | [pure virtual] |
Destroy object.
This function is used to destroy object created by create_object(const std::string&) function.
| object | the object to destroy. |
Implemented in dbp::plugin.
| virtual void dbp::plugin_int::load | ( | const std::string & | file_name | ) | throw (plugin_exception) [pure virtual] |
Load plugin.
Loads the plugin from a given file which should be a dynamic library.
| file_name | a name of the dynamic library file to load. |
The plugin (dynamic library) should export two following C-functions:
void* create_object(const char*); void destroy_object(void*);
First function should create the specified class and return the pointer to the class instance created.
Second function should destroy object created by create_object(const std::string&) and free up the memory.
Implemented in dbp::plugin.