OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
IPluginComponentInfo.hpp File Reference

Interface that describes a plugin component — metadata and factory methods. More...

#include <string>
#include <vector>
#include "PluginState.hpp"
Include dependency graph for IPluginComponentInfo.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmm::IPluginComponentInfo
 Describes a plugin component: metadata, capabilities, and factory methods. More...
 

Namespaces

namespace  openswmm
 

Typedefs

using openswmm::PluginInfoFactory = IPluginComponentInfo *(*)()
 Typedef for the C factory function that plugin libraries must export.
 

Detailed Description

Interface that describes a plugin component — metadata and factory methods.

This interface is loosely inspired by the HydroCouple IComponentInfo interface (see https://hydrocouple.org/hydrocouple) but is not a strict implementation. It is designed to be simple enough for any plugin author to implement without depending on HydroCouple.

Each plugin shared library must export a C factory function:

// Exported from the plugin .so/.dylib/.dll:
extern "C" openswmm::IPluginComponentInfo* openswmm_plugin_info(void);
Describes a plugin component: metadata, capabilities, and factory methods.
Definition IPluginComponentInfo.hpp:57
     The PluginFactory calls this function after dlopen() to retrieve the
     component info and then calls create_output_plugin() or
     create_report_plugin() to instantiate plugin instances.