SourceMod SDK  1.7
SourceMod::IPluginManager Class Referenceabstract

Manages the runtime loading and unloading of plugins. More...

#include <public/IPluginSys.h>

Inheritance diagram for SourceMod::IPluginManager:
SourceMod::SMInterface

Public Member Functions

virtual const char * GetInterfaceName ()
 Must return a string defining the interface's unique name.
 
virtual unsigned int GetInterfaceVersion ()
 Must return an integer defining the interface's version.
 
virtual IPluginLoadPlugin (const char *path, bool debug, PluginType type, char error[], size_t maxlength, bool *wasloaded)=0
 Attempts to load a plugin. More...
 
virtual bool UnloadPlugin (IPlugin *plugin)=0
 Attempts to unload a plugin. More...
 
virtual IPluginFindPluginByContext (const sp_context_t *ctx)=0
 Finds a plugin by its context. Note: This function should be considered O(1). More...
 
virtual unsigned int GetPluginCount ()=0
 Returns the number of plugins (both failed and loaded). More...
 
virtual IPluginIteratorGetPluginIterator ()=0
 Returns a pointer that can be used to iterate through plugins. Note: This pointer must be freed using EITHER delete OR IPluginIterator::Release().
 
virtual void AddPluginsListener (IPluginsListener *listener)=0
 Adds a plugin manager listener. More...
 
virtual void RemovePluginsListener (IPluginsListener *listener)=0
 Removes a plugin listener. More...
 
virtual IPluginPluginFromHandle (Handle_t handle, HandleError *err)=0
 Converts a Handle to an IPlugin if possible. More...
 
- Public Member Functions inherited from SourceMod::SMInterface
virtual bool IsVersionCompatible (unsigned int version)
 Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More...
 

Detailed Description

Manages the runtime loading and unloading of plugins.

Member Function Documentation

virtual void SourceMod::IPluginManager::AddPluginsListener ( IPluginsListener listener)
pure virtual

Adds a plugin manager listener.

Parameters
listenerPointer to a listener.
virtual IPlugin* SourceMod::IPluginManager::FindPluginByContext ( const sp_context_t *  ctx)
pure virtual

Finds a plugin by its context. Note: This function should be considered O(1).

Parameters
ctxPointer to an sp_context_t.
Returns
Pointer to a matching IPlugin, or NULL if none found.
virtual unsigned int SourceMod::IPluginManager::GetPluginCount ( )
pure virtual

Returns the number of plugins (both failed and loaded).

Returns
The number of internally cached plugins.
virtual IPlugin* SourceMod::IPluginManager::LoadPlugin ( const char *  path,
bool  debug,
PluginType  type,
char  error[],
size_t  maxlength,
bool *  wasloaded 
)
pure virtual

Attempts to load a plugin.

Parameters
pathPath and filename of plugin, relative to plugins folder.
debugDeprecated, must be false.
typeLifetime of the plugin.
errorBuffer to hold any error message.
maxlengthMaximum length of error message buffer.
wasloadedStores if the plugin is already loaded.
Returns
A new plugin pointer on success, false otherwise.
virtual IPlugin* SourceMod::IPluginManager::PluginFromHandle ( Handle_t  handle,
HandleError *  err 
)
pure virtual

Converts a Handle to an IPlugin if possible.

Parameters
handleHandle.
errError, set on failure (otherwise undefined).
Returns
IPlugin pointer, or NULL on failure.
virtual void SourceMod::IPluginManager::RemovePluginsListener ( IPluginsListener listener)
pure virtual

Removes a plugin listener.

Parameters
listenerPointer to a listener.
virtual bool SourceMod::IPluginManager::UnloadPlugin ( IPlugin plugin)
pure virtual

Attempts to unload a plugin.

Parameters
pluginPointer to the plugin handle.
Returns
True on success, false otherwise.

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