![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Default output plugin: writes SWMM 5.x compatible binary .out file. More...
#include <DefaultOutputPlugin.hpp>
Public Member Functions | |
| DefaultOutputPlugin (std::string out_path) | |
| Construct with the output file path. | |
| ~DefaultOutputPlugin () override=default | |
| PluginState | state () const noexcept override |
| Query the current plugin state. | |
| int | initialize (const std::vector< std::string > &init_args, const IPluginComponentInfo *info) override |
| int | validate (const SimulationContext &ctx) override |
| Validate plugin configuration against the simulation model. | |
| int | prepare (const SimulationContext &ctx) override |
| Open output file(s) and write headers. | |
| int | update (const SimulationSnapshot &snapshot) override |
| Write one output snapshot. Called from the IO thread. | |
| int | finalize (const SimulationContext &ctx) override |
| Flush and close output file(s). Called from main thread. | |
| const char * | last_error_message () const noexcept override |
| Get the last error message from this plugin instance. | |
Public Member Functions inherited from openswmm::IOutputPlugin | |
| virtual | ~IOutputPlugin ()=default |
| virtual int | initialize (const std::vector< std::string > &init_args, const class IPluginComponentInfo *info)=0 |
| Initialize the plugin from command-line-style arguments. | |
Default output plugin: writes SWMM 5.x compatible binary .out file.
This plugin is injected automatically when the engine is opened with a non-empty out_path. It does NOT require a [PLUGINS] entry.
|
explicit |
Construct with the output file path.
| out_path | File path for the binary .out file. |
|
overridedefault |
|
overridevirtual |
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). |
Implements openswmm::IOutputPlugin.
|
override |
|
inlineoverridevirtualnoexcept |
Get the last error message from this plugin instance.
Reimplemented from openswmm::IOutputPlugin.
|
overridevirtual |
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. |
Implements openswmm::IOutputPlugin.
|
inlineoverridevirtualnoexcept |
Query the current plugin state.
Implements openswmm::IOutputPlugin.
|
overridevirtual |
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. |
Implements openswmm::IOutputPlugin.
|
overridevirtual |
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). |
Implements openswmm::IOutputPlugin.