![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Default input plugin that reads/writes SWMM .inp files. More...
#include <DefaultInputPlugin.hpp>
Public Member Functions | |
| DefaultInputPlugin () | |
| Construct and register all built-in section handlers. | |
| PluginState | state () const noexcept override |
| Query the current plugin state. | |
| int | initialize (const std::vector< std::string > &init_args, const IPluginComponentInfo *info) override |
| Initialize from [PLUGINS] arguments. | |
| int | validate (const SimulationContext &ctx) override |
| Validate configuration against the loaded model. | |
| int | read (const std::string &path, SimulationContext &ctx) override |
| Read model data from a file into the simulation context. | |
| int | write (const std::string &path, const SimulationContext &ctx) override |
| Write model data from the simulation context to a file. | |
| int | finalize (const SimulationContext &ctx) override |
| Finalize and release resources. | |
| const char * | last_error_message () const noexcept override |
| Get the last error message. | |
| std::vector< std::string > | skipped_sections () const override |
| Sections or elements that were skipped during the last read(). | |
| input::SectionRegistry & | registry () noexcept |
| Access the section registry (for custom section registration). | |
Public Member Functions inherited from openswmm::IInputPlugin | |
| virtual | ~IInputPlugin ()=default |
Default input plugin that reads/writes SWMM .inp files.
Owns a SectionRegistry populated with all built-in SWMM section handlers. The registry maps section tags (JUNCTIONS, CONDUITS, etc.) to handler functions that populate the SimulationContext.
| openswmm::DefaultInputPlugin::DefaultInputPlugin | ( | ) |
Construct and register all built-in section handlers.
|
overridevirtual |
Finalize and release resources.
| ctx | Simulation context. |
Implements openswmm::IInputPlugin.
|
overridevirtual |
Initialize from [PLUGINS] arguments.
| init_args | Tokenized arguments from the [PLUGINS] line. |
| info | Back-pointer to IPluginComponentInfo. |
Implements openswmm::IInputPlugin.
|
inlineoverridevirtualnoexcept |
Get the last error message.
Reimplemented from openswmm::IInputPlugin.
|
overridevirtual |
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. |
Implements openswmm::IInputPlugin.
|
inlinenoexcept |
Access the section registry (for custom section registration).
|
inlineoverridevirtual |
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 from openswmm::IInputPlugin.
|
inlineoverridevirtualnoexcept |
Query the current plugin state.
Implements openswmm::IInputPlugin.
|
overridevirtual |
Validate configuration against the loaded model.
| ctx | Simulation context (after input parsing). |
Implements openswmm::IInputPlugin.
|
overridevirtual |
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. |
Implements openswmm::IInputPlugin.