OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
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
 Destroy component metadata only through its owning library/host lifetime. PluginFactory borrows singleton metadata and does not delete it as an instance. Keep library loaded until all created plugin instances/callbacks are destroyed; base destructor performs no instance cleanup, registration or library unloading.
 
virtual std::string id () const =0
 Copy the stable discovery identifier for this component.
 
virtual std::string caption () const =0
 Copy the component display name.
 
virtual std::string description () const =0
 Copy the component's descriptive metadata.
 
virtual std::string version () const =0
 Copy the component's declared version.
 
virtual std::string vendor () const =0
 Copy declared vendor/author metadata.
 
virtual std::string url () const =0
 Copy the declared home/documentation URL.
 
virtual std::vector< std::string > tags () const
 Copy optional discovery keywords.
 
virtual std::string license_type () const =0
 Copy the component's declared license identifier.
 
virtual std::string license_text () const =0
 Copy declared license text or a reference URL.
 
virtual bool has_input () const noexcept
 Query whether this component advertises the input capability.
 
virtual bool has_output () const noexcept
 Query whether this component advertises the output capability.
 
virtual bool has_report () const noexcept
 Query whether this component advertises the report capability.
 
virtual bool has_state_io () const noexcept
 Query whether this component advertises the state_io capability.
 
virtual std::vector< FileFilter > file_filters () const
 Copy supported format/role filters for host discovery and file dialogs.
 
virtual bool register_plugin (const RegistrationInfo &info)
 Apply implementation-defined registration data before protected factories.
 
virtual bool registered () const noexcept
 Query implementation-defined registration readiness.
 
virtual RegistrationInfo registration_info () const
 Copy implementation-reported current registration metadata.
 
virtual IInputPlugin * create_input_plugin () const
 Allocate a distinct input plugin instance when supported and permitted.
 
virtual IOutputPlugin * create_output_plugin () const
 Allocate a distinct output plugin instance when supported and permitted.
 
virtual IReportPlugin * create_report_plugin () const
 Allocate a distinct report plugin instance when supported and permitted.
 
virtual IStateIOPlugin * create_state_io_plugin () const
 Allocate a distinct state_io plugin instance when supported and permitted.
 

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

Destroy component metadata only through its owning library/host lifetime. PluginFactory borrows singleton metadata and does not delete it as an instance. Keep library loaded until all created plugin instances/callbacks are destroyed; base destructor performs no instance cleanup, registration or library unloading.

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

Allocate a distinct input plugin instance when supported and permitted.

Returns
New polymorphic instance owned by caller, or nullptr (base/unsupported/ registration refusal). Caller deletes it before unloading this metadata's library; never return the shared metadata singleton as an instance. Multiple calls may create independent engines' instances. Returned instance still needs lifecycle initialization; allocation/implementation exceptions can propagate. Serialize with registration changes and honor implementation-specific factory thread safety.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo, and openswmm::h5io::Hdf5PluginInfo.

Here is the caller graph for this function:

◆ create_output_plugin()

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

Allocate a distinct output plugin instance when supported and permitted.

Returns
New polymorphic instance owned by caller, or nullptr (base/unsupported/ registration refusal). Caller deletes it before unloading this metadata's library; never return the shared metadata singleton as an instance. Multiple calls may create independent engines' instances. Returned instance still needs lifecycle initialization; allocation/implementation exceptions can propagate. Serialize with registration changes and honor implementation-specific factory thread safety.

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

Allocate a distinct report plugin instance when supported and permitted.

Returns
New polymorphic instance owned by caller, or nullptr (base/unsupported/ registration refusal). Caller deletes it before unloading this metadata's library; never return the shared metadata singleton as an instance. Multiple calls may create independent engines' instances. Returned instance still needs lifecycle initialization; allocation/implementation exceptions can propagate. Serialize with registration changes and honor implementation-specific factory thread safety.

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

Allocate a distinct state_io plugin instance when supported and permitted.

Returns
New polymorphic instance owned by caller, or nullptr (base/unsupported/ registration refusal). Caller deletes it before unloading this metadata's library; never return the shared metadata singleton as an instance. Multiple calls may create independent engines' instances. Returned instance still needs lifecycle initialization; allocation/implementation exceptions can propagate. Serialize with registration changes and honor implementation-specific factory thread safety.
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

Copy supported format/role filters for host discovery and file dialogs.

Returns
Owned entries with role, description, glob patterns and optional MIME types; base empty. Each supported I/O role should advertise its filters. Host/factory may warn on missing capability roles, but filters do not validate actual file contents, readability or plugin ABI and do not select a single capability to instantiate.

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

◆ has_input()

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

Query whether this component advertises the input capability.

Returns
False by default, true when corresponding create_input_plugin is supported. Multiple capabilities can be true and factory loads all advertised roles; no registration or instance creation occurs here. Must not throw.

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

Here is the caller graph for this function:

◆ has_output()

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

Query whether this component advertises the output capability.

Returns
False by default, true when corresponding create_output_plugin is supported. Multiple capabilities can be true and factory loads all advertised roles; no registration or instance creation occurs here. Must not throw.

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

Here is the caller graph for this function:

◆ has_report()

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

Query whether this component advertises the report capability.

Returns
False by default, true when corresponding create_report_plugin is supported. Multiple capabilities can be true and factory loads all advertised roles; no registration or instance creation occurs here. Must not throw.

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

Here is the caller graph for this function:

◆ has_state_io()

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

Query whether this component advertises the state_io capability.

Returns
False by default, true when corresponding create_state_io_plugin is supported. Multiple capabilities can be true and factory loads all advertised roles; no registration or instance creation occurs here. Must not throw.

Reimplemented in openswmm::BuiltinDefaultStateIOPluginInfo.

Here is the caller graph for this function:

◆ id()

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

Copy the stable discovery identifier for this component.

Returns
Owned reverse-DNS-style ID, consistent across discovery/factory use; host must not infer a unique supported capability from it. No automatic validation.

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

Here is the caller graph for this function:

◆ license_text()

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

Copy declared license text or a reference URL.

Returns
Owned string for host display. No remote fetch, activation or registration is performed by this query.

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

◆ license_type()

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

Copy the component's declared license identifier.

Returns
Owned SPDX-style or LicenseRef text; base interface does not validate it or grant rights independently of the component's license terms.

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

◆ register_plugin()

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

Apply implementation-defined registration data before protected factories.

Parameters
infoBorrowed registration fields for this call; copy retained data. Base ignores all fields and returns true without storing them or doing network I/O.
Returns
True when implementation accepts, false otherwise. Implementations own validation, side effects, repeat-call policy and factory gating; base supplies no activation service or rollback. Serialize with factories/registration queries.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

◆ registered()

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

Query implementation-defined registration readiness.

Returns
Base true; overrides report their current activation status. No registration side effect or synchronization is provided; must not throw. Serialize against changes.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

◆ registration_info()

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

Copy implementation-reported current registration metadata.

Returns
Independent fields, base empty even after base register_plugin succeeded. Overrides may report last successful registration when registered()==true. Serialize with registration changes; returned copy has no lifetime tie to the component.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo.

◆ tags()

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

Copy optional discovery keywords.

Returns
Owned strings; base empty. No capability inference, normalization or registration gating is implied by tags.

Reimplemented in openswmm::gpkg::GeoPackagePluginInfo, and openswmm::h5io::Hdf5PluginInfo.

◆ 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

Copy the component's declared version.

Returns
Owned version text; semantic versioning is recommended, not enforced by this base. Does not independently prove binary ABI/schema compatibility.

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

Here is the caller graph for this function:

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