SourceMod SDK  1.7
SourceMod::IShareSys Class Referenceabstract

Tracks dependencies and fires dependency listeners. More...

#include <public/IShareSys.h>

Public Member Functions

virtual bool AddInterface (IExtension *myself, SMInterface *iface)=0
 Adds an interface to the global interface system. More...
 
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. More...
 
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. More...
 
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! More...
 
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. More...
 
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. More...
 
virtual void DestroyIdentType (IdentityType_t type)=0
 Destroys an identity type. Note that this will delete any identities that are under this type. More...
 
virtual void DestroyIdentity (IdentityToken_t *identity)=0
 Destroys an identity token. Any handles being owned by this token, or any handles being. More...
 
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. More...
 
virtual void RegisterLibrary (IExtension *myself, const char *name)=0
 Registers a library name to an extension. More...
 
virtual void OverrideNatives (IExtension *myself, const sp_nativeinfo_t *natives)=0
 Deprecated. Does nothing. More...
 
virtual void AddCapabilityProvider (IExtension *myself, IFeatureProvider *provider, const char *name)=0
 Adds a capability provider. Feature providers are used by plugins to determine if a feature exists at runtime. This is distinctly different from checking for a native, because natives may be backed by underlying functionality which is not available. More...
 
virtual void DropCapabilityProvider (IExtension *myself, IFeatureProvider *provider, const char *name)=0
 Drops a previously added cap provider. More...
 
virtual FeatureStatus TestFeature (SourcePawn::IPluginRuntime *rt, FeatureType type, const char *name)=0
 

Detailed Description

Tracks dependencies and fires dependency listeners.

Member Function Documentation

virtual void SourceMod::IShareSys::AddCapabilityProvider ( IExtension myself,
IFeatureProvider provider,
const char *  name 
)
pure virtual

Adds a capability provider. Feature providers are used by plugins to determine if a feature exists at runtime. This is distinctly different from checking for a native, because natives may be backed by underlying functionality which is not available.

Parameters
myselfExtension.
providerFeature provider implementation.
nameCapibility name.
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
myselfIExtension pointer to yourself.
filenameFile of extension to require.
requireWhether or not this extension is a required dependency.
autoloadWhether or not to autoload this extension.
virtual bool SourceMod::IShareSys::AddInterface ( IExtension myself,
SMInterface iface 
)
pure virtual

Adds an interface to the global interface system.

Parameters
myselfObject adding this interface, in order to track dependencies.
ifaceInterface pointer (must be unique).
Returns
True on success, false otherwise.
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
myselfIdentity token of parent object.
nativesArray 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 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
typeIdentity type.
ptrPrivate data pointer (cannot be NULL).
Returns
A new IdentityToken_t pointer, or NULL on failure.
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
nameString containing type name. Must not be empty or NULL.
Returns
A new HandleType_t identifier, or 0 on failure.
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
identityIdentity to remove.
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
typeIdentity type.
virtual void SourceMod::IShareSys::DropCapabilityProvider ( IExtension myself,
IFeatureProvider provider,
const char *  name 
)
pure virtual

Drops a previously added cap provider.

Parameters
myselfExtension.
providerFeature provider implementation.
nameCapibility name.
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
nameString containing type name to search for.
Returns
A HandleType_t identifier if found, 0 otherwise.
virtual void SourceMod::IShareSys::OverrideNatives ( IExtension myself,
const sp_nativeinfo_t *  natives 
)
pure virtual

Deprecated. Does nothing.

Parameters
myselfIgnored.
nativesIgnored.
virtual void SourceMod::IShareSys::RegisterLibrary ( IExtension myself,
const char *  name 
)
pure virtual

Registers a library name to an extension.

Parameters
myselfExtension to register library to.
nameLibrary name.
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_nameInterface name.
iface_versInterface version to attempt to match.
myselfObject requesting this interface, in order to track dependencies.
pIfacePointer to store the return value in.
virtual FeatureStatus SourceMod::IShareSys::TestFeature ( SourcePawn::IPluginRuntime *  rt,
FeatureType  type,
const char *  name 
)
pure virtual

Tests for a feature.

Parameters
rtPlugin to test.
typeFeature type.
nameFeature name.
Returns
Feature status.

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