SourceMod SDK  1.7
SourceMod::IPlugin Class Referenceabstract

Encapsulates a run-time plugin as maintained by SourceMod. More...

#include <public/IPluginSys.h>

Public Member Functions

virtual ~IPlugin ()
 
virtual PluginType GetType ()=0
 Returns the lifetime of a plugin.
 
virtual SourcePawn::IPluginContext * GetBaseContext ()=0
 Returns the IPluginRuntime::GetDefaultContext() value. More...
 
virtual sp_context_t * GetContext ()=0
 Deprecated, returns NULL. More...
 
virtual void * GetPluginStructure ()=0
 Deprecated, returns NULL. More...
 
virtual const sm_plugininfo_tGetPublicInfo ()=0
 Returns information about the plugin by reference. More...
 
virtual const char * GetFilename ()=0
 Returns the plugin filename (relative to plugins dir).
 
virtual bool IsDebugging ()=0
 Returns true if a plugin is in debug mode, false otherwise.
 
virtual PluginStatus GetStatus ()=0
 Returns the plugin status.
 
virtual bool SetPauseState (bool paused)=0
 Sets whether the plugin is paused or not. More...
 
virtual unsigned int GetSerial ()=0
 Returns the unique serial number of a plugin.
 
virtual IdentityToken_t * GetIdentity ()=0
 Returns a plugin's identity token.
 
virtual bool SetProperty (const char *prop, void *ptr)=0
 Sets a property on this plugin. This is used for per-plugin data from extensions or other parts of core. The property's value must be manually destructed when the plugin is destroyed. More...
 
virtual bool GetProperty (const char *prop, void **ptr, bool remove=false)=0
 Gets a property from a plugin. More...
 
virtual SourcePawn::IPluginRuntime * GetRuntime ()=0
 Returns the runtime representing this plugin. More...
 
virtual IPhraseCollectionGetPhrases ()=0
 Returns the plugin's phrase collection. More...
 
virtual Handle_t GetMyHandle ()=0
 Returns a plugin's handle. More...
 

Detailed Description

Encapsulates a run-time plugin as maintained by SourceMod.

Constructor & Destructor Documentation

virtual SourceMod::IPlugin::~IPlugin ( )
inlinevirtual

Virtual destructor

Member Function Documentation

virtual SourcePawn::IPluginContext* SourceMod::IPlugin::GetBaseContext ( )
pure virtual

Returns the IPluginRuntime::GetDefaultContext() value.

Returns
Pointer to an IPluginContext, or NULL if not loaded.
virtual sp_context_t* SourceMod::IPlugin::GetContext ( )
pure virtual

Deprecated, returns NULL.

Returns
NULL.
virtual Handle_t SourceMod::IPlugin::GetMyHandle ( )
pure virtual

Returns a plugin's handle.

Returns
Plugin's handle.
virtual IPhraseCollection* SourceMod::IPlugin::GetPhrases ( )
pure virtual

Returns the plugin's phrase collection.

Returns
Plugin's phrase collection.
virtual void* SourceMod::IPlugin::GetPluginStructure ( )
pure virtual

Deprecated, returns NULL.

Returns
NULL.
virtual bool SourceMod::IPlugin::GetProperty ( const char *  prop,
void **  ptr,
bool  remove = false 
)
pure virtual

Gets a property from a plugin.

Parameters
propString containing the property's name.
ptrOptional pointer to the generic pointer.
removeOptional boolean value; if true, property is removed (so it can be set again).
Returns
True if the property existed, false otherwise.
virtual const sm_plugininfo_t* SourceMod::IPlugin::GetPublicInfo ( )
pure virtual

Returns information about the plugin by reference.

Returns
Pointer to a sm_plugininfo_t object, NULL if plugin is not loaded.
virtual SourcePawn::IPluginRuntime* SourceMod::IPlugin::GetRuntime ( )
pure virtual

Returns the runtime representing this plugin.

Returns
IPluginRuntime pointer, or NULL if not loaded.
virtual bool SourceMod::IPlugin::SetPauseState ( bool  paused)
pure virtual

Sets whether the plugin is paused or not.

Returns
True on successful state change, false otherwise.
virtual bool SourceMod::IPlugin::SetProperty ( const char *  prop,
void *  ptr 
)
pure virtual

Sets a property on this plugin. This is used for per-plugin data from extensions or other parts of core. The property's value must be manually destructed when the plugin is destroyed.

Parameters
propString containing name of the property.
ptrGeneric pointer to set.
Returns
True on success, false if the property is already set.

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