Default input plugin that reads/writes SWMM .inp files.
More...
#include <DefaultInputPlugin.hpp>
|
| | DefaultInputPlugin () |
| | Construct an UNLOADED plugin and register builtin input/annotation handlers. No file is read; allocation/registration exceptions propagate.
|
| |
| PluginState | state () const noexcept override |
| | Read the last assigned lifecycle marker without synchronization.
|
| |
| int | initialize (const std::vector< std::string > &init_args, const IPluginComponentInfo *info) override |
| | Mark this plugin INITIALIZED without interpreting arguments.
|
| |
| int | validate (const SimulationContext &ctx) override |
| | Mark this plugin VALIDATED without validating a model.
|
| |
| int | read (const std::string &path, SimulationContext &ctx) override |
| | Read an input file through the owned section registry.
|
| |
| int | readText (const std::string &text, SimulationContext &ctx) |
| |
| void | registerContextSections (SimulationContext &ctx) |
| |
| int | write (const std::string &path, const SimulationContext &ctx) override |
| | Serialize current engine state through InpWriter and its sidecar rules.
|
| |
| int | finalize (const SimulationContext &ctx) override |
| | Mark the plugin FINALIZED without IO or validation.
|
| |
| const char * | last_error_message () const noexcept override |
| | Borrow the stored diagnostic text without clearing it.
|
| |
| std::vector< std::string > | skipped_sections () const override |
| | Copy the last completed InputReader skipped-section list.
|
| |
| input::SectionRegistry & | registry () noexcept |
| | Borrow the owned mutable handler registry for caller-managed extensions.
|
| |
| virtual | ~IInputPlugin ()=default |
| | Destroy this polymorphic instance after its callbacks and resource lifecycle finish. Default base destructor performs no finalize, file flush, I/O-thread join or model cleanup. Host deletes instances while their library remains loaded; implementations release owned resources safely. Never delete shared component metadata here.
|
| |
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.
◆ DefaultInputPlugin()
| openswmm::DefaultInputPlugin::DefaultInputPlugin |
( |
| ) |
|
Construct an UNLOADED plugin and register builtin input/annotation handlers. No file is read; allocation/registration exceptions propagate.
◆ finalize()
Mark the plugin FINALIZED without IO or validation.
- Parameters
-
- Returns
- Zero; retains registry, diagnostics and skipped sections.
Implements openswmm::IInputPlugin.
◆ initialize()
| int openswmm::DefaultInputPlugin::initialize |
( |
const std::vector< std::string > & | init_args, |
|
|
const IPluginComponentInfo * | info ) |
|
overridevirtual |
Mark this plugin INITIALIZED without interpreting arguments.
- Parameters
-
| init_args | Ignored initialization strings; not retained. |
| info | Ignored metadata pointer; may be null. |
- Returns
- Zero, without clearing an earlier diagnostic or skipped-section list.
Implements openswmm::IInputPlugin.
◆ last_error_message()
| const char * openswmm::DefaultInputPlugin::last_error_message |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
Borrow the stored diagnostic text without clearing it.
- Returns
- NUL-terminated member bytes, possibly empty/stale; valid until the next error mutation or destruction. Never free; use the method return code for success.
Reimplemented from openswmm::IInputPlugin.
◆ read()
| int openswmm::DefaultInputPlugin::read |
( |
const std::string & | path, |
|
|
SimulationContext & | ctx ) |
|
overridevirtual |
Read an input file through the owned section registry.
- Parameters
-
| path | UTF-8 input filename interpreted by InputReader. |
| [in,out] | ctx | Engine state populated by registered handlers; follows InputReader's initialization/error and partial-mutation contract. |
- Returns
- Zero on accepted read, otherwise context error_code or -1 when it is zero. Always copies the reader's skipped-section list; on failure copies error_message to last_error. Success does not clear older last_error or change lifecycle state. Parser/handler/allocation exceptions are not caught by this plugin.
Implements openswmm::IInputPlugin.
◆ readText()
| int openswmm::DefaultInputPlugin::readText |
( |
const std::string & | text, |
|
|
SimulationContext & | ctx ) |
◆ registerContextSections()
| void openswmm::DefaultInputPlugin::registerContextSections |
( |
SimulationContext & | ctx | ) |
|
◆ registry()
Borrow the owned mutable handler registry for caller-managed extensions.
- Returns
- Registry valid until plugin destruction; do not mutate it during a read or concurrently with registration/dispatch. Changes affect later input parsing.
◆ skipped_sections()
| std::vector< std::string > openswmm::DefaultInputPlugin::skipped_sections |
( |
| ) |
const |
|
inlineoverridevirtual |
Copy the last completed InputReader skipped-section list.
- Returns
- Independent names, replaced after read() returns; no new file scan occurs.
Reimplemented from openswmm::IInputPlugin.
◆ state()
| PluginState openswmm::DefaultInputPlugin::state |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
Read the last assigned lifecycle marker without synchronization.
- Returns
- Stored state; methods do not generally enforce an incoming-state transition. Serialize plugin lifecycle/IO with active worker calls.
Implements openswmm::IInputPlugin.
◆ validate()
Mark this plugin VALIDATED without validating a model.
- Parameters
-
- Returns
- Zero unconditionally; actual model/input validation is performed elsewhere.
Implements openswmm::IInputPlugin.
◆ write()
| int openswmm::DefaultInputPlugin::write |
( |
const std::string & | path, |
|
|
const SimulationContext & | ctx ) |
|
overridevirtual |
Serialize current engine state through InpWriter and its sidecar rules.
- Parameters
-
| path | UTF-8 destination filename; writing can create/replace the input and component/mesh companions according to InpWriter's staged persistence contract. |
| ctx | Borrowed model; const interface does not permit appending ctx.warnings. |
- Returns
- Exact writeInpFile status. Nonzero stores a path failure plus collected writer warnings in last_error. On zero, warnings are discarded and an old error can remain stored; success does not update lifecycle state. Exceptions propagate.
Implements openswmm::IInputPlugin.
The documentation for this class was generated from the following files: