Public Member Functions

SourcePawn::ISourcePawnEngine2 Class Reference

Outlines the interface a Virtual Machine (JIT) must expose. More...

#include <public/sourcepawn/sp_vm_api.h>

List of all members.

Public Member Functions

virtual unsigned int GetAPIVersion ()=0
 Returns the second engine API version.
virtual const char * GetEngineName ()=0
 Returns the string name of a VM implementation.
virtual const char * GetVersionString ()=0
 Returns a version string.
virtual ICompilationStartCompilation ()=0
 Creates a new compilation options object.
virtual IPluginRuntimeLoadPlugin (ICompilation *co, const char *file, int *err)=0
 Loads a plugin from disk.
virtual SPVM_NATIVE_FUNC CreateFakeNative (SPVM_FAKENATIVE_FUNC callback, void *pData)=0
 Creates a fake native and binds it to a general callback function.
virtual void DestroyFakeNative (SPVM_NATIVE_FUNC func)=0
 Destroys a fake native function wrapper.
virtual IDebugListenerSetDebugListener (IDebugListener *listener)=0
 Sets the debug listener. This should only be called once. If called successively (using manual chaining), only the last function should attempt to call back into the same plugin. Otherwise, globally cached states can be accidentally overwritten.
virtual void SetProfiler (IProfiler *profiler)=0
 Sets the global profiler.
virtual const char * GetErrorString (int err)=0
 Returns the string representation of an error message.
virtual bool Initialize ()=0
 Initializes the SourcePawn engine.
virtual void Shutdown ()=0
 Shuts down the SourcePawn engine. Only needs to be called if Initialize() succeeded.
virtual IPluginRuntimeCreateEmptyRuntime (const char *name, uint32_t memory)=0
 Creates an empty plugin with a blob of memory.

Detailed Description

Outlines the interface a Virtual Machine (JIT) must expose.

Definition at line 1170 of file sp_vm_api.h.


Member Function Documentation

virtual unsigned int SourcePawn::ISourcePawnEngine2::GetAPIVersion (  )  [pure virtual]

Returns the second engine API version.

Returns:
API version.
virtual const char* SourcePawn::ISourcePawnEngine2::GetVersionString (  )  [pure virtual]

Returns a version string.

Returns:
Versioning string.
virtual ICompilation* SourcePawn::ISourcePawnEngine2::StartCompilation (  )  [pure virtual]

Creates a new compilation options object.

Returns:
Compilation options object.
virtual IPluginRuntime* SourcePawn::ISourcePawnEngine2::LoadPlugin ( ICompilation co,
const char *  file,
int *  err 
) [pure virtual]

Loads a plugin from disk.

If a compilation object is supplied, it is destroyed upon the function's return.

Parameters:
co Compilation options, or NULL for defaults.
file Path to the file to compile.
err Error code (filled on failure); required.
Returns:
New runtime pointer, or NULL on failure.
virtual SPVM_NATIVE_FUNC SourcePawn::ISourcePawnEngine2::CreateFakeNative ( SPVM_FAKENATIVE_FUNC  callback,
void *  pData 
) [pure virtual]

Creates a fake native and binds it to a general callback function.

Parameters:
callback Callback function to bind the native to.
pData Private data to pass to the callback when the native is invoked.
Returns:
A new fake native function as a wrapper around the callback.
virtual void SourcePawn::ISourcePawnEngine2::DestroyFakeNative ( SPVM_NATIVE_FUNC  func  )  [pure virtual]

Destroys a fake native function wrapper.

Parameters:
func Pointer to the fake native created by CreateFakeNative.
virtual IDebugListener* SourcePawn::ISourcePawnEngine2::SetDebugListener ( IDebugListener listener  )  [pure virtual]

Sets the debug listener. This should only be called once. If called successively (using manual chaining), only the last function should attempt to call back into the same plugin. Otherwise, globally cached states can be accidentally overwritten.

Parameters:
listener Pointer to an IDebugListener.
Returns:
Old IDebugListener, or NULL if none.
virtual void SourcePawn::ISourcePawnEngine2::SetProfiler ( IProfiler profiler  )  [pure virtual]

Sets the global profiler.

Parameters:
profiler Profiler pointer.
virtual const char* SourcePawn::ISourcePawnEngine2::GetErrorString ( int  err  )  [pure virtual]

Returns the string representation of an error message.

Parameters:
err Error code.
Returns:
Error string, or NULL if not found.
virtual bool SourcePawn::ISourcePawnEngine2::Initialize (  )  [pure virtual]

Initializes the SourcePawn engine.

Returns:
True on success, false if failed.
virtual IPluginRuntime* SourcePawn::ISourcePawnEngine2::CreateEmptyRuntime ( const char *  name,
uint32_t  memory 
) [pure virtual]

Creates an empty plugin with a blob of memory.

Parameters:
name Name, for debugging (NULL for anonymous).
bytes Number of bytes of memory (hea+stk).
Returns:
New runtime, or NULL if not enough memory.

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