index

Reference: asIScriptGeneric

class asIScriptGeneric
{
public:
  void   *GetEngine();

  void   *GetObject();
	
  asDWORD GetArgDWord(asUINT arg);
  asQWORD GetArgQWord(asUINT arg);
  float   GetArgFloat(asUINT arg);
  double  GetArgDouble(asUINT arg);
  void   *GetArgAddress(asUINT arg);
  void   *GetArgObject(asUINT arg);
  void   *GetArgPointer(asUINT arg);

  int     SetReturnDWord(asDWORD val);
  int     SetReturnQWord(asQWORD val);
  int     SetReturnFloat(float val);
  int     SetReturnDouble(double val);
  int     SetReturnAddress(void *address);
  int     SetReturnObject(void *obj);
  void   *GetReturnPointer();
};

GetEngine

int GetEngine();

Description

This method returns the engine, for which this generic call is registered.

Returns

The engine pointer.

GetObject

void *GetObject();

Description

Retrieve the object pointer for the generic class method.

Returns

The object pointer.

GetArg

asDWORD GetArgDWord(asUINT arg);
asQWORD GetArgQWord(asUINT arg);
float   GetArgFloat(asUINT arg);
double  GetArgDouble(asUINT arg);
void   *GetArgAddress(asUINT arg);
void   *GetArgObject(asUINT arg);

Description

Gets the value of an argument, based on the index of the argument.

Arguments with the type of an object, shouldn't be released as the library will automatically do this when the function returns.

Parameters

arg 

The index of the argument, beginning with 0.

Returns

The value of the argument.

GetArgPointer

void *GetArgPointer(asUINT arg);

Description

Returns a pointer to the argument.

For primitives you get a pointer to the primitive itself. For references you get a pointer to the pointer to whatever is being referenced. For object handles you get a pointer to the pointer to the object. For objects you get a pointer to the pointer to the object.

Parameters

arg 

The index of the argument, beginning with 0.

Returns

The address of the argument.

SetReturn

int SetReturnDWord(asDWORD val);
int SetReturnQWord(asQWORD val);
int SetReturnFloat(float val);
int SetReturnDouble(double val);
int SetReturnAddress(void *address);
int SetReturnObject(void *obj);

Description

Sets the value that should be returned to the calling function.

If the function returns an object, the library will automatically do what is necessary based on how the object was declared, i.e. if the function was registered to return a handle then the library will call the addref behaviour. If it was registered to return an object by value, then the library will make a copy of the object.

Parameters

val 

The return value.

address 

The address of a value.

obj 

A pointer to an object.

Returns

A negative value if the method fails.

GetReturnPointer

void *GetReturnPointer();

Description

Gets the address to the location where the return value is to be placed.

You should copy the value to the location pointed to by the address. For primitives simply dereference and assign. For object handles, you must first increase the reference counter. For objects, you must make a copy of the object, and then pass the pointer to the new object.

Returns

The address to where the return value is to be stored.

top