Public Member Functions | |
virtual int | AddRef ()=0 |
Increase reference counter. | |
virtual int | Release ()=0 |
Decrease reference counter. | |
virtual int | SetEngineProperty (asEEngineProp property, asPWORD value)=0 |
Dynamically change some engine properties. | |
virtual asPWORD | GetEngineProperty (asEEngineProp property)=0 |
Retrieve current engine property settings. | |
virtual int | SetMessageCallback (const asSFuncPtr &callback, void *obj, asDWORD callConv)=0 |
Sets a message callback that will receive compiler messages. | |
virtual int | ClearMessageCallback ()=0 |
Clears the registered message callback routine. | |
virtual int | WriteMessage (const char *section, int row, int col, asEMsgType type, const char *message)=0 |
Writes a message to the message callback. | |
virtual int | RegisterObjectType (const char *name, int byteSize, asDWORD flags)=0 |
Registers a new object type. | |
virtual int | RegisterObjectProperty (const char *obj, const char *declaration, int byteOffset)=0 |
Registers a property for the object type. | |
virtual int | RegisterObjectMethod (const char *obj, const char *declaration, const asSFuncPtr &funcPointer, asDWORD callConv)=0 |
Registers a method for the object type. | |
virtual int | RegisterObjectBehaviour (const char *obj, asEBehaviours behaviour, const char *declaration, const asSFuncPtr &funcPointer, asDWORD callConv)=0 |
Registers a behaviour for the object type. | |
virtual int | RegisterGlobalProperty (const char *declaration, void *pointer)=0 |
Registers a global property. | |
virtual int | RegisterGlobalFunction (const char *declaration, const asSFuncPtr &funcPointer, asDWORD callConv)=0 |
Registers a global function. | |
virtual int | RegisterGlobalBehaviour (asEBehaviours behaviour, const char *declaration, const asSFuncPtr &funcPointer, asDWORD callConv)=0 |
Registers a global behaviour, e.g. operators. | |
virtual int | RegisterInterface (const char *name)=0 |
Registers an interface. | |
virtual int | RegisterInterfaceMethod (const char *intf, const char *declaration)=0 |
Registers an interface method. | |
virtual int | RegisterEnum (const char *type)=0 |
Registers an enum type. | |
virtual int | RegisterEnumValue (const char *type, const char *name, int value)=0 |
Registers an enum value. | |
virtual int | RegisterTypedef (const char *type, const char *decl)=0 |
Registers a typedef. | |
virtual int | RegisterStringFactory (const char *datatype, const asSFuncPtr &factoryFunc, asDWORD callConv)=0 |
Registers the string factory. | |
virtual int | BeginConfigGroup (const char *groupName)=0 |
Starts a new dynamic configuration group. | |
virtual int | EndConfigGroup ()=0 |
Ends the configuration group. | |
virtual int | RemoveConfigGroup (const char *groupName)=0 |
Removes a previously registered configuration group. | |
virtual int | SetConfigGroupModuleAccess (const char *groupName, const char *module, bool hasAccess)=0 |
Tell AngelScript which modules have access to which configuration groups. | |
virtual int | AddScriptSection (const char *module, const char *name, const char *code, size_t codeLength, int lineOffset=0)=0 |
Add a script section for the next build. | |
virtual int | Build (const char *module)=0 |
Build the previously added script sections. | |
virtual int | Discard (const char *module)=0 |
Discard a compiled module. | |
virtual int | ResetModule (const char *module)=0 |
Reset the global variables of a module. | |
virtual int | GetFunctionCount (const char *module)=0 |
Returns the number of global functions in the module. | |
virtual int | GetFunctionIDByIndex (const char *module, int index)=0 |
Returns the function id by index. | |
virtual int | GetFunctionIDByName (const char *module, const char *name)=0 |
Returns the function id by name. | |
virtual int | GetFunctionIDByDecl (const char *module, const char *decl)=0 |
Returns the function id by declaration. | |
virtual const char * | GetFunctionDeclaration (int funcId, int *length=0)=0 |
(deprecated) Returns the function declaration. | |
virtual const char * | GetFunctionName (int funcId, int *length=0)=0 |
(deprecated) Returns the function name. | |
virtual const char * | GetFunctionModule (int funcId, int *length=0)=0 |
(deprecated) Returns the module where the function was implemented. | |
virtual const char * | GetFunctionSection (int funcId, int *length=0)=0 |
(deprecated) Returns the section where the function was implemented. | |
virtual asIScriptFunction * | GetFunctionDescriptorByIndex (const char *module, int index)=0 |
Returns the function descriptor for the script function. | |
virtual asIScriptFunction * | GetFunctionDescriptorById (int funcId)=0 |
Returns the function descriptor for the script function. | |
virtual int | GetMethodCount (int typeId)=0 |
(deprecated) Returns the number of methods for the object type. | |
virtual int | GetMethodIDByIndex (int typeId, int index)=0 |
(deprecated) Returns the method id by index. | |
virtual int | GetMethodIDByName (int typeId, const char *name)=0 |
(deprecated) Returns the method id by name. | |
virtual int | GetMethodIDByDecl (int typeId, const char *decl)=0 |
(deprecated) Returns the method id by declaration. | |
virtual asIScriptFunction * | GetMethodDescriptorByIndex (int typeId, int index)=0 |
(deprecated) Returns the function descriptor for the script method | |
virtual int | GetGlobalVarCount (const char *module)=0 |
Returns the number of global variables in the module. | |
virtual int | GetGlobalVarIndexByName (const char *module, const char *name)=0 |
Returns the global variable index by name. | |
virtual int | GetGlobalVarIndexByDecl (const char *module, const char *decl)=0 |
Returns the global variable index by declaration. | |
virtual const char * | GetGlobalVarDeclaration (const char *module, int index, int *length=0)=0 |
Returns the global variable declaration. | |
virtual const char * | GetGlobalVarName (const char *module, int index, int *length=0)=0 |
Returns the global variable name. | |
virtual void * | GetAddressOfGlobalVar (const char *module, int index)=0 |
Returns the pointer to the global variable. | |
virtual int | GetGlobalVarIDByIndex (const char *module, int index)=0 |
(deprecated) Returns the global variable id by index. | |
virtual int | GetGlobalVarIDByName (const char *module, const char *name)=0 |
(deprecated) Returns the global variable id by name. | |
virtual int | GetGlobalVarIDByDecl (const char *module, const char *decl)=0 |
(deprecated) Returns the global variable id by declaration. | |
virtual const char * | GetGlobalVarDeclaration (int gvarID, int *length=0)=0 |
(deprecated) Returns the global variable declaration. | |
virtual const char * | GetGlobalVarName (int gvarID, int *length=0)=0 |
(deprecated) Returns the global variable name. | |
virtual void * | GetGlobalVarPointer (int gvarID)=0 |
(deprecated) Returns the pointer to the global variable. | |
virtual int | GetImportedFunctionCount (const char *module)=0 |
Returns the number of functions declared for import. | |
virtual int | GetImportedFunctionIndexByDecl (const char *module, const char *decl)=0 |
Returns the imported function index by declaration. | |
virtual const char * | GetImportedFunctionDeclaration (const char *module, int importIndex, int *length=0)=0 |
Returns the imported function declaration. | |
virtual const char * | GetImportedFunctionSourceModule (const char *module, int importIndex, int *length=0)=0 |
Returns the declared imported function source module. | |
virtual int | BindImportedFunction (const char *module, int importIndex, int funcId)=0 |
Binds an imported function to the function from another module. | |
virtual int | UnbindImportedFunction (const char *module, int importIndex)=0 |
Unbinds an imported function. | |
virtual int | BindAllImportedFunctions (const char *module)=0 |
Binds all imported functions in a module, by searching their equivalents in the declared source modules. | |
virtual int | UnbindAllImportedFunctions (const char *module)=0 |
Unbinds all imported functions. | |
virtual int | GetTypeIdByDecl (const char *module, const char *decl)=0 |
Returns a type id by declaration. | |
virtual const char * | GetTypeDeclaration (int typeId, int *length=0)=0 |
Returns a type declaration. | |
virtual int | GetSizeOfPrimitiveType (int typeId)=0 |
Returns the size of a primitive type. | |
virtual asIObjectType * | GetObjectTypeById (int typeId)=0 |
Returns the object type interface for type. | |
virtual asIObjectType * | GetObjectTypeByIndex (asUINT index)=0 |
Returns the object type interface by index. | |
virtual int | GetObjectTypeCount ()=0 |
Returns the number of object types. | |
virtual int | SetDefaultContextStackSize (asUINT initial, asUINT maximum)=0 |
(deprecated) Sets the default context stack size. | |
virtual asIScriptContext * | CreateContext ()=0 |
Creates a new script context. | |
virtual void * | CreateScriptObject (int typeId)=0 |
Creates a script object defined by its type id. | |
virtual void * | CreateScriptObjectCopy (void *obj, int typeId)=0 |
Creates a copy of a script object. | |
virtual void | CopyScriptObject (void *dstObj, void *srcObj, int typeId)=0 |
Copy one script object to another. | |
virtual void | ReleaseScriptObject (void *obj, int typeId)=0 |
Release the script object pointer. | |
virtual void | AddRefScriptObject (void *obj, int typeId)=0 |
Increase the reference counter for the script object. | |
virtual bool | IsHandleCompatibleWithObject (void *obj, int objTypeId, int handleTypeId)=0 |
Returns true if the object referenced by a handle compatible with the specified type. | |
virtual int | CompareScriptObjects (bool &result, int behaviour, void *leftObj, void *rightObj, int typeId)=0 |
Performs a comparison of two objects using the specified operator behaviour. | |
virtual int | ExecuteString (const char *module, const char *script, asIScriptContext **ctx=0, asDWORD flags=0)=0 |
Compiles and executes script statements within the context of a module. | |
virtual int | GarbageCollect (bool doFullCycle=true)=0 |
Perform garbage collection. | |
virtual int | GetObjectsInGarbageCollectorCount ()=0 |
Returns the number of objects currently referenced by the garbage collector. | |
virtual void | NotifyGarbageCollectorOfNewObject (void *obj, int typeId)=0 |
Notify the garbage collector of a new object that needs to be managed. | |
virtual void | GCEnumCallback (void *obj)=0 |
Used by the garbage collector to enumerate all references held by an object. | |
virtual int | SaveByteCode (const char *module, asIBinaryStream *out)=0 |
Save compiled bytecode to a binary stream. | |
virtual int | LoadByteCode (const char *module, asIBinaryStream *in)=0 |
Load pre-compiled bytecode from a binary stream. |
virtual int asIScriptEngine::AddRef | ( | ) | [pure virtual] |
virtual int asIScriptEngine::Release | ( | ) | [pure virtual] |
virtual int asIScriptEngine::SetEngineProperty | ( | asEEngineProp | property, | |
asPWORD | value | |||
) | [pure virtual] |
[in] | property | One of the asEEngineProp values. |
[in] | value | The new value of the property. |
asINVALID_ARG | Invalid property. |
virtual asPWORD asIScriptEngine::GetEngineProperty | ( | asEEngineProp | property | ) | [pure virtual] |
[in] | property | One of the asEEngineProp values. |
virtual int asIScriptEngine::SetMessageCallback | ( | const asSFuncPtr & | callback, | |
void * | obj, | |||
asDWORD | callConv | |||
) | [pure virtual] |
[in] | callback | A function or class method pointer. |
[in] | obj | The object for methods, or an optional parameter for functions. |
[in] | callConv | The calling convention. |
asINVALID_ARG | One of the arguments is incorrect, e.g. obj is null for a class method. | |
asNOT_SUPPORTED | The arguments are not supported, e.g. asCALL_GENERIC. |
void MyClass::MessageCallback(const asSMessageInfo *msg); r = engine->SetMessageCallback(asMETHOD(MyClass,MessageCallback), &obj, asCALL_THISCALL);
void MessageCallback(const asSMessageInfo *msg, void *param); r = engine->SetMessageCallback(asFUNCTION(MessageCallback), param, asCALL_CDECL);
virtual int asIScriptEngine::ClearMessageCallback | ( | ) | [pure virtual] |
virtual int asIScriptEngine::WriteMessage | ( | const char * | section, | |
int | row, | |||
int | col, | |||
asEMsgType | type, | |||
const char * | message | |||
) | [pure virtual] |
[in] | section | The name of the script section. |
[in] | row | The row number. |
[in] | col | The column number. |
[in] | type | The message type. |
[in] | message | The message text. |
asINVALID_ARG | The section or message is null. |
virtual int asIScriptEngine::RegisterObjectType | ( | const char * | name, | |
int | byteSize, | |||
asDWORD | flags | |||
) | [pure virtual] |
[in] | name | The name of the type. |
[in] | byteSize | The size of the type in bytes. Only necessary for value types. |
[in] | flags | One or more of the asEObjTypeFlags. |
asINVALID_ARG | The flags are invalid. | |
asINVALID_NAME | The name is invalid. | |
asALREADY_REGISTERED | Another type of the same name already exists. | |
asNAME_TAKEN | The name conflicts with other symbol names. | |
asLOWER_ARRAY_DIMENSION_NOT_REGISTERED | When registering an array type the array element must be a primitive or a registered type. | |
asINVALID_TYPE | The array type was not properly formed. | |
asNOT_SUPPORTED | The array type is not supported, or already in use preventing it from being overloaded. |
virtual int asIScriptEngine::RegisterObjectProperty | ( | const char * | obj, | |
const char * | declaration, | |||
int | byteOffset | |||
) | [pure virtual] |
[in] | obj | The name of the type. |
[in] | declaration | The property declaration in script syntax. |
[in] | byteOffset | The offset into the memory block where this property is found. |
asWRONG_CONFIG_GROUP | The object type was registered in a different configuration group. | |
asINVALID_OBJECT | The obj does not specify an object type. | |
asINVALID_TYPE | The obj parameter has invalid syntax. | |
asINVALID_DECLARATION | The declaration is invalid. | |
asNAME_TAKEN | The name conflicts with other members. |
struct MyType {float prop;}; r = engine->RegisterObjectProperty("MyType", "float prop", offsetof(MyType, prop)));
virtual int asIScriptEngine::RegisterObjectMethod | ( | const char * | obj, | |
const char * | declaration, | |||
const asSFuncPtr & | funcPointer, | |||
asDWORD | callConv | |||
) | [pure virtual] |
[in] | obj | The name of the type. |
[in] | declaration | The declaration of the method in script syntax. |
[in] | funcPointer | The method or function pointer. |
[in] | callConv | The calling convention for the method or function. |
asWRONG_CONFIG_GROUP | The object type was registered in a different configuration group. | |
asNOT_SUPPORTED | The calling convention is not supported. | |
asINVALID_TYPE | The obj parameter is not a valid object name. | |
asINVALID_DECLARATION | The declaration is invalid. | |
asNAME_TAKEN | The name conflicts with other members. | |
asWRONG_CALLING_CONV | The function's calling convention isn't compatible with callConv. |
virtual int asIScriptEngine::RegisterObjectBehaviour | ( | const char * | obj, | |
asEBehaviours | behaviour, | |||
const char * | declaration, | |||
const asSFuncPtr & | funcPointer, | |||
asDWORD | callConv | |||
) | [pure virtual] |
[in] | obj | The name of the type. |
[in] | behaviour | One of the object behaviours from asEBehaviours. |
[in] | declaration | The declaration of the method in script syntax. |
[in] | funcPointer | The method or function pointer. |
[in] | callConv | The calling convention for the method or function. |
asWRONG_CONFIG_GROUP | The object type was registered in a different configuration group. | |
asINVALID_ARG | obj is not set, or a global behaviour is given in behaviour. | |
asWRONG_CALLING_CONV | The function's calling convention isn't compatible with callConv. | |
asNOT_SUPPORTED | The calling convention or the behaviour signature is not supported. | |
asINVALID_TYPE | The obj parameter is not a valid object name. | |
asINVALID_DECLARATION | The declaration is invalid. | |
asILLEGAL_BEHAVIOUR_FOR_TYPE | The behaviour is not allowed for this type. | |
asALREADY_REGISTERED | The behaviour is already registered with the same signature. |
virtual int asIScriptEngine::RegisterGlobalProperty | ( | const char * | declaration, | |
void * | pointer | |||
) | [pure virtual] |
[in] | declaration | The declaration of the global property in script syntax. |
[in] | pointer | The address of the property that will be used to access the property value. |
asINVALID_DECLARATION | The declaration has invalid syntax. | |
asINVALID_TYPE | The declaration is a reference. | |
asNAME_TAKEN | The name is already taken. |
When registering the property, the application must pass the address to the actual value. The application must also make sure that this address remains valid throughout the life time of this registration, i.e. until the engine is released or the dynamic configuration group is removed.
virtual int asIScriptEngine::RegisterGlobalFunction | ( | const char * | declaration, | |
const asSFuncPtr & | funcPointer, | |||
asDWORD | callConv | |||
) | [pure virtual] |
[in] | declaration | The declaration of the global function in script syntax. |
[in] | funcPointer | The function pointer. |
[in] | callConv | The calling convention for the function. |
asNOT_SUPPORTED | The calling convention is not supported. | |
asWRONG_CALLING_CONV | The function's calling convention doesn't match callConv. | |
asINVALID_DECLARATION | The function declaration is invalid. | |
asNAME_TAKEN | The function name is already used elsewhere. |
virtual int asIScriptEngine::RegisterGlobalBehaviour | ( | asEBehaviours | behaviour, | |
const char * | declaration, | |||
const asSFuncPtr & | funcPointer, | |||
asDWORD | callConv | |||
) | [pure virtual] |
[in] | behaviour | The global behaviour. |
[in] | declaration | The declaration of the behaviour function in script syntax. |
[in] | funcPointer | The function pointer. |
[in] | callConv | The calling convention for the function. |
asNOT_SUPPORTED | The calling convention is not supported. | |
asWRONG_CALLING_CONV | The function's calling convention doesn't match callConv. | |
asINVALID_DECLARATION | The function declaration is invalid. | |
asINVALID_ARG | The behaviour is not a global behaviour. |
Behaviours may only be registered for object types registered by the application.
Behaviours shouldn't be registered to take handles as their parameters, use references instead. Unlike functions, methods, and constructors, overloaded operators may receive a reference to the true object instead of a dummy object, but it also may not so don't rely on it. Output references are not supported by behaviours.
If the parameter is sent by reference, then declare it as const, as it may allow the compiler to optimize the code to execute faster.
virtual int asIScriptEngine::RegisterInterface | ( | const char * | name | ) | [pure virtual] |
[in] | name | The name of the interface. |
asINVALID_NAME | The name is null, or a reserved keyword. | |
asALREADY_REGISTERED | An object type with this name already exists. | |
asERROR | The name is not a proper identifier. | |
asNAME_TAKEN | The name is already used elsewhere. |
virtual int asIScriptEngine::RegisterInterfaceMethod | ( | const char * | intf, | |
const char * | declaration | |||
) | [pure virtual] |
[in] | intf | The name of the interface. |
[in] | declaration | The method declaration. |
asWRONG_CONFIG_GROUP | The interface was registered in another configuration group. | |
asINVALID_TYPE | intf is not an interface type. | |
asINVALID_DECLARATION | The declaration is invalid. | |
asNAME_TAKEN | The method name is already taken. |
virtual int asIScriptEngine::RegisterEnum | ( | const char * | type | ) | [pure virtual] |
[in] | type | The name of the enum type. |
asINVALID_NAME | type is null. | |
asALREADY_REGISTERED | Another type with this name already exists. | |
asERROR | The type couldn't be parsed. | |
asINVALID_NAME | The type is not an identifier, or it is a reserved keyword. | |
asNAME_TAKEN | The type name is already taken. |
virtual int asIScriptEngine::RegisterEnumValue | ( | const char * | type, | |
const char * | name, | |||
int | value | |||
) | [pure virtual] |
[in] | type | The name of the enum type. |
[in] | name | The name of the enum value. |
[in] | value | The integer value of the enum value. |
asWRONG_CONFIG_GROUP | The enum type was registered in a different configuration group. | |
asINVALID_TYPE | The type is invalid. | |
asALREADY_REGISTERED | The name is already registered for this enum. |
virtual int asIScriptEngine::RegisterTypedef | ( | const char * | type, | |
const char * | decl | |||
) | [pure virtual] |
[in] | type | The name of the new typedef |
[in] | decl | The datatype that the typedef represents |
asINVALID_NAME | The type is null. | |
asALREADY_REGISTERED | A type with the same name already exists. | |
asINVALID_TYPE | The decl is not a primitive type. | |
asINVALID_NAME | The type is not an identifier, or it is a reserved keyword. | |
asNAME_TAKEN | The name is already used elsewhere. |
Currently typedefs can only be registered for built-in primitive types.
virtual int asIScriptEngine::RegisterStringFactory | ( | const char * | datatype, | |
const asSFuncPtr & | factoryFunc, | |||
asDWORD | callConv | |||
) | [pure virtual] |
[in] | datatype | The datatype that the string factory returns |
[in] | factoryFunc | The pointer to the factory function |
[in] | callConv | The calling convention of the factory function |
asNOT_SUPPORTED | The calling convention is not supported. | |
asWRONG_CALLING_CONV | The function's calling convention doesn't match callConv. | |
asINVALID_TYPE | The datatype is not a valid type. |
// Our string factory implementation std::string StringFactory(unsigned int length, const char *s) { return std::string(s); } // Registering the string factory int r = engine->RegisterStringFactory("string", asFUNCTION(StringFactory), asCALL_CDECL); assert( r >= 0 );
The example assumes that the std::string type has been registered as the string type, with RegisterObjectType.
virtual int asIScriptEngine::BeginConfigGroup | ( | const char * | groupName | ) | [pure virtual] |
[in] | groupName | The name of the configuration group |
asNAME_TAKEN | Another group with the same name already exists. | |
asNOT_SUPPORTED | Nesting configuration groups is not supported. |
virtual int asIScriptEngine::EndConfigGroup | ( | ) | [pure virtual] |
asNOT_SUPPORTED | Can't end a group that hasn't been begun. |
virtual int asIScriptEngine::RemoveConfigGroup | ( | const char * | groupName | ) | [pure virtual] |
[in] | groupName | The name of the configuration group |
asCONFIG_GROUP_IS_IN_USE | The group is in use and cannot be removed. |
virtual int asIScriptEngine::SetConfigGroupModuleAccess | ( | const char * | groupName, | |
const char * | module, | |||
bool | hasAccess | |||
) | [pure virtual] |
[in] | groupName | The name of the configuration group |
[in] | module | The module name |
[in] | hasAccess | Whether the module has access or not to the group members |
asWRONG_CONFIG_GROUP | No group with the groupName was found. |
The default module access is granted. The default for a group can be changed by specifying the modulename asALL_MODULES.
virtual int asIScriptEngine::AddScriptSection | ( | const char * | module, | |
const char * | name, | |||
const char * | code, | |||
size_t | codeLength, | |||
int | lineOffset = 0 | |||
) | [pure virtual] |
[in] | module | The name of the module |
[in] | name | The name of the script section |
[in] | code | The script code buffer |
[in] | codeLength | The length of the script code |
[in] | lineOffset | An offset that will be added to compiler message line numbers |
asNO_MODULE | The module was not found. |
The code added is copied by the engine, so there is no need to keep the original buffer after the call. Note that this can be changed by setting the engine property asEP_COPY_SCRIPT_SECTIONS with SetEngineProperty.
virtual int asIScriptEngine::Build | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module |
asINVALID_CONFIGURATION | The engine configuration is invalid. | |
asNO_MODULE | The module was not found. | |
asERROR | The script failed to build. | |
asBUILD_IN_PROGRESS | Another thread is currently building. |
Compiler messages are sent to the message callback function set with SetMessageCallback. If there are no errors or warnings, no messages will be sent to the callback function.
virtual int asIScriptEngine::Discard | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module |
asNO_MODULE | The module was not found. |
virtual int asIScriptEngine::ResetModule | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module |
asNO_MODULE | The module was not found. | |
asERROR | The module was not compiled successfully. |
virtual int asIScriptEngine::GetFunctionCount | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module. |
asNO_MODULE | The module was not found. | |
asERROR | The module was not compiled successfully. |
virtual int asIScriptEngine::GetFunctionIDByIndex | ( | const char * | module, | |
int | index | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | index | The index of the function. |
asNO_MODULE | The module was not found. |
virtual int asIScriptEngine::GetFunctionIDByName | ( | const char * | module, | |
const char * | name | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | name | The name of the function. |
asNO_MODULE | The module was not found. | |
asERROR | The module was not compiled successfully. | |
asMULTIPLE_FUNCTIONS | Found multiple matching functions. | |
asNO_FUNCTION | Didn't find any matching functions. |
virtual int asIScriptEngine::GetFunctionIDByDecl | ( | const char * | module, | |
const char * | decl | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | decl | The function signature. |
asNO_MODULE | The module was not found. | |
asERROR | The module was not compiled successfully. | |
asINVALID_DECLARATION | The decl is invalid. | |
asMULTIPLE_FUNCTIONS | Found multiple matching functions. | |
asNO_FUNCTION | Didn't find any matching functions. |
The method will find the script function with the exact same declaration.
virtual const char* asIScriptEngine::GetFunctionDeclaration | ( | int | funcId, | |
int * | length = 0 | |||
) | [pure virtual] |
[in] | funcId | The function id. |
[out] | length | A pointer to the variable that will receive the length of the returned string. |
virtual const char* asIScriptEngine::GetFunctionName | ( | int | funcId, | |
int * | length = 0 | |||
) | [pure virtual] |
[in] | funcId | The function id. |
[out] | length | A pointer to the variable that will receive the length of the returned string. |
virtual const char* asIScriptEngine::GetFunctionModule | ( | int | funcId, | |
int * | length = 0 | |||
) | [pure virtual] |
[in] | funcId | The function id. |
[out] | length | A pointer to the variable that will receive the length of the returned string. |
virtual const char* asIScriptEngine::GetFunctionSection | ( | int | funcId, | |
int * | length = 0 | |||
) | [pure virtual] |
[in] | funcId | The function id. |
[out] | length | A pointer to the variable that will receive the length of the returned string. |
virtual asIScriptFunction* asIScriptEngine::GetFunctionDescriptorByIndex | ( | const char * | module, | |
int | index | |||
) | [pure virtual] |
[in] | module | The module name. |
[in] | index | The index of the function. |
virtual asIScriptFunction* asIScriptEngine::GetFunctionDescriptorById | ( | int | funcId | ) | [pure virtual] |
[in] | funcId | The id of the function or method. |
virtual int asIScriptEngine::GetMethodCount | ( | int | typeId | ) | [pure virtual] |
[in] | typeId | The object type id. |
asINVALID_ARG | typeId is not a type. | |
asINVALID_TYPE | typeId is not an object type. |
virtual int asIScriptEngine::GetMethodIDByIndex | ( | int | typeId, | |
int | index | |||
) | [pure virtual] |
[in] | typeId | The object type id. |
[in] | index | The index of the method. |
asINVALID_ARG | typeId is not a type, or index is out of bounds. | |
asINVALID_TYPE | typeId is not an object type. |
virtual int asIScriptEngine::GetMethodIDByName | ( | int | typeId, | |
const char * | name | |||
) | [pure virtual] |
[in] | typeId | The object type id. |
[in] | name | The name of the method. |
asINVALID_ARG | typeId is not a type, or index is out of bounds. | |
asINVALID_TYPE | typeId is not an object type. | |
asMULTIPLE_FUNCTIONS | Found multiple matching methods. | |
asNO_FUNCTION | Didn't find any matching method. |
virtual int asIScriptEngine::GetMethodIDByDecl | ( | int | typeId, | |
const char * | decl | |||
) | [pure virtual] |
[in] | typeId | The object type id. |
[in] | decl | The method signature. |
asINVALID_ARG | typeId is not a type, or index is out of bounds. | |
asINVALID_TYPE | typeId is not an object type. | |
asMULTIPLE_FUNCTIONS | Found multiple matching methods. | |
asNO_FUNCTION | Didn't find any matching method. | |
asINVALID_DECLARATION | decl is not a valid declaration. | |
asNO_MODULE | The type is not a script class or interface. | |
asERROR | The module for the type was not built successfully. |
The method will find the script method with the exact same declaration.
virtual asIScriptFunction* asIScriptEngine::GetMethodDescriptorByIndex | ( | int | typeId, | |
int | index | |||
) | [pure virtual] |
[in] | typeId | The object type id. |
[in] | index | The index of the method. |
virtual int asIScriptEngine::GetGlobalVarCount | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module. |
asNO_MODULE | The module was not found. |
virtual int asIScriptEngine::GetGlobalVarIndexByName | ( | const char * | module, | |
const char * | name | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | name | The name of the global variable. |
asNO_MODULE | The module was not found. | |
asERROR | The module for the type was not built successfully. | |
asNO_GLOBAL_VAR | The matching global variable was found. |
virtual int asIScriptEngine::GetGlobalVarIndexByDecl | ( | const char * | module, | |
const char * | decl | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | decl | The global variable declaration. |
asNO_MODULE | The module was not found. | |
asERROR | The module for the type was not built successfully. | |
asNO_GLOBAL_VAR | The matching global variable was found. |
The method will find the script variable with the exact same declaration.
virtual const char* asIScriptEngine::GetGlobalVarDeclaration | ( | const char * | module, | |
int | index, | |||
int * | length = 0 | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | index | The index of the global variable. |
[out] | length | The length of the returned string. |
virtual const char* asIScriptEngine::GetGlobalVarName | ( | const char * | module, | |
int | index, | |||
int * | length = 0 | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | index | The index of the global variable. |
[out] | length | The length of the returned string. |
virtual void* asIScriptEngine::GetAddressOfGlobalVar | ( | const char * | module, | |
int | index | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | index | The index of the global variable. |
virtual int asIScriptEngine::GetGlobalVarIDByIndex | ( | const char * | module, | |
int | index | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | index | The index of the global variable. |
asNO_MODULE | The module was not found. |
virtual int asIScriptEngine::GetGlobalVarIDByName | ( | const char * | module, | |
const char * | name | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | name | The name of the global variable. |
asNO_MODULE | The module was not found. | |
asERROR | The module for the type was not built successfully. | |
asNO_GLOBAL_VAR | The matching global variable was found. |
virtual int asIScriptEngine::GetGlobalVarIDByDecl | ( | const char * | module, | |
const char * | decl | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | decl | The global variable declaration. |
asNO_MODULE | The module was not found. | |
asERROR | The module for the type was not built successfully. | |
asNO_GLOBAL_VAR | The matching global variable was found. |
The method will find the script variable with the exact same declaration.
virtual const char* asIScriptEngine::GetGlobalVarDeclaration | ( | int | gvarID, | |
int * | length = 0 | |||
) | [pure virtual] |
[in] | gvarID | The global variable id. |
[out] | length | The length of the returned string. |
virtual const char* asIScriptEngine::GetGlobalVarName | ( | int | gvarID, | |
int * | length = 0 | |||
) | [pure virtual] |
[in] | gvarID | The global variable id. |
[out] | length | The length of the returned string. |
virtual void* asIScriptEngine::GetGlobalVarPointer | ( | int | gvarID | ) | [pure virtual] |
[in] | gvarID | The global variable id. |
For object variables, you'll receive a pointer to a pointer to the object, because that's how objects are stored in AngelScript. Note that the returned pointer may point to a null pointer if the variable hasn't been initialized yet.
virtual int asIScriptEngine::GetImportedFunctionCount | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module. |
asNO_MODULE | The module was not found. | |
asERROR | The module was not built successfully. |
virtual int asIScriptEngine::GetImportedFunctionIndexByDecl | ( | const char * | module, | |
const char * | decl | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | decl | The function declaration of the imported function. |
asNO_MODULE | The module was not found. | |
asERROR | The module was not built successfully. | |
asMULTIPLE_FUNCTIONS | Found multiple matching functions. | |
asNO_FUNCTION | Didn't find any matching function. |
virtual const char* asIScriptEngine::GetImportedFunctionDeclaration | ( | const char * | module, | |
int | importIndex, | |||
int * | length = 0 | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | importIndex | The index of the imported function. |
[out] | length | The length of the returned string. |
virtual const char* asIScriptEngine::GetImportedFunctionSourceModule | ( | const char * | module, | |
int | importIndex, | |||
int * | length = 0 | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | importIndex | The index of the imported function. |
[out] | length | The length of the returned string. |
virtual int asIScriptEngine::BindImportedFunction | ( | const char * | module, | |
int | importIndex, | |||
int | funcId | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | importIndex | The index of the imported function. |
[in] | funcId | The function id of the function that will be bound to the imported function. |
asNO_MODULE | The module was not found. | |
asNO_FUNCTION | importIndex or fundId is incorrect. | |
asINVALID_INTERFACE | The signature of function doesn't match the import statement. |
virtual int asIScriptEngine::UnbindImportedFunction | ( | const char * | module, | |
int | importIndex | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | importIndex | The index of the imported function. |
asNO_MODULE | The module was not found. |
virtual int asIScriptEngine::BindAllImportedFunctions | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module. |
asNO_MODULE | The module was not found. | |
asERROR | An error occurred. | |
asCANT_BIND_ALL_FUNCTIONS | Not all functions where bound. |
virtual int asIScriptEngine::UnbindAllImportedFunctions | ( | const char * | module | ) | [pure virtual] |
[in] | module | The name of the module. |
asNO_MODULE | The module was not found. |
virtual int asIScriptEngine::GetTypeIdByDecl | ( | const char * | module, | |
const char * | decl | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | decl | The declaration of the type. |
asINVALID_TYPE | decl is not a valid type. |
The type id is based on a sequence number and depends on the order in which the type ids are queried, thus is not guaranteed to always be the same for each execution of the application.
A base type yields the same type id whether the declaration is const or not, however if the const is for the subtype then the type id is different, e.g. string@ isn't the same as const string@ but string is the same as const string.
virtual const char* asIScriptEngine::GetTypeDeclaration | ( | int | typeId, | |
int * | length = 0 | |||
) | [pure virtual] |
[in] | typeId | The type id of the type. |
[out] | length | The length of the returned string. |
virtual int asIScriptEngine::GetSizeOfPrimitiveType | ( | int | typeId | ) | [pure virtual] |
[in] | typeId | The type id of the type. |
virtual asIObjectType* asIScriptEngine::GetObjectTypeById | ( | int | typeId | ) | [pure virtual] |
[in] | typeId | The type id of the type. |
virtual asIObjectType* asIScriptEngine::GetObjectTypeByIndex | ( | asUINT | index | ) | [pure virtual] |
[in] | index | The index of the type. |
virtual int asIScriptEngine::GetObjectTypeCount | ( | ) | [pure virtual] |
virtual int asIScriptEngine::SetDefaultContextStackSize | ( | asUINT | initial, | |
asUINT | maximum | |||
) | [pure virtual] |
[in] | initial | The smallest stack size |
[in] | maximum | The largest stack size |
The context will always make sure there is enough stack size to execute the function, even if the initial stack size is set too low. If the maximum stack size is larger than 0 then the stack size will only until the size has been reached. Each time the stack grows its size is doubled, which means that the stack size can be at most 2 times the maximum size.
virtual asIScriptContext* asIScriptEngine::CreateContext | ( | ) | [pure virtual] |
virtual void* asIScriptEngine::CreateScriptObject | ( | int | typeId | ) | [pure virtual] |
[in] | typeId | The type id of the object to create. |
This only works for objects, for primitive types and object handles the method doesn't do anything and returns a null pointer.
virtual void* asIScriptEngine::CreateScriptObjectCopy | ( | void * | obj, | |
int | typeId | |||
) | [pure virtual] |
[in] | obj | A pointer to the source object. |
[in] | typeId | The type id of the object. |
This only works for objects, for primitive types and object handles the method doesn't do anything and returns a null pointer.
virtual void asIScriptEngine::CopyScriptObject | ( | void * | dstObj, | |
void * | srcObj, | |||
int | typeId | |||
) | [pure virtual] |
[in] | dstObj | A pointer to the destination object. |
[in] | srcObj | A pointer to the source object. |
[in] | typeId | The type id of the objects. |
This only works for objects.
virtual void asIScriptEngine::ReleaseScriptObject | ( | void * | obj, | |
int | typeId | |||
) | [pure virtual] |
[in] | obj | A pointer to the object. |
[in] | typeId | The type id of the object. |
This only works for objects.
virtual void asIScriptEngine::AddRefScriptObject | ( | void * | obj, | |
int | typeId | |||
) | [pure virtual] |
[in] | obj | A pointer to the object. |
[in] | typeId | The type id of the object. |
This only works for objects.
virtual bool asIScriptEngine::IsHandleCompatibleWithObject | ( | void * | obj, | |
int | objTypeId, | |||
int | handleTypeId | |||
) | [pure virtual] |
[in] | obj | A pointer to the object. |
[in] | objTypeId | The type id of the object. |
[in] | handleTypeId | The type id of the handle. |
virtual int asIScriptEngine::CompareScriptObjects | ( | bool & | result, | |
int | behaviour, | |||
void * | leftObj, | |||
void * | rightObj, | |||
int | typeId | |||
) | [pure virtual] |
[out] | result | The result of the comparison |
[in] | behaviour | One of the comparison behaviours from asEBehaviours. |
[in] | leftObj | A pointer to the left object. |
[in] | rightObj | A pointer to the right object. |
[in] | typeId | The type id of the objects. |
asINVALID_TYPE | The typeId must be an object type. | |
asINVALID_ARG | The behaviour must be one of the comparison behaviours. | |
asNOT_SUPPORTED | The comparison operator is not supported by this type. |
virtual int asIScriptEngine::ExecuteString | ( | const char * | module, | |
const char * | script, | |||
asIScriptContext ** | ctx = 0 , |
|||
asDWORD | flags = 0 | |||
) | [pure virtual] |
[in] | module | The name of the module in which the string should be executed. |
[in] | script | The script string that will be executed. |
[in,out] | ctx | Either pass in your own context or receive the default context, depending on the flags parameter. |
[in] | flags | A combination of the values from asEExecStrFlags. |
asINVALID_CONFIGURATION | The engine configuration is invalid. | |
asINVALID_ARG | ctx is null and flags is asEXECSTRING_USE_MY_CONTEXT. | |
asERROR | The string failed to build. | |
asCONTEXT_ACTIVE | The context is already active or in suspended state. | |
asBUILD_IN_PROGRESS | Another thread is currently building. | |
asEXECUTION_PREPARED | The context has been prepared and is ready for execution. | |
asEXECUTION_ABORTED | The execution was aborted with a call to asIScriptContext::Abort. | |
asEXECUTION_SUSPENDED | The execution was suspended with a call to asIScriptContext::Suspend. | |
asEXECUTION_FINISHED | The execution finished successfully. | |
asEXECUTION_EXCEPTION | The execution ended with an exception. |
virtual int asIScriptEngine::GarbageCollect | ( | bool | doFullCycle = true |
) | [pure virtual] |
[in] | doFullCycle | Set to true if a full cycle should be done, or false if only an iterative step should be done. |
It is not necessary to do a full cycle with every call. This makes it possible to spread out the garbage collection time over a large period, thus not impacting the responsiveness of the application.
virtual int asIScriptEngine::GetObjectsInGarbageCollectorCount | ( | ) | [pure virtual] |
Note, that the objects that the garbage collector keeps track of may in turn hold references to other objects, but these are not reflected in the return value. Thus there is no way of knowing the exact amount of memory allocated directly and indirectly by the objects referred to by this function.
virtual void asIScriptEngine::NotifyGarbageCollectorOfNewObject | ( | void * | obj, | |
int | typeId | |||
) | [pure virtual] |
[in] | obj | A pointer to the newly created object. |
[in] | typeId | The type id of the object. |
virtual void asIScriptEngine::GCEnumCallback | ( | void * | obj | ) | [pure virtual] |
[in] | obj | A pointer to the references object. |
virtual int asIScriptEngine::SaveByteCode | ( | const char * | module, | |
asIBinaryStream * | out | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | out | The output stream. |
asNO_MODULE | The module couldn't be found. | |
asINVALID_ARG | The stream object wasn't specified. |
The pre-compiled byte code is currently not platform independent, so you need to make sure the byte code is compiled on a platform that is compatible with the one that will load it.
virtual int asIScriptEngine::LoadByteCode | ( | const char * | module, | |
asIBinaryStream * | in | |||
) | [pure virtual] |
[in] | module | The name of the module. |
[in] | in | The input stream. |
asNO_MODULE | The module couldn't be found. | |
asINVALID_ARG | The stream object wasn't specified. | |
asBUILD_IN_PROGRESS | Another thread is currently building. |
It is expected that the application performs the necessary validations to make sure the pre-compiled byte code is from a trusted source. The application should also make sure the pre-compiled byte code is compatible with the current engine configuration, i.e. that the engine has been configured in the same way as when the byte code was first compiled.