The interface for a script function description.
Public Member Functions | |
Miscellaneous | |
virtual asIScriptEngine * | GetEngine () const =0 |
Returns a pointer to the script engine. | |
virtual int | AddRef () const =0 |
Increases the reference counter. | |
virtual int | Release () const =0 |
Decrease reference counter. | |
virtual int | GetId () const =0 |
Returns the id of the function. | |
virtual asEFuncType | GetFuncType () const =0 |
Returns the type of the function. | |
virtual const char * | GetModuleName () const =0 |
Returns the name of the module where the function was implemented. | |
virtual asIScriptModule * | GetModule () const =0 |
Returns the module where the function is declared. | |
virtual const char * | GetScriptSectionName () const =0 |
Returns the name of the script section where the function was implemented. | |
virtual const char * | GetConfigGroup () const =0 |
Returns the name of the config group in which the function was registered. | |
virtual asDWORD | GetAccessMask () const =0 |
Returns the access mast of the function. | |
virtual void * | GetAuxiliary () const =0 |
Returns the auxiliary object registered with the function. | |
Function signature | |
virtual asITypeInfo * | GetObjectType () const =0 |
Returns the object type for class or interface method. | |
virtual const char * | GetObjectName () const =0 |
Returns the name of the object for class or interface methods. | |
virtual const char * | GetName () const =0 |
Returns the name of the function or method. | |
virtual const char * | GetNamespace () const =0 |
Returns the namespace of the function. | |
virtual const char * | GetDeclaration (bool includeObjectName=true, bool includeNamespace=false, bool includeParamNames=false) const =0 |
Returns the function declaration. | |
virtual bool | IsReadOnly () const =0 |
Returns true if the class method is read-only. | |
virtual bool | IsPrivate () const =0 |
Returns true if the class method is private. | |
virtual bool | IsProtected () const =0 |
Returns true if the class method is protected. | |
virtual bool | IsFinal () const =0 |
Returns true if the method is final. | |
virtual bool | IsOverride () const =0 |
Returns true if the method is meant to override a method in the base class. | |
virtual bool | IsShared () const =0 |
Returns true if the function is shared. | |
virtual bool | IsExplicit () const =0 |
Returns true if the function is declared as 'explicit'. | |
virtual bool | IsProperty () const =0 |
Returns true if the function is declared as 'property'. | |
virtual asUINT | GetParamCount () const =0 |
Returns the number of parameters for this function. | |
virtual int | GetParam (asUINT index, int *typeId, asDWORD *flags=0, const char **name=0, const char **defaultArg=0) const =0 |
Returns the type id of the specified parameter. | |
virtual int | GetReturnTypeId (asDWORD *flags=0) const =0 |
Returns the type id of the return type. | |
Type id for function pointers | |
virtual int | GetTypeId () const =0 |
Returns the type id representing a function pointer for this function. | |
virtual bool | IsCompatibleWithTypeId (int typeId) const =0 |
Checks if the given type id can represent this function. | |
Delegates | |
virtual void * | GetDelegateObject () const =0 |
Returns the object for the delegate. | |
virtual asITypeInfo * | GetDelegateObjectType () const =0 |
Returns the type of the delegated object. | |
virtual asIScriptFunction * | GetDelegateFunction () const =0 |
Returns the function for the delegate. | |
Debug information | |
virtual asUINT | GetVarCount () const =0 |
Returns the number of local variables in the function. | |
virtual int | GetVar (asUINT index, const char **name, int *typeId=0) const =0 |
Returns information about a local variable. | |
virtual const char * | GetVarDecl (asUINT index, bool includeNamespace=false) const =0 |
Returns the declaration of a local variable. | |
virtual int | FindNextLineWithCode (int line) const =0 |
Returns the next line number with code. | |
virtual int | GetDeclaredAt (const char **scriptSection, int *row, int *col) const =0 |
Returns the location in the script where the function was declared. | |
JIT compilation | |
virtual asDWORD * | GetByteCode (asUINT *length=0)=0 |
Returns the byte code buffer and length. | |
virtual int | SetJITFunction (asJITFunction jitFunc)=0 |
Link the script function with a JIT compiled function. | |
virtual asJITFunction | GetJITFunction () const =0 |
Returns the linked JIT compiled function. | |
User data | |
virtual void * | SetUserData (void *userData, asPWORD type=0)=0 |
Register the memory address of some user data. | |
virtual void * | GetUserData (asPWORD type=0) const =0 |
Returns the address of the previously registered user data. | |
|
pure virtual |
Call this method when storing an additional reference to the object.
|
pure virtual |
[in] | line | A line number |
|
pure virtual |
|
pure virtual |
[out] | length | The length of the byte code buffer in DWORDs |
This function is used by the asIJITCompiler to obtain the byte code buffer for building the native machine code representation.
|
pure virtual |
|
pure virtual |
[in] | includeObjectName | Indicate whether the object name should be prepended to the function name |
[in] | includeNamespace | Indicates whether the namespace should be prepended to the function name and types |
[in] | includeParamNames | Indicates whether parameter names should be added to the declaration |
The parameter names are not stored for virtual methods. If you want to know the name of parameters to class methods, be sure to get the actual implementation rather than the virtual method.
The namespace will always be included for types that are declared in a different namespace than the function itself.
|
pure virtual |
[out] | scriptSection | The name of the script section where the function was declared |
[out] | row | The row number where the function was declared |
[out] | col | The column number where the function was declared |
asNOT_SUPPORTED | The function is not a script function |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
The id is always positive and larger than 0 for actual functions, and 0 for delegates.
|
pure virtual |
|
pure virtual |
The returned value can be null if the module doesn't exist anymore, or if the function is not owned by any module, e.g. registered by the application or it is a delegate.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
This does not increase the reference count of the returned object type.
|
pure virtual |
[in] | index | The zero based parameter index. |
[out] | typeId | The typeId of the parameter. |
[out] | flags | A combination of asETypeModifiers. |
[out] | name | The name of the parameter (or null if not defined). |
[out] | defaultArg | The default argument expression (or null if not defined). |
asINVALID_ARG | The index is out of bounds. |
The parameter names are not stored for virtual methods. If you want to know the name of parameters to class methods, be sure to get the actual implementation rather than the virtual method.
|
pure virtual |
|
pure virtual |
[out] | flags | A combination of asETypeModifiers. |
|
pure virtual |
The returned pointer is null when the function doesn't originate from a script file, i.e. a registered function or an auto-generated script function. It can also be null if the information has been removed, e.g. when saving bytecode without debug info.
|
pure virtual |
|
pure virtual |
[in] | type | An identifier specifying the user data to set. |
|
pure virtual |
[in] | index | The zero based index of the local variable |
[out] | name | Receives the name of the variable |
[out] | typeId | Receives the typeId of the variable |
asINVALID_ARG | The index is out of range |
asNOT_SUPPORTED | The function is not a script function |
|
pure virtual |
|
pure virtual |
[in] | index | The zero based index of the local variable |
[in] | includeNamespace | Set to true if the namespace should be included in the declaration. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Call this method when you will no longer use the references that you own.
|
pure virtual |
asNOT_SUPPORTED | The JIT interface used is not version 2 |
asERROR | The function is not a script function |
If a previous JIT function is linked, then AngelScript will call asIJITCompilerV2::CleanFunction to allow the JIT compiler to clean it up before linking the new function.
|
pure virtual |
[in] | userData | A pointer to the user data. |
[in] | type | An identifier specifying the user data to set. |
This method allows the application to associate a value, e.g. a pointer, with the context instance.
The type values 1000 through 1999 are reserved for use by the official add-ons.
Optionally, a callback function can be registered to clean up the user data when the function is destroyed. As the callback is registered with the engine, it is only necessary to do it once.