Tao Language for Scripting and Computing

Documentation for Tao C++ Types and Plugin
Home Page
Documents
Downloads
Licensing
MailLists
Forums
FAQ



SourceForge Logo

Support This Project
Tao C++ Types and Plugin: TaoPlugin class Reference

TaoPlugin Class Reference

TaoPlugin: the base class for Tao plugins. More...

#include <taoPlugin.h>

Inheritance diagram for TaoPlugin:

TcBase List of all members.

Public Member Functions

short type () const
 Get object type, to tell this is a plugin.

virtual short rtti () const
virtual TaoPluginnewObject (TcArray *param=0)
 Reimplemented to create user defined plugin.

virtual void runMethod (const char *funame, TcArray *in=0, TcArray *out=0)
 Reimplemented this method to invoke other method.

virtual void print (ostream *out=0, bool reserved=0)
virtual void help (ostream *out=0)

Detailed Description

TaoPlugin: the base class for Tao plugins.

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 : public TaoPlugin { // 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().

Reimplemented from TcBase.

virtual short TaoPlugin::rtti  )  const [inline, virtual]
 

Get object Running Time Type Identification. To tell which type of plugin it is.

Reimplemented from TcBase.


The documentation for this class was generated from the following file:
Generated on Sun Apr 24 23:42:18 2005 for Tao C++ Types and Plugin by doxygen 1.3.6
This website is maintained by Fu Limin.
Copyright(C) 2004-2005, Fu Limin.
Email: fu [dot] limin [dot] tao [at] gmail [dot] com