![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Interface for output-writing plugins. More...
#include <IOutputPlugin.hpp>
Public Member Functions | |
| virtual | ~IOutputPlugin ()=default |
| virtual PluginState | state () const noexcept=0 |
| Query the current plugin state. | |
| virtual int | initialize (const std::vector< std::string > &init_args, const class IPluginComponentInfo *info)=0 |
| Initialize the plugin from command-line-style arguments. | |
| virtual int | validate (const SimulationContext &ctx)=0 |
| Validate plugin configuration against the simulation model. | |
| virtual int | prepare (const SimulationContext &ctx)=0 |
| Open output file(s) and write headers. | |
| virtual int | update (const SimulationSnapshot &snapshot)=0 |
| Write one output snapshot. Called from the IO thread. | |
| virtual int | finalize (const SimulationContext &ctx)=0 |
| Flush and close output file(s). Called from main thread. | |
| virtual const char * | last_error_message () const noexcept |
| Get the last error message from this plugin instance. | |
Interface for output-writing plugins.
|
virtualdefault |
|
pure virtual |
Flush and close output file(s). Called from main thread.
Called after the simulation loop ends and the IO thread has been joined. All update() calls have completed at this point. Flush any write buffers and close file handles.
| ctx | Read-only simulation context (for final state / metadata). |
Implemented in openswmm::DefaultOutputPlugin.
|
pure virtual |
Initialize the plugin from command-line-style arguments.
Called once after the plugin library is loaded. Parse any configuration from init_args (e.g., output file path, format options). This is the place to open no files — that happens in prepare(). Use validate() to check config correctness.
| init_args | Tokenized arguments from the [PLUGINS] section line. e.g., {"file=results.h5", "compress=9"} |
| info | Back-pointer to the IPluginComponentInfo (for metadata). |
|
inlinevirtualnoexcept |
Get the last error message from this plugin instance.
Reimplemented in openswmm::DefaultOutputPlugin.
|
pure virtual |
Open output file(s) and write headers.
Called after validate() succeeds, just before the simulation loop begins. Open file handles, allocate write buffers, and write any file headers.
| ctx | Read-only simulation context. |
Implemented in openswmm::DefaultOutputPlugin.
|
pure virtualnoexcept |
Query the current plugin state.
Implemented in openswmm::DefaultOutputPlugin.
|
pure virtual |
Write one output snapshot. Called from the IO thread.
Called at each output time step with a read-only snapshot of the simulation state. This method runs on the IO thread — it must NOT access the live SimulationContext.
| snapshot | Read-only simulation state at this output time step. |
Implemented in openswmm::DefaultOutputPlugin.
|
pure virtual |
Validate plugin configuration against the simulation model.
Called after the input file is fully parsed and the model is loaded. Check that configured output paths are writable, that requested object IDs exist, etc.
| ctx | Read-only view of the simulation context (for model metadata). |
Implemented in openswmm::DefaultOutputPlugin.