class CScript { public: static CScript &Instance(); // Own functions int LoadSectionFile(const char *, const char *); int RegisterMathLib(void); // Overloaded functions /*void SetEngine(asIScriptEngine *in_pAsIScriptEngine) {m_pAsEngine=in_pAsIScriptEngine;}; asIScriptEngine *GetEngine() {return m_pAsEngine;};*/ virtual int AddRef() {return m_pAsEngine->AddRef();}; virtual int Release() {return m_pAsEngine->Release();}; virtual int RegisterObjectType(const char *name, int byteSize, asDWORD flags) {return m_pAsEngine->RegisterObjectType(name, byteSize, flags);}; virtual int RegisterObjectProperty(const char *obj, const char *declaration, int byteOffset) {return m_pAsEngine->RegisterObjectProperty(obj, declaration, byteOffset);}; virtual int RegisterObjectMethod(const char *obj, const char *declaration, asUPtr funcPointer, asDWORD callConv) {return m_pAsEngine->RegisterObjectMethod(obj, declaration, funcPointer, callConv);}; virtual int RegisterObjectBehaviour(const char *datatype, asDWORD behaviour, const char *declaration, asUPtr funcPointer, asDWORD callConv) {return m_pAsEngine->RegisterObjectBehaviour(datatype, behaviour, declaration, funcPointer, callConv);}; virtual int RegisterGlobalProperty(const char *declaration, void *pointer) {return m_pAsEngine->RegisterGlobalProperty(declaration, pointer);}; virtual int RegisterGlobalFunction(const char *declaration, asUPtr funcPointer, asDWORD callConv) {return m_pAsEngine->RegisterGlobalFunction(declaration, funcPointer, callConv);}; virtual int RegisterStringFactory(const char *datatype, asUPtr factoryFunc, asDWORD callConv) {return m_pAsEngine->RegisterStringFactory(datatype, factoryFunc, callConv);}; virtual int AddScriptSection(const char *module, const char *name, const char *code, int codeLength, int lineOffset) {return m_pAsEngine->AddScriptSection(module, name, code, codeLength, lineOffset);}; virtual int Build(const char *module, asIOutputStream *out) {return m_pAsEngine->Build(module, out);}; virtual int Discard(const char *module) {return m_pAsEngine->Discard(module);}; //virtual int GetModuleID(const char *module) {return m_pAsEngine->GetModuleID(module);}; virtual int GetModuleIndex(const char *module) {return m_pAsEngine->GetModuleIndex(module);}; virtual const char *GetModuleNameFromIndex(int index, int *length = 0) {return m_pAsEngine->GetModuleNameFromIndex(index, length);}; virtual int GetFunctionCount(const char *module) {return m_pAsEngine->GetFunctionCount(module);}; virtual int GetFunctionIDByIndex(const char *module, int index) {return m_pAsEngine->GetFunctionIDByIndex(module, index);}; virtual int GetFunctionIDByName(const char *module, const char *name) {return m_pAsEngine->GetFunctionIDByName(module, name);}; virtual int GetFunctionIDByDecl(const char *module, const char *decl) {return m_pAsEngine->GetFunctionIDByDecl(module, decl);}; virtual const char *GetFunctionDeclaration(int funcID, int *length = 0) {return m_pAsEngine->GetFunctionDeclaration(funcID, length);}; virtual const char *GetFunctionName(int funcID, int *length = 0) {return m_pAsEngine->GetFunctionName(funcID, length);};#ifdef AS_DEPRECATED virtual int GetFunctionDeclaration(int funcID, char *buffer, int bufferSize) {return m_pAsEngine->GetFunctionDeclaration(funcID, buffer, bufferSize);}; virtual int GetFunctionName(int funcID, char *buffer, int bufferSize) {return m_pAsEngine->GetFunctionName(funcID, buffer, bufferSize);};#endif virtual int GetGlobalVarCount(const char *module) {return m_pAsEngine->GetFunctionCount(module);}; virtual int GetGlobalVarIDByIndex(const char *module, int index) {return m_pAsEngine->GetGlobalVarIDByIndex(module, index);}; virtual int GetGlobalVarIDByName(const char *module, const char *name) {return m_pAsEngine->GetGlobalVarIDByName(module, name);}; virtual int GetGlobalVarIDByDecl(const char *module, const char *decl) {return m_pAsEngine->GetGlobalVarIDByDecl(module, decl);}; virtual const char *GetGlobalVarDeclaration(int gvarID, int *length = 0) {return m_pAsEngine->GetGlobalVarDeclaration(gvarID, length);}; virtual const char *GetGlobalVarName(int gvarID, int *length = 0) {return m_pAsEngine->GetGlobalVarName(gvarID, length);};#ifdef AS_DEPRECATED virtual int GetGlobalVarDeclaration(int gvarID, char *buffer, int bufferSize) {return m_pAsEngine->GetGlobalVarDeclaration(gvarID, buffer, bufferSize);}; virtual int GetGlobalVarName(int gvarID, char *buffer, int bufferSize) {return m_pAsEngine->GetGlobalVarName(gvarID, buffer, bufferSize);};#endif virtual void *GetGlobalVarPointer(int gvarID) {return m_pAsEngine->GetGlobalVarPointer(gvarID);}; virtual int SetDefaultContextStackSize(asUINT initial, asUINT maximum) {return m_pAsEngine->SetDefaultContextStackSize(initial, maximum);}; virtual asIScriptContext *CreateContext() {return m_pAsEngine->CreateContext();}; virtual int ExecuteString(const char *module, const char *script, asIOutputStream *out = 0, asIScriptContext **ctx = 0, asDWORD flags = 0) {return m_pAsEngine->ExecuteString(module, script, out, ctx, flags);};#ifdef AS_DEPRECATED virtual int ExecuteString(const char *module, const char *script, asIOutputStream *out, asDWORD flags) {return m_pAsEngine->ExecuteString(module, script, out, flags);}; virtual asIScriptContext *GetContextForExecuteString() {return m_pAsEngine->GetContextForExecuteString();};#endif virtual int SaveByteCode(const char *module, asIBinaryStream *out) {return m_pAsEngine->SaveByteCode(module, out);}; virtual int LoadByteCode(const char *module, asIBinaryStream *in) {return m_pAsEngine->LoadByteCode(module, in);}; // 1.9.0 WIP4 // Dynamic binding between modules virtual int GetImportedFunctionCount(const char *module) {return m_pAsEngine->GetImportedFunctionCount(module);}; virtual int GetImportedFunctionIndexByDecl(const char *module, const char *decl) {return m_pAsEngine->GetImportedFunctionIndexByDecl(module, decl);}; virtual const char *GetImportedFunctionDeclaration(const char *module, int importIndex, int *length = 0) {return m_pAsEngine->GetImportedFunctionDeclaration(module, importIndex, length);};#ifdef AS_DEPRECATED virtual int GetImportedFunctionDeclaration(const char *module, int importIndex, char *buffer, int bufferSize) {return m_pAsEngine->GetImportedFunctionDeclaration(module, importIndex, buffer, bufferSize);};#endif virtual const char *GetImportedFunctionSourceModule(const char *module, int importIndex, int *length = 0) {return m_pAsEngine->GetImportedFunctionSourceModule(module, importIndex, length);}; virtual int BindImportedFunction(const char *module, int importIndex, int funcID) {return m_pAsEngine->BindImportedFunction(module, importIndex, funcID);}; virtual int UnbindImportedFunction(const char *module, int importIndex) {return m_pAsEngine->UnbindImportedFunction(module, importIndex);}; virtual int BindAllImportedFunctions(const char *module) {return m_pAsEngine->BindAllImportedFunctions(module);}; virtual int UnbindAllImportedFunctions(const char *module) {return m_pAsEngine->UnbindAllImportedFunctions(module);}; // // 1.10.1 virtual int RegisterGlobalBehaviour(asDWORD behaviour, const char *declaration, asUPtr funcPointer, asDWORD callConv) {return m_pAsEngine->RegisterGlobalBehaviour(behaviour, declaration, funcPointer, callConv);}; private: CScript(); virtual ~CScript(); asIScriptEngine *m_pAsEngine;};
And if someone knows a less polluted way of doing this, I'll be happy to hear your solution ;)