![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Interface for input file reader/writer plugins. More...
#include <IInputPlugin.hpp>
Public Member Functions | |
| virtual | ~IInputPlugin ()=default |
| virtual PluginState | state () const noexcept=0 |
| Query the current plugin state. | |
| virtual int | initialize (const std::vector< std::string > &init_args, const IPluginComponentInfo *info)=0 |
| Initialize from [PLUGINS] arguments. | |
| virtual int | validate (const SimulationContext &ctx)=0 |
| Validate configuration against the loaded model. | |
| virtual int | read (const std::string &path, SimulationContext &ctx)=0 |
| Read model data from a file into the simulation context. | |
| virtual int | write (const std::string &path, const SimulationContext &ctx)=0 |
| Write model data from the simulation context to a file. | |
| virtual std::vector< std::string > | skipped_sections () const |
| Sections or elements that were skipped during the last read(). | |
| virtual int | finalize (const SimulationContext &ctx)=0 |
| Finalize and release resources. | |
| virtual const char * | last_error_message () const noexcept |
| Get the last error message. | |
Interface for input file reader/writer plugins.
|
virtualdefault |
|
pure virtual |
Finalize and release resources.
| ctx | Simulation context. |
Implemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.
|
pure virtual |
Initialize from [PLUGINS] arguments.
| init_args | Tokenized arguments from the [PLUGINS] line. |
| info | Back-pointer to IPluginComponentInfo. |
Implemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.
|
inlinevirtualnoexcept |
Get the last error message.
Reimplemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.
|
pure virtual |
Read model data from a file into the simulation context.
Populates all SoA arrays, name indices, options, and tables in the SimulationContext. The caller (SWMMEngine::open()) is responsible for calling cross-reference resolution after this method returns.
Implementations should also populate ctx.plugin_specs if the input format supports plugin declarations, so the engine can load output/report plugins after reading.
Input plugins are injected into the engine before open() is called — they cannot be discovered via [PLUGINS] because the input file has not been read yet at that point.
| path | Path to the input file. |
| ctx | Simulation context to populate. |
Implemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.
|
inlinevirtual |
Sections or elements that were skipped during the last read().
Returns identifiers for any input sections or elements that had no handler and were ignored. For .inp files these are section tags like "MY_UNKNOWN_SECTION". Other formats may return their own identifiers (e.g., JSON keys).
Reimplemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.
|
pure virtualnoexcept |
Query the current plugin state.
Implemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.
|
pure virtual |
Validate configuration against the loaded model.
| ctx | Simulation context (after input parsing). |
Implemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.
|
pure virtual |
Write model data from the simulation context to a file.
Serializes the full model state to the specified file path in the format supported by this plugin.
| path | Path to the output file. |
| ctx | Simulation context to serialize. |
Implemented in openswmm::gpkg::GeoPackageInputPlugin, and openswmm::DefaultInputPlugin.