#include <map>
#include "PStack.h"
#include "MercuryUtil.h"
Go to the source code of this file.
Classes | |
class | MercuryCommandRegisteringSystem |
Complete Command Registeration System. More... | |
class | MercuryCommandHandler |
[Internal] Command-Handler More... | |
Defines | |
#define | REGISTER_STATEMENT_TO_COMMAND(command, code) |
#define | REGISTER_FUNCTION_TO_COMMAND(command, function) int sub##commandIDs = CMDMAN.Register( #command, &function ); |
#define | TYPECASTMSTRING |
#define | CLASS_FUNCTION_NOARGS(CLASSNAME, FUNCTIONNAME, RETURNTYPE) |
#define | CLASS_FUNCTION_VOID_NOARGS(CLASSNAME, FUNCTIONNAME) |
#define | CLASS_FUNCTION_ONEARG(CLASSNAME, FUNCTIONNAME, RETURNTYPE, CONVTYPE, ARGTYPE) |
#define | CLASS_FUNCTION_VOID_ONEARG(CLASSNAME, FUNCTIONNAME, CONVTYPE, ARGTYPE) |
#define | CLASS_FUNCTION_TWOARGS(CLASSNAME, FUNCTIONNAME, RETURNTYPE, CONVTYPE1, ARGTYPE1, CONVTYPE2, ARGTYPE2) |
#define | CLASS_FUNCTION_VOID_TWOARGS(CLASSNAME, FUNCTIONNAME, CONVTYPE1, ARGTYPE1, CONVTYPE2, ARGTYPE2) |
#define | CLASS_FUNCTION_THREEARGS(CLASSNAME, FUNCTIONNAME, RETURNTYPE, CONVTYPE1, ARGTYPE1, CONVTYPE2, ARGTYPE2, CONVTYPE3, ARGTYPE3) |
#define | CLASS_FUNCTION_VOID_THREEARGS(CLASSNAME, FUNCTIONNAME, CONVTYPE1, ARGTYPE1, CONVTYPE2, ARGTYPE2, CONVTYPE3, ARGTYPE3) |
#define | CLASS_FUNCTION_FOURARGS(CLASSNAME, FUNCTIONNAME, RETURNTYPE, CONVTYPE1, ARGTYPE1, CONVTYPE2, ARGTYPE2, CONVTYPE3, ARGTYPE3, CONVTYPE4, ARGTYPE4) |
#define | CLASS_FUNCTION_VOID_FOURARGS(CLASSNAME, FUNCTIONNAME, CONVTYPE1, ARGTYPE1, CONVTYPE2, ARGTYPE2, CONVTYPE3, ARGTYPE3, CONVTYPE4, ARGTYPE4) |
Typedefs | |
typedef MercuryObject *(*) | MakeObjectCommand (const MString &) |
typedef bool(*) | CMDCallback (PStack &, const char *, PStack &, void *) |
typedef PSElement( | ClassCallback )(MercuryCommandHandler *pThs, const PStack &pParameters) |
Functions | |
bool HGEXPORT | RunCommandOnObject (const char *sObjectName, const char *sCommandName, int iMPStackArgs, int iMPStackRet) |
Variables | |
MercuryCommandRegisteringSystem | CMDMAN |
#define CLASS_FUNCTION_FOURARGS | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
RETURNTYPE, | |||||
CONVTYPE1, | |||||
ARGTYPE1, | |||||
CONVTYPE2, | |||||
ARGTYPE2, | |||||
CONVTYPE3, | |||||
ARGTYPE3, | |||||
CONVTYPE4, | |||||
ARGTYPE4 | ) |
Value:
PSElement PS_##CLASSNAME_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ return PSElement(((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 pParameters.PeekItem(0), CONVTYPE2 pParameters.PeekItem(1), CONVTYPE3 pParameters.PeekItem(2), CONVTYPE4 pParameters.PeekItem(3) ) ); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &CLASSNAME_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX RETURNTYPE HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE p1, ARGTYPE2 p2, ARGTYPE3 p3, ARGTYPE p4 ) \ { \ return ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 p1, CONVTYPE2 p2, CONVTYPE3 p3, CONVTYPE4 p4 ); \ } EXPORTSUFFIX
Definition at line 174 of file MercuryCommands.h.
#define CLASS_FUNCTION_NOARGS | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
RETURNTYPE | ) |
Value:
PSElement PS_##CLASSNAME##_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ return PSElement(((CLASSNAME*)pThs)->FUNCTIONNAME() ); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME##_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME##_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX RETURNTYPE HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs ) \ { \ return ((CLASSNAME*)pThs)->FUNCTIONNAME(); \ } EXPORTSUFFIX
Definition at line 90 of file MercuryCommands.h.
#define CLASS_FUNCTION_ONEARG | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
RETURNTYPE, | |||||
CONVTYPE, | |||||
ARGTYPE | ) |
Value:
PSElement PS_##CLASSNAME_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ return PSElement(((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE pParameters.PeekItem(0) ) ); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &CLASSNAME_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX RETURNTYPE HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE p1 ) \ { \ return ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE p1 ); \ } EXPORTSUFFIX
Definition at line 111 of file MercuryCommands.h.
#define CLASS_FUNCTION_THREEARGS | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
RETURNTYPE, | |||||
CONVTYPE1, | |||||
ARGTYPE1, | |||||
CONVTYPE2, | |||||
ARGTYPE2, | |||||
CONVTYPE3, | |||||
ARGTYPE3 | ) |
Value:
PSElement PS_##CLASSNAME##_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ return PSElement(((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 pParameters.PeekItem(0), CONVTYPE2 pParameters.PeekItem(1), CONVTYPE3 pParameters.PeekItem(2) ) ); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME##_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME##_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX RETURNTYPE HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE1 p1, ARGTYPE2 p2, ARGTYPE3 p3 ) \ { \ return ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 p1, CONVTYPE2 p2, CONVTYPE3 p3 ); \ } EXPORTSUFFIX
Definition at line 153 of file MercuryCommands.h.
#define CLASS_FUNCTION_TWOARGS | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
RETURNTYPE, | |||||
CONVTYPE1, | |||||
ARGTYPE1, | |||||
CONVTYPE2, | |||||
ARGTYPE2 | ) |
Value:
PSElement PS_##CLASSNAME##_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ return PSElement(((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 pParameters.PeekItem(0), CONVTYPE2 pParameters.PeekItem(1) ) ); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME##_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX RETURNTYPE HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE1 p1, ARGTYPE2 p2 ) \ { \ return ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 p1, CONVTYPE2 p2 ); \ } EXPORTSUFFIX
Definition at line 132 of file MercuryCommands.h.
#define CLASS_FUNCTION_VOID_FOURARGS | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
CONVTYPE1, | |||||
ARGTYPE1, | |||||
CONVTYPE2, | |||||
ARGTYPE2, | |||||
CONVTYPE3, | |||||
ARGTYPE3, | |||||
CONVTYPE4, | |||||
ARGTYPE4 | ) |
Value:
PSElement PS_##CLASSNAME_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 pParameters.PeekItem(0), CONVTYPE2 pParameters.PeekItem(1), CONVTYPE3 pParameters.PeekItem(2), CONVTYPE4 pParameters.PeekItem(3) ); \ return PSElement(); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX void HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE1 p1, ARGTYPE2 p2, ARGTYPE3 p3, ARGTYPE4 p4 ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 p1, CONVTYPE2 p2, CONVTYPE3 p3, CONVTYPE4 p4 ); \ } EXPORTSUFFIX
Definition at line 184 of file MercuryCommands.h.
#define CLASS_FUNCTION_VOID_NOARGS | ( | CLASSNAME, | |||
FUNCTIONNAME | ) |
Value:
PSElement PS_##CLASSNAME##_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME(); \ return PSElement(); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME##_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME##_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX void HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME(); \ } EXPORTSUFFIX
Definition at line 100 of file MercuryCommands.h.
#define CLASS_FUNCTION_VOID_ONEARG | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
CONVTYPE, | |||||
ARGTYPE | ) |
Value:
PSElement PS_##CLASSNAME_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE pParameters.PeekItem(0) ); \ return PSElement(); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX void HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE p1 ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE p1 ); \ } EXPORTSUFFIX
Definition at line 121 of file MercuryCommands.h.
#define CLASS_FUNCTION_VOID_THREEARGS | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
CONVTYPE1, | |||||
ARGTYPE1, | |||||
CONVTYPE2, | |||||
ARGTYPE2, | |||||
CONVTYPE3, | |||||
ARGTYPE3 | ) |
Value:
PSElement PS_##CLASSNAME##_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 pParameters.PeekItem(0), CONVTYPE2 pParameters.PeekItem(1), CONVTYPE3 pParameters.PeekItem(2) ); \ return PSElement(); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME##_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX void HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE1 p1, ARGTYPE2 p2, ARGTYPE3 p3 ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 p1, CONVTYPE2 p2, CONVTYPE3 p3 ); \ } EXPORTSUFFIX
Definition at line 163 of file MercuryCommands.h.
#define CLASS_FUNCTION_VOID_TWOARGS | ( | CLASSNAME, | |||
FUNCTIONNAME, | |||||
CONVTYPE1, | |||||
ARGTYPE1, | |||||
CONVTYPE2, | |||||
ARGTYPE2 | ) |
Value:
PSElement PS_##CLASSNAME_##FUNCTIONNAME( MercuryCommandHandler * pThs, const PStack & pParameters ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 pParameters.PeekItem(0), CONVTYPE2 pParameters.PeekItem(1) ); \ return PSElement(); \ } RUN_STATEMENT_AT_BOOT( REGISTER_##CLASSNAME_##FUNCTIONNAME, MercuryObjectFactory::GetInstance().RegisterFunction( &PS_##CLASSNAME_##FUNCTIONNAME, #CLASSNAME, #FUNCTIONNAME ); ) \ EXPORTPREFIX void HGEXPORT CLASSNAME##_##FUNCTIONNAME( void * pThs, ARGTYPE1 p1, ARGTYPE2 p2 ) \ { \ ((CLASSNAME*)pThs)->FUNCTIONNAME( CONVTYPE1 p1, CONVTYPE2 p2 ); \ } EXPORTSUFFIX
Definition at line 142 of file MercuryCommands.h.
#define REGISTER_FUNCTION_TO_COMMAND | ( | command, | |||
function | ) | int sub##commandIDs = CMDMAN.Register( #command, &function ); |
Definition at line 62 of file MercuryCommands.h.
#define REGISTER_STATEMENT_TO_COMMAND | ( | command, | |||
code | ) |
#define TYPECASTMSTRING |
Definition at line 86 of file MercuryCommands.h.
typedef PSElement( ClassCallback)(MercuryCommandHandler *pThs, const PStack &pParameters) |
Definition at line 49 of file MercuryCommands.h.
typedef bool(*) CMDCallback(PStack &, const char *, PStack &, void *) |
Definition at line 12 of file MercuryCommands.h.
typedef MercuryObject*(*) MakeObjectCommand(const MString &) |
Definition at line 10 of file MercuryCommands.h.
bool HGEXPORT RunCommandOnObject | ( | const char * | sObjectName, | |
const char * | sCommandName, | |||
int | iMPStackArgs, | |||
int | iMPStackRet | |||
) |
Definition at line 94 of file MercuryCommands.cpp.
Definition at line 65 of file MercuryCommands.cpp.