SourceMod SDK  1.7
INativeInvoker.h
Go to the documentation of this file.
1 
32 #ifndef _INCLUDE_SOURCEMOD_INATIVEINVOKER_H_
33 #define _INCLUDE_SOURCEMOD_INATIVEINVOKER_H_
34 
40 #include <IShareSys.h>
41 #include <sp_vm_api.h>
42 
43 #define SMINTERFACE_NINVOKE_NAME "INativeInterface"
44 #define SMINTERFACE_NINVOKE_VERSION 1
45 
46 #define NINVOKE_DEFAULT_MEMORY 16384
47 
48 namespace SourceMod
49 {
50  class INativeInvoker : public SourcePawn::ICallable
51  {
52  public:
56  virtual ~INativeInvoker()
57  {
58  }
59  public:
69  virtual bool Start(SourcePawn::IPluginContext *pContext, const char *name) = 0;
70 
78  virtual int Invoke(cell_t *result) = 0;
79  };
80 
85  {
86  public:
96  virtual SourcePawn::IPluginRuntime *CreateRuntime(const char *name, size_t bytes) = 0;
97 
103  virtual INativeInvoker *CreateInvoker() = 0;
104  };
105 }
106 
107 #endif /* _INCLUDE_SOURCEMOD_INATIVEINVOKER_H_ */
Factory for dealing with native invocations.
Definition: INativeInvoker.h:84
Defines the Share System, responsible for shared resources and dependencies.
virtual ~INativeInvoker()
Virtual destructor - use delete to free this.
Definition: INativeInvoker.h:56
Definition: INativeInvoker.h:50
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
Definition: IAdminSystem.h:63
virtual INativeInvoker * CreateInvoker()=0
Creates an object that can be used to invoke a single native code.
virtual SourcePawn::IPluginRuntime * CreateRuntime(const char *name, size_t bytes)=0
Creates a virtual plugin. This can be used as an environment to invoke natives.
virtual int Invoke(cell_t *result)=0
Invokes the native. The preparation state is cleared immediately, meaning that this object can be re-...
virtual bool Start(SourcePawn::IPluginContext *pContext, const char *name)=0
Begins a native call.