OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::IPluginComponentInfo Class Referenceabstract

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

#include <IPluginComponentInfo.hpp>

Inheritance diagram for openswmm::IPluginComponentInfo:
Collaboration diagram for openswmm::IPluginComponentInfo:

Public Member Functions

virtual ~IPluginComponentInfo ()=default
 
virtual std::string id () const =0
 Unique plugin identifier in reverse-DNS notation.
 
virtual std::string caption () const =0
 Human-readable display name of the plugin.
 
virtual std::string description () const =0
 Detailed description of what this plugin does.
 
virtual std::string version () const =0
 Plugin version string (Semantic Versioning recommended).
 
virtual std::string vendor () const =0
 Vendor / author name.
 
virtual std::string url () const =0
 URL to the plugin's home page or documentation.
 
virtual std::vector< std::string > tags () const
 Additional tags or keywords for discovery.
 
virtual std::string license_type () const =0
 SPDX license identifier for this plugin.
 
virtual std::string license_text () const =0
 Full license text for this plugin.
 
virtual bool has_input () const noexcept
 True if this plugin can create an IInputPlugin.
 
virtual bool has_output () const noexcept
 True if this plugin can create an IOutputPlugin.
 
virtual bool has_report () const noexcept
 True if this plugin can create an IReportPlugin.
 
virtual bool has_state_io () const noexcept
 True if this plugin can create an IStateIOPlugin.
 
virtual std::vector< FileFilterfile_filters () const
 File-format filters this plugin handles.
 
virtual bool register_plugin (const RegistrationInfo &info)
 Register the plugin with the provided registration information.
 
virtual bool registered () const noexcept
 Check whether the plugin is currently registered.
 
virtual RegistrationInfo registration_info () const
 Get the current registration information.
 
virtual IInputPlugincreate_input_plugin () const
 Create a new IInputPlugin instance.
 
virtual IOutputPlugincreate_output_plugin () const
 Create a new IOutputPlugin instance.
 
virtual IReportPlugincreate_report_plugin () const
 Create a new IReportPlugin instance.
 
virtual IStateIOPlugincreate_state_io_plugin () const
 Create a new IStateIOPlugin instance.
 

Detailed Description

Describes a plugin component: metadata, capabilities, and factory methods.

Plugins implement this class and export it via openswmm_plugin_info(). The PluginFactory uses it to discover capabilities and create instances.

Note
Implement this as a singleton — the PluginFactory holds one pointer to the IPluginComponentInfo and may call create_*_plugin() multiple times.

Constructor & Destructor Documentation

◆ ~IPluginComponentInfo()

virtual openswmm::IPluginComponentInfo::~IPluginComponentInfo ( )
virtualdefault

Member Function Documentation

◆ caption()

virtual std::string openswmm::IPluginComponentInfo::caption ( ) const
pure virtual

◆ create_input_plugin()

virtual IInputPlugin * openswmm::IPluginComponentInfo::create_input_plugin ( ) const
inlinevirtual

Create a new IInputPlugin instance.

The PluginFactory calls this when has_input() returns true. The returned pointer is owned by the caller (PluginFactory). The factory will call delete on it during cleanup.

Returns
New IInputPlugin instance, or nullptr if not supported.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

Here is the caller graph for this function:

◆ create_output_plugin()

virtual IOutputPlugin * openswmm::IPluginComponentInfo::create_output_plugin ( ) const
inlinevirtual

Create a new IOutputPlugin instance.

The PluginFactory calls this when has_output() returns true. The returned pointer is owned by the caller (PluginFactory). The factory will call delete on it during cleanup.

Returns
New IOutputPlugin instance, or nullptr if not supported.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

Here is the caller graph for this function:

◆ create_report_plugin()

virtual IReportPlugin * openswmm::IPluginComponentInfo::create_report_plugin ( ) const
inlinevirtual

Create a new IReportPlugin instance.

The PluginFactory calls this when has_report() returns true.

Returns
New IReportPlugin instance, or nullptr if not supported.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

Here is the caller graph for this function:

◆ create_state_io_plugin()

virtual IStateIOPlugin * openswmm::IPluginComponentInfo::create_state_io_plugin ( ) const
inlinevirtual

Create a new IStateIOPlugin instance.

The PluginFactory calls this when has_state_io() returns true. The returned pointer is owned by the caller (PluginFactory). The factory will call delete on it during cleanup.

Returns
New IStateIOPlugin instance, or nullptr if not supported.
Here is the caller graph for this function:

◆ description()

virtual std::string openswmm::IPluginComponentInfo::description ( ) const
pure virtual

◆ file_filters()

virtual std::vector< FileFilter > openswmm::IPluginComponentInfo::file_filters ( ) const
inlinevirtual

File-format filters this plugin handles.

Every plugin SHOULD override this and return one FileFilter per (role, format) pair it supports. The default empty return preserves binary compatibility for plugins built against older SDK headers, but PluginFactory logs a warning when a plugin advertises a capability (e.g., has_input() == true) yet returns no filter for the matching role.

Hosts (Qt GUIs, CLI, Python bindings) compose user-visible file dialogs from the union of filters across all loaded plugins, grouped by role.

Returns
Vector of filter entries; empty by default.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo, openswmm::BuiltinDefaultInputPluginInfo, openswmm::BuiltinDefaultOutputPluginInfo, openswmm::BuiltinDefaultReportPluginInfo, and openswmm::BuiltinDefaultStateIOPluginInfo.

◆ has_input()

virtual bool openswmm::IPluginComponentInfo::has_input ( ) const
inlinevirtualnoexcept

True if this plugin can create an IInputPlugin.

The PluginFactory checks this before calling create_input_plugin().

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo, and openswmm::BuiltinDefaultInputPluginInfo.

Here is the caller graph for this function:

◆ has_output()

virtual bool openswmm::IPluginComponentInfo::has_output ( ) const
inlinevirtualnoexcept

True if this plugin can create an IOutputPlugin.

The PluginFactory checks this before calling create_output_plugin().

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo, and openswmm::BuiltinDefaultOutputPluginInfo.

Here is the caller graph for this function:

◆ has_report()

virtual bool openswmm::IPluginComponentInfo::has_report ( ) const
inlinevirtualnoexcept

True if this plugin can create an IReportPlugin.

The PluginFactory checks this before calling create_report_plugin().

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo, and openswmm::BuiltinDefaultReportPluginInfo.

Here is the caller graph for this function:

◆ has_state_io()

virtual bool openswmm::IPluginComponentInfo::has_state_io ( ) const
inlinevirtualnoexcept

True if this plugin can create an IStateIOPlugin.

The PluginFactory checks this before calling create_state_io_plugin().

Reimplemented in openswmm::BuiltinDefaultStateIOPluginInfo.

Here is the caller graph for this function:

◆ id()

virtual std::string openswmm::IPluginComponentInfo::id ( ) const
pure virtual

Unique plugin identifier in reverse-DNS notation.

Returns
e.g. "org.hydrocouple.openswmm.plugins.hdf5output"

Implemented in openswmm::gpkg::GeoPackagePluginInfo, openswmm::BuiltinDefaultInputPluginInfo, openswmm::BuiltinDefaultOutputPluginInfo, openswmm::BuiltinDefaultReportPluginInfo, and openswmm::BuiltinDefaultStateIOPluginInfo.

Here is the caller graph for this function:

◆ license_text()

virtual std::string openswmm::IPluginComponentInfo::license_text ( ) const
pure virtual

Full license text for this plugin.

Return the complete license text (or a URL to it).

Returns
License text string.

Implemented in openswmm::gpkg::GeoPackagePluginInfo, openswmm::BuiltinDefaultInputPluginInfo, openswmm::BuiltinDefaultOutputPluginInfo, openswmm::BuiltinDefaultReportPluginInfo, and openswmm::BuiltinDefaultStateIOPluginInfo.

◆ license_type()

virtual std::string openswmm::IPluginComponentInfo::license_type ( ) const
pure virtual

◆ register_plugin()

virtual bool openswmm::IPluginComponentInfo::register_plugin ( const RegistrationInfo info)
inlinevirtual

Register the plugin with the provided registration information.

Override this to implement registration logic (license validation, activation token checks, etc.). The default implementation accepts any registration and returns true.

Parameters
infoRegistration information.
Returns
true if registration succeeded, false otherwise.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

◆ registered()

virtual bool openswmm::IPluginComponentInfo::registered ( ) const
inlinevirtualnoexcept

Check whether the plugin is currently registered.

Override this to report registration status. Plugins that do not require registration should return true (the default).

Returns
true if the plugin is registered and ready to use.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

◆ registration_info()

virtual RegistrationInfo openswmm::IPluginComponentInfo::registration_info ( ) const
inlinevirtual

Get the current registration information.

Returns the info passed to the most recent successful register_plugin() call. The default returns an empty struct.

Returns
Registration information (valid only if registered() is true).

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

◆ tags()

virtual std::vector< std::string > openswmm::IPluginComponentInfo::tags ( ) const
inlinevirtual

Additional tags or keywords for discovery.

Returns
Vector of keyword strings.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

◆ url()

virtual std::string openswmm::IPluginComponentInfo::url ( ) const
pure virtual

◆ vendor()

virtual std::string openswmm::IPluginComponentInfo::vendor ( ) const
pure virtual

◆ version()

virtual std::string openswmm::IPluginComponentInfo::version ( ) const
pure virtual

Plugin version string (Semantic Versioning recommended).

Returns
e.g. "1.0.0"

Implemented in openswmm::gpkg::GeoPackagePluginInfo, openswmm::BuiltinDefaultInputPluginInfo, openswmm::BuiltinDefaultOutputPluginInfo, openswmm::BuiltinDefaultReportPluginInfo, and openswmm::BuiltinDefaultStateIOPluginInfo.

Here is the caller graph for this function:

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