AngelScript

asIScriptFunction Class Reference

The interface for a script function description.

List of all members.

## 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 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.
Function info
virtual asIObjectType * | 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 * | GetDeclaration (bool includeObjectName=true) 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.
Parameter and return types
virtual asUINT | GetParamCount () const =0
| Returns the number of parameters for this function.
virtual int | GetParamTypeId (asUINT index, asDWORD *flags=0) const =0
| Returns the type id of the specified parameter.
virtual int | GetReturnTypeId () const =0
| Returns the type id of the return type.
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) const =0
| Returns the declaration of a local variable.
virtual int | FindNextLineWithCode (int line) const =0
| Returns the next line number with code.
JIT compilation
virtual asDWORD * | GetByteCode (asUINT *length=0)=0
| Returns the byte code buffer and length.
User data
virtual void * | SetUserData (void *userData)=0
| Register the memory address of some user data.
virtual void * | GetUserData () const =0
| Returns the address of the previously registered user data.

## Member Function Documentation

virtual int asIScriptFunction::AddRef | ( |  | ) | const`[pure virtual]`

Returns:
  The number of references to this object.

Call this method when storing an additional reference to the object.

virtual int asIScriptFunction::FindNextLineWithCode | ( | int | line | ) | const`[pure virtual]`

Parameters:

  [in] | line | A line number

Returns:
  The number of the next line with code, or a negative value if the line is outside the function.

virtual asDWORD* asIScriptFunction::GetByteCode | ( | asUINT * | length = `0` | ) | `[pure virtual]`

Parameters:

  [out] | length | The length of the byte code buffer in DWORDs

Returns:
  A pointer to the byte code buffer, or 0 if this is not a script function.

This function is used by the asIJITCompiler to obtain the byte code buffer for building the native machine code representation.

virtual const char* asIScriptFunction::GetConfigGroup | ( |  | ) | const`[pure virtual]`

Returns:
  The name of the config group, or null if not in any group.

virtual const char* asIScriptFunction::GetDeclaration | ( | bool | includeObjectName = `true` | ) | const`[pure virtual]`

Parameters:

  [in] | includeObjectName | Indicate whether the object name should be prepended to the function name

Returns:
  A null terminated string with the function declaration.

virtual asIScriptEngine* asIScriptFunction::GetEngine | ( |  | ) | const`[pure virtual]`

Returns:
  A pointer to the engine.

virtual asEFuncType asIScriptFunction::GetFuncType | ( |  | ) | const`[pure virtual]`

Returns:
  The type of the function

virtual int asIScriptFunction::GetId | ( |  | ) | const`[pure virtual]`

Returns:
  The id of the function

virtual const char* asIScriptFunction::GetModuleName | ( |  | ) | const`[pure virtual]`

Returns:
  A null terminated string with the module name.

virtual const char* asIScriptFunction::GetName | ( |  | ) | const`[pure virtual]`

Returns:
  A null terminated string with the name of the function.

virtual const char* asIScriptFunction::GetObjectName | ( |  | ) | const`[pure virtual]`

Returns:
  A null terminated string with the name of the object type if this a method.

virtual asIObjectType* asIScriptFunction::GetObjectType | ( |  | ) | const`[pure virtual]`

Returns:
  A pointer to the object type interface if this is a method.

This does not increase the reference count of the returned object type.

virtual asUINT asIScriptFunction::GetParamCount | ( |  | ) | const`[pure virtual]`

Returns:
  The number of parameters.

virtual int asIScriptFunction::GetParamTypeId | ( | asUINT | index,
|  | asDWORD * | flags = `0`
| ) |  | const`[pure virtual]`

Parameters:

  [in] | index | The zero based parameter index.
  [out] | flags | A combination of asETypeModifiers.

Returns:
  A negative value on error, or the type id of the specified parameter.

Return values:

  asINVALID_ARG | The index is out of bounds.

virtual int asIScriptFunction::GetReturnTypeId | ( |  | ) | const`[pure virtual]`

Returns:
  The type id of the return type.

virtual const char* asIScriptFunction::GetScriptSectionName | ( |  | ) | const`[pure virtual]`

Returns:
  A null terminated string with the script section name where the function was implemented.

virtual void* asIScriptFunction::GetUserData | ( |  | ) | const`[pure virtual]`

Returns:
  The pointer to the user data.

virtual int asIScriptFunction::GetVar | ( | asUINT | index,
|  | const char ** | name,
|  | int * | typeId = `0`
| ) |  | const`[pure virtual]`

Parameters:

  [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

Returns:
  A negative value on error

Return values:

  asINVALID_ARG | The index is out of range

virtual asUINT asIScriptFunction::GetVarCount | ( |  | ) | const`[pure virtual]`

Returns:
  The number of local variables in the function

virtual const char* asIScriptFunction::GetVarDecl | ( | asUINT | index | ) | const`[pure virtual]`

Parameters:

  [in] | index | The zero based index of the local variable

Returns:
  The declaration string, or null on error

virtual bool asIScriptFunction::IsPrivate | ( |  | ) | const`[pure virtual]`

Returns:
  True if the class method is private

virtual bool asIScriptFunction::IsReadOnly | ( |  | ) | const`[pure virtual]`

Returns:
  True if the class method is read-only

virtual int asIScriptFunction::Release | ( |  | ) | const`[pure virtual]`

Returns:
  The number of references to this object.

Call this method when you will no longer use the references that you own.

virtual void* asIScriptFunction::SetUserData | ( | void * | userData | ) | `[pure virtual]`

Parameters:

  [in] | userData | A pointer to the user data.

Returns:
  The previous pointer stored in the context.

This method allows the application to associate a value, e.g. a pointer, with the context instance.

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.

The documentation for this class was generated from the following file:

- angelscript.h