SourcePawn::IPluginFunction Class Reference

Encapsulates a function call in a plugin. More...

#include <public/sourcepawn/sp_vm_api.h>

Inherits SourcePawn::ICallable.

Inheritance diagram for SourcePawn::IPluginFunction:

[legend]
Collaboration diagram for SourcePawn::IPluginFunction:
[legend]
List of all members.

Public Member Functions

virtual int Execute (cell_t *result)=0
 Executes the function, resets the pushed parameter list, and performs any copybacks.
virtual int CallFunction (const cell_t *params, unsigned int num_params, cell_t *result)=0
 Executes the function with the given parameter array. Parameters are read in forward order (i.e. index 0 is parameter #1) NOTE: You will get an error if you attempt to use CallFunction() with previously pushed parameters.
virtual IPluginContextGetParentContext ()=0
 Deprecated, do not use.
virtual bool IsRunnable ()=0
 Returns whether the parent plugin is paused.
virtual funcid_t GetFunctionID ()=0
 Returns the function ID of this function.
virtual int Execute2 (IPluginContext *ctx, cell_t *result)=0
 Executes the forward, resets the pushed parameter list, and performs any copybacks.
virtual int CallFunction2 (IPluginContext *ctx, const cell_t *params, unsigned int num_params, cell_t *result)=0
 Executes the function with the given parameter array. Parameters are read in forward order (i.e. index 0 is parameter #1) NOTE: You will get an error if you attempt to use CallFunction() with previously pushed parameters.

Detailed Description

Encapsulates a function call in a plugin.

NOTE: Function calls must be atomic to one execution context. NOTE: This object should not be deleted. It lives for the lifetime of the plugin.

Definition at line 185 of file sp_vm_api.h.


Member Function Documentation

virtual int SourcePawn::IPluginFunction::Execute ( cell_t result  )  [pure virtual]

Executes the function, resets the pushed parameter list, and performs any copybacks.

Parameters:
result Pointer to store return value in.
Returns:
Error code, if any.

virtual int SourcePawn::IPluginFunction::CallFunction ( const cell_t params,
unsigned int  num_params,
cell_t result 
) [pure virtual]

Executes the function with the given parameter array. Parameters are read in forward order (i.e. index 0 is parameter #1) NOTE: You will get an error if you attempt to use CallFunction() with previously pushed parameters.

Parameters:
params Array of cell parameters.
num_params Number of parameters to push.
result Pointer to store result of function on return.
Returns:
SourcePawn error code (if any).

virtual IPluginContext* SourcePawn::IPluginFunction::GetParentContext (  )  [pure virtual]

Deprecated, do not use.

Returns:
GetDefaultContext() of parent runtime.

virtual bool SourcePawn::IPluginFunction::IsRunnable (  )  [pure virtual]

Returns whether the parent plugin is paused.

Returns:
True if runnable, false otherwise.

virtual funcid_t SourcePawn::IPluginFunction::GetFunctionID (  )  [pure virtual]

Returns the function ID of this function.

Note: This was added in API version 4.

Returns:
Function id.

virtual int SourcePawn::IPluginFunction::Execute2 ( IPluginContext ctx,
cell_t result 
) [pure virtual]

Executes the forward, resets the pushed parameter list, and performs any copybacks.

Note: A function can only be executed given a runtime it was created in.

Parameters:
ctx Context to execute the function in.
result Pointer to store return value in.
Returns:
Error code, if any.

virtual int SourcePawn::IPluginFunction::CallFunction2 ( IPluginContext ctx,
const cell_t params,
unsigned int  num_params,
cell_t result 
) [pure virtual]

Executes the function with the given parameter array. Parameters are read in forward order (i.e. index 0 is parameter #1) NOTE: You will get an error if you attempt to use CallFunction() with previously pushed parameters.

Note: A function can only be executed given a runtime it was created in.

Parameters:
ctx Context to execute the function in.
params Array of cell parameters.
num_params Number of parameters to push.
result Pointer to store result of function on return.
Returns:
SourcePawn error code (if any).


The documentation for this class was generated from the following file:
Generated on Fri Nov 21 05:10:05 2008 for SourceMod SDK by  doxygen 1.5.1