SourceMod::IShareSys Class Reference

Tracks dependencies and fires dependency listeners. More...

#include <public/IShareSys.h>

List of all members.

Public Member Functions

virtual bool AddInterface (IExtension *myself, SMInterface *iface)=0
 Adds an interface to the global interface system.
virtual bool RequestInterface (const char *iface_name, unsigned int iface_vers, IExtension *myself, SMInterface **pIface)=0
 Requests an interface from the global interface system. If found, the interface's internal reference count will be increased.
virtual void AddNatives (IExtension *myself, const sp_nativeinfo_t *natives)=0
 Adds a list of natives to the global native pool, to be bound on plugin load.
virtual IdentityType_t CreateIdentType (const char *name)=0
 Creates a new identity type. NOTE: Module authors should never need to use this. Due to the current implementation, there is a hardcoded limit of 15 types. Core uses up a few, so think carefully!
virtual IdentityType_t FindIdentType (const char *name)=0
 Finds an identity type by name. DEFAULT IDENTITY TYPES: "PLUGIN" - An IPlugin object. "MODULE" - An IModule object. "CORE" - An SMGlobalClass or other singleton.
virtual IdentityToken_t * CreateIdentity (IdentityType_t type, void *ptr)=0
 Creates a new identity token. This token is guaranteed to be unique amongst all other open identities.
virtual void DestroyIdentType (IdentityType_t type)=0
 Destroys an identity type. Note that this will delete any identities that are under this type.
virtual void DestroyIdentity (IdentityToken_t *identity)=0
 Destroys an identity token. Any handles being owned by this token, or any handles being.
virtual void AddDependency (IExtension *myself, const char *filename, bool require, bool autoload)=0
 Requires an extension. This tells SourceMod that without this extension, your extension should not be loaded. The name should not include the ".dll" or the ".so" part of the file name.
virtual void RegisterLibrary (IExtension *myself, const char *name)=0
 Registers a library name to an extension.
virtual void OverrideNatives (IExtension *myself, const sp_nativeinfo_t *natives)=0
 Adds natives that will override Core natives when called.


Detailed Description

Tracks dependencies and fires dependency listeners.

Definition at line 94 of file IShareSys.h.


Member Function Documentation

virtual bool SourceMod::IShareSys::AddInterface ( IExtension myself,
SMInterface iface 
) [pure virtual]

Adds an interface to the global interface system.

Parameters:
myself Object adding this interface, in order to track dependencies.
iface Interface pointer (must be unique).
Returns:
True on success, false otherwise.

virtual bool SourceMod::IShareSys::RequestInterface ( const char *  iface_name,
unsigned int  iface_vers,
IExtension myself,
SMInterface **  pIface 
) [pure virtual]

Requests an interface from the global interface system. If found, the interface's internal reference count will be increased.

Parameters:
iface_name Interface name.
iface_vers Interface version to attempt to match.
myself Object requesting this interface, in order to track dependencies.
pIface Pointer to store the return value in.

virtual void SourceMod::IShareSys::AddNatives ( IExtension myself,
const sp_nativeinfo_t natives 
) [pure virtual]

Adds a list of natives to the global native pool, to be bound on plugin load.

Adding natives does not bind them to any loaded plugins; the plugins must be reloaded for new natives to take effect.

Parameters:
myself Identity token of parent object.
natives Array of natives to add. The last entry in the array must be filled with NULLs to terminate the array. The array must be static as Core will cache the pointer for the lifetime of the extension.

virtual IdentityType_t SourceMod::IShareSys::CreateIdentType ( const char *  name  )  [pure virtual]

Creates a new identity type. NOTE: Module authors should never need to use this. Due to the current implementation, there is a hardcoded limit of 15 types. Core uses up a few, so think carefully!

Parameters:
name String containing type name. Must not be empty or NULL.
Returns:
A new HandleType_t identifier, or 0 on failure.

virtual IdentityType_t SourceMod::IShareSys::FindIdentType ( const char *  name  )  [pure virtual]

Finds an identity type by name. DEFAULT IDENTITY TYPES: "PLUGIN" - An IPlugin object. "MODULE" - An IModule object. "CORE" - An SMGlobalClass or other singleton.

Parameters:
name String containing type name to search for.
Returns:
A HandleType_t identifier if found, 0 otherwise.

virtual IdentityToken_t* SourceMod::IShareSys::CreateIdentity ( IdentityType_t  type,
void *  ptr 
) [pure virtual]

Creates a new identity token. This token is guaranteed to be unique amongst all other open identities.

Parameters:
type Identity type.
ptr Private data pointer (cannot be NULL).
Returns:
A new IdentityToken_t pointer, or NULL on failure.

virtual void SourceMod::IShareSys::DestroyIdentType ( IdentityType_t  type  )  [pure virtual]

Destroys an identity type. Note that this will delete any identities that are under this type.

Parameters:
type Identity type.

virtual void SourceMod::IShareSys::DestroyIdentity ( IdentityToken_t *  identity  )  [pure virtual]

Destroys an identity token. Any handles being owned by this token, or any handles being.

Parameters:
identity Identity to remove.

virtual void SourceMod::IShareSys::AddDependency ( IExtension myself,
const char *  filename,
bool  require,
bool  autoload 
) [pure virtual]

Requires an extension. This tells SourceMod that without this extension, your extension should not be loaded. The name should not include the ".dll" or the ".so" part of the file name.

Parameters:
myself IExtension pointer to yourself.
filename File of extension to require.
require Whether or not this extension is a required dependency.
autoload Whether or not to autoload this extension.

virtual void SourceMod::IShareSys::RegisterLibrary ( IExtension myself,
const char *  name 
) [pure virtual]

Registers a library name to an extension.

Parameters:
myself Extension to register library to.
name Library name.

virtual void SourceMod::IShareSys::OverrideNatives ( IExtension myself,
const sp_nativeinfo_t natives 
) [pure virtual]

Adds natives that will override Core natives when called.

A Core version of each native must exist. If one does not, then Core will simply ignore that entry. No more than one override can exist on a given native.

Override natives represent a weak coupling. If the extension is unloaded, the native will be re-bound to the Core version. If the extension is loaded after plugins are loaded, the override will not take effect until those plugins are reloaded.

Parameters:
myself Identity token of parent object.
natives Array of natives to add. The last entry in the array must be filled with NULLs to terminate the array. The array must be static as Core will cache the pointer for the lifetime of the extension.


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