|
AndroMeta
2.0.0
|
Base class for defining static function libraries callable from M. More...
#include <MLibBase.h>
Public Member Functions | |
| MLibBase () | |
| virtual | ~MLibBase () |
| void | exportFunction (const mstr &f, size_t args) |
| void | exportFunction (const mstr &f, size_t minArgs, size_t maxArgs) |
| mnode | importFunctions (void *scope, mnode fs) |
Base class for defining static function libraries callable from M.
MLibBase provides a means to define a library of static functions which may be imported into a scope so they may be called from M. MLibBase subclasses define the appropriate process() method and declare the functions to be exported so they may be imported when the library is instantiated. MLibBase subclasses typically export their functions in their constructor. Clients of the library may then choose to do to an import all or selectively import specific functions.
Constructor.
| virtual Meta::MLibBase::~MLibBase | ( | ) | [virtual] |
Destructor.
| void Meta::MLibBase::exportFunction | ( | const mstr & | f, |
| size_t | args | ||
| ) |
Export a function.
| f | The function name to export. |
| args | Number of function args. |
| void Meta::MLibBase::exportFunction | ( | const mstr & | f, |
| size_t | minArgs, | ||
| size_t | maxArgs | ||
| ) |
Convenience method to export a function with varying number of args.
| f | The function name to export. |
| minArgs | The minimum number of function args. |
| maxArgs | The maximum number of function args. |
| mnode Meta::MLibBase::importFunctions | ( | void * | scope, |
| mnode | fs | ||
| ) |
Import a set of functions into the desired scope. Under normal circumstances, there is no need to call this method directly as it is handled by the framework.
1.7.6.1