OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
IOutputPlugin.hpp File Reference

Interface for output-writing plugins. More...

#include <string>
#include <vector>
#include "PluginState.hpp"
#include "SimulationSnapshot.hpp"
Include dependency graph for IOutputPlugin.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmm::IOutputPlugin
 Interface for output-writing plugins. More...
 

Namespaces

namespace  openswmm
 

Detailed Description

Interface for output-writing plugins.

Implement this interface to write SWMM simulation results to custom formats (HDF5, NetCDF, CSV, database, etc.).

Threading model: IOutputPlugin::update() is called from the IO thread, not the main simulation thread. update() receives a const SimulationSnapshot& — a read-only deep copy of the simulation state at the output time. Do NOT attempt to access the live SimulationContext from within update().

All other lifecycle methods (initialize, validate, prepare, finalize) are called from the main thread before/after the simulation loop.

Lifecycle order (enforced by PluginFactory)
initialize() → validate() → prepare()
→ update() [N times, IO thread]
→ finalize()
Note
Return codes: 0 = success; non-zero = error. The PluginFactory transitions the plugin to ERROR state on non-zero return.