|
Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
A Plugin is a dynamically-loaded component to provide a piece of functionality. More...
#include <plugin.h>
Public Member Functions | |
| const GRASSROOTS_PLUGIN_API char * | GetPluginConfigName (const Plugin *const plugin_p) |
| Get the string with the platform-specific plugin parts e.g. More... | |
| GRASSROOTS_PLUGIN_API Plugin * | AllocatePlugin (const char *const path_s, struct GrassrootsServer *server_p) |
| The following functions are platform-specific. More... | |
| GRASSROOTS_PLUGIN_API void | FreePlugin (Plugin *const plugin_p) |
| Free a Plugin. More... | |
| GRASSROOTS_PLUGIN_API bool | OpenPlugin (Plugin *const plugin_p) |
| Open a Plugin in preparation for getting the actual component. More... | |
| GRASSROOTS_PLUGIN_API void | ClosePlugin (Plugin *const plugin_p) |
| Close a Plugin. More... | |
| GRASSROOTS_PLUGIN_API void * | GetSymbolFromPlugin (Plugin *plugin_p, const char *const symbol_s) |
| Get a symbol from a Plugin. More... | |
| GRASSROOTS_PLUGIN_API char * | DeterminePluginName (const char *const full_plugin_path_s) |
| Get the platform-independent Plugin name from a platform-specific filename possibly spanning multiple directories. More... | |
| GRASSROOTS_PLUGIN_API char * | MakePluginName (const char *const name_s) |
| Make the platform-specific filename for a given Plugin name. More... | |
| GRASSROOTS_PLUGIN_API void | IncrementPluginOpenCount (Plugin *plugin_p) |
| Increment the number of objects that this Plugin has open. More... | |
| GRASSROOTS_PLUGIN_API void | DecrementPluginOpenCount (Plugin *plugin_p) |
| Decrement the number of objects that this Plugin has open. More... | |
| GRASSROOTS_PLUGIN_API void | ClearPluginValue (Plugin *const plugin_p) |
| Clear all values in a given Plugin ready for it to be reused. More... | |
Data Fields | |
| char * | pl_path_s |
| The path of the plugin. More... | |
| MEM_FLAG | pl_path_mem |
| Memory ownership of the path variable. More... | |
| char * | pl_name_s |
| A multi-platform name for the Plugin. More... | |
| PluginStatus | pl_status |
| The current status of the Plugin. More... | |
| PluginNature | pl_type |
| The type of this Plugin e.g. More... | |
| PluginValue | pl_value |
| The data specific for the PluginNature of this Plugin. More... | |
| int32 | pl_open_count |
| The count of how many current tasks have this Plugin open. More... | |
| struct GrassrootsServer * | pl_server_p |
A Plugin is a dynamically-loaded component to provide a piece of functionality.
The plugin is stored in a platform-specific container e.g. a .dll on Windows, a .so on Unix, etc.
| const GRASSROOTS_PLUGIN_API char * GetPluginConfigName | ( | const Plugin *const | plugin_p | ) |
Get the string with the platform-specific plugin parts e.g.
*.dll for windows, lib*.so for unix. for use in the configuration hash table.
| plugin_p | The Plugin to get the config string for. |
| GRASSROOTS_PLUGIN_API Plugin * AllocatePlugin | ( | const char *const | path_s, |
| struct GrassrootsServer * | server_p | ||
| ) |
The following functions are platform-specific.
Allocate a new Plugin.
| path_s | The path to the file where the Plugin will be loaded from. |
NULL upon error.| GRASSROOTS_PLUGIN_API void FreePlugin | ( | Plugin *const | plugin_p | ) |
| GRASSROOTS_PLUGIN_API bool OpenPlugin | ( | Plugin *const | plugin_p | ) |
Open a Plugin in preparation for getting the actual component.
This checks that the Plugin is a valid platfrom-specific module.
| plugin_p | The Plugin to open. |
true if the Plugin was opened succesfully, false otherwise.| GRASSROOTS_PLUGIN_API void ClosePlugin | ( | Plugin *const | plugin_p | ) |
Close a Plugin.
| plugin_p | The Plugin to close. |
true if the Plugin was closed succesfully, false otherwise.| GRASSROOTS_PLUGIN_API void * GetSymbolFromPlugin | ( | Plugin * | plugin_p, |
| const char *const | symbol_s | ||
| ) |
| GRASSROOTS_PLUGIN_API char * DeterminePluginName | ( | const char *const | full_plugin_path_s | ) |
Get the platform-independent Plugin name from a platform-specific filename possibly spanning multiple directories.
For example, on Unix foo/bar/libmy_module.xso would return my_module
| full_plugin_path_s | The name to use to get the platform-specific plugin name. |
FreeCopiedString when finished with to avoid a memory leak. Upon error, this will return NULL| GRASSROOTS_PLUGIN_API char * MakePluginName | ( | const char *const | name_s | ) |
Make the platform-specific filename for a given Plugin name.
| name_s | The name to use to get the platform-specific plugin name. |
FreeCopiedString when finished with to avoid a memory leak. Upon error, this will return NULL| GRASSROOTS_PLUGIN_API void IncrementPluginOpenCount | ( | Plugin * | plugin_p | ) |
| GRASSROOTS_PLUGIN_API void DecrementPluginOpenCount | ( | Plugin * | plugin_p | ) |
| GRASSROOTS_PLUGIN_API void ClearPluginValue | ( | Plugin *const | plugin_p | ) |
| char* pl_path_s |
The path of the plugin.
| char* pl_name_s |
A multi-platform name for the Plugin.
| PluginStatus pl_status |
The current status of the Plugin.
| PluginNature pl_type |
| PluginValue pl_value |
The data specific for the PluginNature of this Plugin.
| int32 pl_open_count |
The count of how many current tasks have this Plugin open.
| struct GrassrootsServer* pl_server_p |