Skip to content

Commit

Permalink
Moving all core plugins to use new plugin base
Browse files Browse the repository at this point in the history
  • Loading branch information
jholloc committed Dec 6, 2023
1 parent b8a12a1 commit 4346b6a
Show file tree
Hide file tree
Showing 16 changed files with 945 additions and 1,771 deletions.
4 changes: 2 additions & 2 deletions source/plugins/bytes/bytesPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class BytesPlugin : public UDAPluginBase {
public:
BytesPlugin();
int read(IDAM_PLUGIN_INTERFACE* plugin_interface);
int init(IDAM_PLUGIN_INTERFACE* plugin_interface) override { return 0; }
int reset() override { return 0; }
void init(IDAM_PLUGIN_INTERFACE* plugin_interface) override {}
void reset() override {}
};

BytesPlugin::BytesPlugin()
Expand Down
4 changes: 2 additions & 2 deletions source/plugins/hdf5/hdf5plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class HDF5Plugin : public UDAPluginBase {
{
return setReturnDataString(plugin_interface->data_block, "foo!", nullptr);
}
int init(IDAM_PLUGIN_INTERFACE* plugin_interface) override { return 0; }
int reset() override { return 0; }
void init(IDAM_PLUGIN_INTERFACE* plugin_interface) override {}
void reset() override {}
};

HDF5Plugin::HDF5Plugin()
Expand Down
20 changes: 10 additions & 10 deletions source/plugins/help/help_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class HelpPlugin : public UDAPluginBase {
HelpPlugin();
int ping(IDAM_PLUGIN_INTERFACE* plugin_interface);
int services(IDAM_PLUGIN_INTERFACE* plugin_interface);
int init(IDAM_PLUGIN_INTERFACE* plugin_interface) override { return 0; }
int reset() override { return 0; }
void init(IDAM_PLUGIN_INTERFACE* plugin_interface) override {}
void reset() override {}
};

HelpPlugin::HelpPlugin()
Expand All @@ -35,7 +35,7 @@ int helpPlugin(IDAM_PLUGIN_INTERFACE* plugin_interface)
return plugin.call(plugin_interface);
}

int HelpPlugin::ping(IDAM_PLUGIN_INTERFACE* idam_plugin_interface)
int HelpPlugin::ping(IDAM_PLUGIN_INTERFACE* plugin_interface)
{
//----------------------------------------------------------------------------------------

Expand Down Expand Up @@ -72,20 +72,20 @@ int HelpPlugin::ping(IDAM_PLUGIN_INTERFACE* idam_plugin_interface)
defineField(&field, "microseconds", "Server inter-second time in microseconds", &offset, SCALARUINT);
addCompoundField(&usertype, field);

USERDEFINEDTYPELIST* userdefinedtypelist = idam_plugin_interface->userdefinedtypelist;
USERDEFINEDTYPELIST* userdefinedtypelist = plugin_interface->userdefinedtypelist;
addUserDefinedType(userdefinedtypelist, usertype);

// assign the returned data structure

auto data = (HELP_PING*)malloc(sizeof(HELP_PING));
addMalloc(idam_plugin_interface->logmalloclist, (void*)data, 1, sizeof(HELP_PING), "HELP_PING"); // Register
addMalloc(plugin_interface->logmalloclist, (void*)data, 1, sizeof(HELP_PING), "HELP_PING"); // Register

data->seconds = (unsigned int)serverTime.tv_sec;
data->microseconds = (unsigned int)serverTime.tv_usec;

// return to the client

DATA_BLOCK* data_block = idam_plugin_interface->data_block;
DATA_BLOCK* data_block = plugin_interface->data_block;
initDataBlock(data_block);

data_block->data_type = UDA_TYPE_COMPOUND;
Expand All @@ -104,7 +104,7 @@ int HelpPlugin::ping(IDAM_PLUGIN_INTERFACE* idam_plugin_interface)
return 0;
}

int HelpPlugin::services(IDAM_PLUGIN_INTERFACE* idam_plugin_interface)
int HelpPlugin::services(IDAM_PLUGIN_INTERFACE* plugin_interface)
{
//======================================================================================
// Plugin functionality
Expand All @@ -119,9 +119,9 @@ int HelpPlugin::services(IDAM_PLUGIN_INTERFACE* idam_plugin_interface)

// Total Number of registered plugins available

const ENVIRONMENT* environment = idam_plugin_interface->environment;
const ENVIRONMENT* environment = plugin_interface->environment;

const PLUGINLIST* pluginList = idam_plugin_interface->pluginList;
const PLUGINLIST* pluginList = plugin_interface->pluginList;

count = 0;
for (int i = 0; i < pluginList->count; i++) {
Expand Down Expand Up @@ -264,5 +264,5 @@ int HelpPlugin::services(IDAM_PLUGIN_INTERFACE* idam_plugin_interface)

doc += "\n\n";

return setReturnDataString(idam_plugin_interface->data_block, doc.c_str(), "Description of UDA data access services");
return setReturnDataString(plugin_interface->data_block, doc.c_str(), "Description of UDA data access services");
}
7 changes: 7 additions & 0 deletions source/plugins/keyvalue/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
KEYVALUE: Plugin to allow for reading and writing data to a LevelDB key-value store

Functions:

read(key) Read the data from the store for the given key
write(key, value) Write the given data to the store with the given key
delete(key) Delete the key from the store
Loading

0 comments on commit 4346b6a

Please sign in to comment.