OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::gpkg::formats Namespace Reference

Classes

struct  ClimateRow
 One row of a climate file (user CSV form). More...
 
struct  FormatResult
 Lightweight outcome for format parse / materialise calls. More...
 
struct  HotstartHeader
 HSF header / counts (matches legacy hotstart.c layout). More...
 
struct  HotstartLinkState
 Per-link routing state snapshot. More...
 
struct  HotstartNodeState
 Per-node routing state snapshot. More...
 
struct  HotstartSnapshot
 Top-level snapshot — header plus per-object vectors. More...
 
struct  HotstartSubcatchState
 Per-subcatchment routing state snapshot (HSF v3+). More...
 
struct  RaingageRow
 One row of a raingage data file ("Standard" SWMM columnar). More...
 
struct  RoutingInterfaceMetadata
 Header / metadata captured at the top of a routing interface file. More...
 
struct  RoutingInterfaceRow
 One per-object record in a routing interface file. More...
 
struct  TimeseriesRow
 One row of a timeseries (SWMM-native text format). More...
 

Functions

FormatResult parseClimateCsv (const std::string &path, std::vector< ClimateRow > &rows)
 
FormatResult writeClimateCsv (const std::string &path, const std::vector< ClimateRow > &rows)
 
FormatResult ok ()
 
FormatResult fail (std::string message)
 
FormatResult parseHotstartHsf (const std::string &path, HotstartSnapshot &snapshot)
 Parse an HSF v4 file into a HotstartSnapshot.
 
FormatResult writeHotstartHsf (const std::string &path, const HotstartSnapshot &snapshot)
 Write a HotstartSnapshot to an HSF v4 file at path.
 
FormatResult parseRaingageStd (const std::string &path, std::vector< RaingageRow > &rows)
 
FormatResult writeRaingageStd (const std::string &path, const std::vector< RaingageRow > &rows)
 
FormatResult parseRoutingInterfaceText (const std::string &path, RoutingInterfaceMetadata &meta, std::vector< RoutingInterfaceRow > &rows)
 Parse a SWMM5 routing-interface text file into metadata + rows.
 
FormatResult writeRoutingInterfaceText (const std::string &path, const RoutingInterfaceMetadata &meta, const std::vector< RoutingInterfaceRow > &rows)
 Write metadata + rows out to a SWMM5 routing-interface text file.
 
FormatResult parseTimeseriesText (const std::string &path, std::vector< TimeseriesRow > &rows)
 Parse a SWMM-native timeseries text file at path into rows.
 
FormatResult writeTimeseriesText (const std::string &path, const std::vector< TimeseriesRow > &rows)
 Write rows back to a SWMM-native timeseries text file at path.
 

Function Documentation

◆ fail()

FormatResult openswmm::gpkg::formats::fail ( std::string message)
inline
Here is the caller graph for this function:

◆ ok()

FormatResult openswmm::gpkg::formats::ok ( )
inline
Here is the caller graph for this function:

◆ parseClimateCsv()

FormatResult openswmm::gpkg::formats::parseClimateCsv ( const std::string & path,
std::vector< ClimateRow > & rows )
Here is the call graph for this function:

◆ parseHotstartHsf()

FormatResult openswmm::gpkg::formats::parseHotstartHsf ( const std::string & path,
HotstartSnapshot & snapshot )

Parse an HSF v4 file into a HotstartSnapshot.

Populates header.{num_*,flow_units,file_version,file_stamp}, node_state[], and link_state[]. subcatch_state[] is left empty (see header doc — runoff state is out of scope for this slice).

Parameters
pathFilesystem path to the HSF file.
snapshotOutput snapshot (existing content is overwritten).
Here is the call graph for this function:

◆ parseRaingageStd()

FormatResult openswmm::gpkg::formats::parseRaingageStd ( const std::string & path,
std::vector< RaingageRow > & rows )
Here is the call graph for this function:

◆ parseRoutingInterfaceText()

FormatResult openswmm::gpkg::formats::parseRoutingInterfaceText ( const std::string & path,
RoutingInterfaceMetadata & meta,
std::vector< RoutingInterfaceRow > & rows )

Parse a SWMM5 routing-interface text file into metadata + rows.

Parameters
pathFilesystem path to read.
metaOutput metadata (title, step, units, pollutants, objects). Pollutant_values length on each row equals meta.pollutant_ids.size().
rowsOutput data rows (appended; caller clears if needed).
Here is the call graph for this function:

◆ parseTimeseriesText()

FormatResult openswmm::gpkg::formats::parseTimeseriesText ( const std::string & path,
std::vector< TimeseriesRow > & rows )

Parse a SWMM-native timeseries text file at path into rows.

Parameters
pathFilesystem path to read.
rowsOutput rows (appended; caller must clear if needed).
Returns
FormatResultok on success; error carries open / parse diagnostics on failure.
Here is the call graph for this function:

◆ writeClimateCsv()

FormatResult openswmm::gpkg::formats::writeClimateCsv ( const std::string & path,
const std::vector< ClimateRow > & rows )
Here is the call graph for this function:

◆ writeHotstartHsf()

FormatResult openswmm::gpkg::formats::writeHotstartHsf ( const std::string & path,
const HotstartSnapshot & snapshot )

Write a HotstartSnapshot to an HSF v4 file at path.

Header counts must already match the lengths of the per-object state vectors; mismatches return a FormatResult with ok=false rather than writing a corrupt file. Subcatchment runoff state is not written — the slice's scope is routing-only round-trip.

Here is the call graph for this function:

◆ writeRaingageStd()

FormatResult openswmm::gpkg::formats::writeRaingageStd ( const std::string & path,
const std::vector< RaingageRow > & rows )
Here is the call graph for this function:

◆ writeRoutingInterfaceText()

FormatResult openswmm::gpkg::formats::writeRoutingInterfaceText ( const std::string & path,
const RoutingInterfaceMetadata & meta,
const std::vector< RoutingInterfaceRow > & rows )

Write metadata + rows out to a SWMM5 routing-interface text file.

meta.object_ids is written verbatim to the header. Rows whose object_id doesn't appear in meta.object_ids are still emitted — the legacy reader would silently skip them, so we do not enforce the registry.

Here is the call graph for this function:

◆ writeTimeseriesText()

FormatResult openswmm::gpkg::formats::writeTimeseriesText ( const std::string & path,
const std::vector< TimeseriesRow > & rows )

Write rows back to a SWMM-native timeseries text file at path.

Output uses MM/DD/YYYY HH:MM:SS followed by a fixed-precision value. Idempotent round-trip with parseTimeseriesText.

Here is the call graph for this function: