This is the key class for the feature of dynamical loading C++ modules (plugins) in Tao Language. All classes derived from TaoPlugin are loadable from Tao script.
The basic idea of the plugin technique used in Tao is that, an instance is created for each plugin classe when the module defining them is loaded, and these instances register themselves in a global variable defined by the main program (Tao Interpreter), so that these instances can be used by the main program to create other instances by using function "newObject()". The plugins are registered throught class TaoPluginProxy.
Example:
myplugin.h:
#include"taoPlugin.h"class MyPlugin : publicTaoPlugin
{
// A constructor:
TAO_PLUGIN(MyPlugin);
public:
// Reimplement some virtual functions which serve as // interfaces to the Tao interpreter.// Other functions.
};
myplugin.cpp:
#include"myplugin.h"
INIT_TAO_PLUGIN;
MyPlugin("MyPlugin"); // Register class MyPlugin with name "MyPlugin".// Other codes.
Member Function Documentation
virtual void TaoPlugin::help
(
ostream *
out = 0
)
[inline, virtual]
Reimplement this method to give short description of which methods can be called throught runMethod().
virtual void TaoPlugin::print
(
ostream *
out = 0,
bool
reserved = 0
)
[inline, virtual]
Reimplement this method if one want to print something when the plugin is printed by Tao function print().