![]() |
Fledge
An open source edge computing platform for industrial users
|
Class that represents a storage plugin. More...
#include <storage_plugin.h>
Public Member Functions | |
StoragePlugin (const std::string &name, PLUGIN_HANDLE handle) | |
Constructor for the class that wraps the storage plugin. More... | |
int | commonInsert (const std::string &table, const std::string &payload, const char *schema=nullptr) |
Call the insert method in the plugin. | |
char * | commonRetrieve (const std::string &table, const std::string &payload, const char *schema=nullptr) |
Call the retrieve method in the plugin. | |
int | commonUpdate (const std::string &table, const std::string &payload, const char *schema=nullptr) |
Call the update method in the plugin. | |
int | commonDelete (const std::string &table, const std::string &payload, const char *schema=nullptr) |
Call the delete method in the plugin. | |
int | readingsAppend (const std::string &payload) |
Call the readings append method in the plugin. | |
char * | readingsFetch (unsigned long id, unsigned int blksize) |
Call the readings fetch method in the plugin. | |
char * | readingsRetrieve (const std::string &payload) |
Call the readings retrieve method in the plugin. | |
char * | readingsPurge (unsigned long age, unsigned int flags, unsigned long sent) |
Call the readings purge method in the plugin. | |
long * | readingsPurge () |
char * | readingsPurgeAsset (const std::string &asset) |
Call the readings purge asset method in the plugin. | |
void | release (const char *response) |
Release a result from a retrieve. | |
int | createTableSnapshot (const std::string &table, const std::string &id) |
Call the create table snaphot method in the plugin. | |
int | loadTableSnapshot (const std::string &table, const std::string &id) |
Call the load table snaphot method in the plugin. | |
int | deleteTableSnapshot (const std::string &table, const std::string &id) |
Call the delete table snaphot method in the plugin. | |
char * | getTableSnapshots (const std::string &table) |
Call the get table snaphot method in the plugin. | |
PLUGIN_ERROR * | lastError () |
Get the last error from the plugin. | |
bool | hasStreamSupport () |
int | readingStream (ReadingStream **stream, bool commit) |
Call the reading stream method in the plugin. | |
bool | pluginShutdown () |
Call the shutdown entry point of the plugin. | |
int | createSchema (const std::string &payload) |
Call the schema create method in the plugin. | |
StoragePluginConfiguration * | getConfig () |
const std::string & | getName () |
![]() | |
Plugin (PLUGIN_HANDLE handle) | |
const PLUGIN_INFORMATION * | getInfo () |
PLUGIN_HANDLE | getHandle () |
Additional Inherited Members | |
![]() | |
PLUGIN_HANDLE | handle |
PluginManager * | manager |
PLUGIN_INFORMATION * | info |
Class that represents a storage plugin.
The purpose of this class is to hide the use of the pointers into the dynamically loaded plugin and wrap the interface into a class that can be used directly in the storage subsystem.
This is achieved by having a set of private member variables which are the pointers to the functions in the plugin, and a set of public methods that will call these functions via the function pointers.
StoragePlugin::StoragePlugin | ( | const std::string & | name, |
PLUGIN_HANDLE | handle | ||
) |
Constructor for the class that wraps the storage plugin.
Create a set of function points that resolve to the loaded plugin and enclose in the class.