initial import of sharesystem (unfinished)

final revision of handle system (I hope!)
initial import of plugin handles

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40234
This commit is contained in:
David Anderson
2006-12-29 23:18:13 +00:00
parent 5b331ca858
commit f068587ecc
11 changed files with 644 additions and 102 deletions
+13 -1
View File
@@ -93,7 +93,7 @@ public:
virtual const sp_plugin_t *GetPluginStructure() const;
virtual IPluginFunction *GetFunctionByName(const char *public_name);
virtual IPluginFunction *GetFunctionById(funcid_t func_id);
virtual IdentityToken_t GetIdentity();
virtual IdentityToken_t *GetIdentity();
public:
/**
* Creates a plugin object with default values.
@@ -114,11 +114,17 @@ public:
*/
bool FinishMyCompile(char *error, size_t maxlength);
void CancelMyCompile();
/**
* Sets an error state on the plugin
*/
void SetErrorState(PluginStatus status, const char *error_fmt, ...);
/**
* Initializes the plugin's identity information
*/
void InitIdentity();
/**
* Calls the OnPluginLoad function, and sets any failed states if necessary.
* NOTE: Valid pre-states are: Plugin_Created
@@ -151,6 +157,7 @@ private:
CFunction **m_pub_funcs;
char m_errormsg[256];
time_t m_LastAccess;
IdentityToken_t *m_ident;
Handle_t m_handle;
};
@@ -262,6 +269,10 @@ protected:
void ReleaseIterator(CPluginIterator *iter);
CFunction *GetFunctionFromPool(funcid_t f, CPlugin *plugin);
void ReleaseFunctionToPool(CFunction *func);
inline IdentityToken_t *GetIdentity()
{
return m_MyIdent;
}
private:
List<IPluginsListener *> m_listeners;
List<CPlugin *> m_plugins;
@@ -271,6 +282,7 @@ private:
CPluginInfoDatabase m_PluginInfo;
Trie *m_LoadLookup;
bool m_AllPluginsLoaded;
IdentityToken_t *m_MyIdent;
};
extern CPluginManager g_PluginSys;