Fledge
An open source edge computing platform for industrial users
NorthPlugin Class Reference

Class that represents a north plugin. More...

#include <north_plugin.h>

Inheritance diagram for NorthPlugin:
Collaboration diagram for NorthPlugin:

Public Member Functions

 NorthPlugin (PLUGIN_HANDLE handle, const ConfigCategory &category)
 Constructor for the class that wraps the north plugin. More...
 
uint32_t send (const std::vector< Reading *> &readings)
 Call the send method in the plugin.
 
void reconfigure (const std::string &)
 Call the reconfigure method in the plugin.
 
void shutdown ()
 Call the shutdown method in the plugin.
 
bool persistData ()
 
void start ()
 Call the start method in the plugin with no persisted data.
 
void startData (const std::string &pluginData)
 
std::string shutdownSaveData ()
 Call the shutdown method in the plugin and return plugin data to parsist as JSON string.
 
bool hasControl ()
 
void pluginRegister (bool(*write)(char *name, char *value, ControlDestination destination,...), int(*operation)(char *operation, int paramCount, char *names[], char *parameters[], ControlDestination destination,...))
 Call the plugin_register entry point of the plugin if one has been defined.
 
 NorthPlugin (const PLUGIN_HANDLE handle)
 Constructor for the class that wraps the OMF north plugin. More...
 
void shutdown ()
 
std::string shutdownSaveData ()
 
uint32_t send (const std::vector< Reading * > &readings) const
 Send vector (by reference) of readings pointer to historian server. More...
 
PLUGIN_HANDLE init (const ConfigCategory &config)
 Initialise the plugin with configuration data. More...
 
bool persistData ()
 
void start ()
 
void startData (const std::string &pluginData)
 
- Public Member Functions inherited from Plugin
 Plugin (PLUGIN_HANDLE handle)
 
const PLUGIN_INFORMATIONgetInfo ()
 
PLUGIN_HANDLE getHandle ()
 

Public Attributes

PluginDatam_plugin_data
 

Additional Inherited Members

- Protected Attributes inherited from Plugin
PLUGIN_HANDLE handle
 
PluginManagermanager
 
PLUGIN_INFORMATIONinfo
 

Detailed Description

Class that represents a north 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 north 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.

Constructor & Destructor Documentation

◆ NorthPlugin() [1/2]

NorthPlugin::NorthPlugin ( PLUGIN_HANDLE  handle,
const ConfigCategory category 
)

Constructor for the class that wraps the north plugin.

Create a set of function points that resolve to the loaded plugin and enclose in the class.

◆ NorthPlugin() [2/2]

NorthPlugin::NorthPlugin ( const PLUGIN_HANDLE  handle)

Constructor for the class that wraps the OMF north plugin.

Create a set of function pointers.

Parameters
handleThe loaded plugin handle

Member Function Documentation

◆ init()

PLUGIN_HANDLE NorthPlugin::init ( const ConfigCategory config)

Initialise the plugin with configuration data.

Parameters
configThe configuration data
Returns
The plugin handle

◆ send()

uint32_t NorthPlugin::send ( const std::vector< Reading * > &  readings) const

Send vector (by reference) of readings pointer to historian server.

Parameters
readingsThe readings data
Returns
The readings sent or 0 in case of any error

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