class asIScriptGeneric { public: void *GetEngine(); int GetFunctionId(); void *GetObject(); asBYTE GetArgByte(asUINT arg); asWORD GetArgWord(asUINT arg); 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 GetArgTypeId(asUINT arg); int SetReturnByte(asBYTE val); int SetReturnWord(asWORD val); 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(); };
int GetEngine();
This method returns the engine, for which this generic call is registered.
The engine pointer.
void *GetFunctionId();
Retrieve the function id for the function or method being executed.
The function id.
void *GetObject();
Retrieve the object pointer for the generic class method.
The object pointer.
asBYTE GetArgByte(asUINT arg); asWORD GetArgWord(asUINT arg); asDWORD GetArgDWord(asUINT arg); asQWORD GetArgQWord(asUINT arg); float GetArgFloat(asUINT arg); double GetArgDouble(asUINT arg); void *GetArgAddress(asUINT arg); void *GetArgObject(asUINT arg);
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.
arg |
The index of the argument, beginning with 0. |
The value of the argument.
void *GetArgPointer(asUINT arg);
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.
arg |
The index of the argument, beginning with 0. |
The address of the argument.
int GetArgTypeId(asUINT arg);
Returns the type id of the argument.
arg |
The index of the argument, beginning with 0. |
The type id of the argument.
int SetReturnByte(asBYTE val); int SetReturnWord(asWORD val); int SetReturnDWord(asDWORD val); int SetReturnQWord(asQWORD val); int SetReturnFloat(float val); int SetReturnDouble(double val); int SetReturnAddress(void *address); int SetReturnObject(void *obj);
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.
val |
The return value. |
address |
The address of a value. |
obj |
A pointer to an object. |
A negative value if the method fails.
void *GetReturnPointer();
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.
The address to where the return value is to be stored.