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

Read-only snapshot of simulation state passed to plugins. More...

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

Go to the source code of this file.

Classes

struct  openswmm::NodeSnapshot
 Snapshot of node state at an output time step. More...
 
struct  openswmm::LinkSnapshot
 Snapshot of link state at an output time step. More...
 
struct  openswmm::SubcatchSnapshot
 Snapshot of subcatchment state at an output time step. More...
 
struct  openswmm::GageSnapshot
 Snapshot of rain gage state at an output time step. More...
 
struct  openswmm::SimulationSnapshot
 Complete simulation state snapshot at one output time step. More...
 

Namespaces

namespace  openswmm
 

Detailed Description

Read-only snapshot of simulation state passed to plugins.

A SimulationSnapshot is a deep copy of the relevant SoA arrays from SimulationContext at an output time boundary. Plugins receive a const reference to the snapshot from the IO thread.

Because the snapshot is a separate copy, plugins can safely read all fields without any mutex or synchronization. The main simulation thread continues advancing while the IO thread processes the snapshot.

Note
The snapshot is allocated on the heap and managed by the IOThread's ring buffer. Do NOT store pointers to snapshot data beyond the scope of IOutputPlugin::update() or IReportPlugin::update().
See also
IOThread.hpp (in src/engine/output/)
IOutputPlugin.hpp
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License