![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
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 | HsfLayout |
| What the model says about a file's layout that the file does not. 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) |
| Append daily records from the user climate CSV subset. | |
| FormatResult | writeClimateCsv (const std::string &path, const std::vector< ClimateRow > &rows) |
| Overwrite a daily climate CSV with the fixed seven-column header. | |
| FormatResult | ok () |
| Create a successful format-adapter outcome. | |
| FormatResult | fail (std::string message) |
| Create a failed format-adapter outcome with an owned explanation. | |
| FormatResult | parseHotstartHsf (const std::string &path, HotstartSnapshot &snapshot, const HsfLayout &layout={}) |
| Read legacy-layout hot-start records and preserve raw runoff/trailer bytes. | |
| FormatResult | writeHotstartHsf (const std::string &path, const HotstartSnapshot &snapshot) |
| Write retained legacy hot-start routing records and opaque raw sections. | |
| FormatResult | parseRaingageStd (const std::string &path, std::vector< RaingageRow > &rows) |
| Append standard SWMM station/date/time/rain records. | |
| FormatResult | writeRaingageStd (const std::string &path, const std::vector< RaingageRow > &rows) |
| Overwrite a standard SWMM station precipitation text file. | |
| 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) |
| Overwrite a SWMM5 text routing interface from retained metadata and rows. | |
| 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) |
| Overwrite dated time-series text from raw samples. | |
|
inline |
Create a failed format-adapter outcome with an owned explanation.
| [in] | message | Diagnostic passed by value and moved into the result; may be empty. |
|
inline |
Create a successful format-adapter outcome.
| FormatResult openswmm::gpkg::formats::parseClimateCsv | ( | const std::string & | path, |
| std::vector< ClimateRow > & | rows ) |
Append daily records from the user climate CSV subset.
Uses 2048-byte line reads, comma splitting without CSV quoting, trimmed case-insensitive headers and # comments. Date text remains unvalidated; absent/unparseable numbers become zero (stod prefixes accepted). No unit conversion, sort, duplicate/finite/range check or late ferror/close reporting; allocation exceptions can escape.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in,out] | rows | Caller-owned destination appended in file order; not cleared, and earlier rows remain on failure. |
| FormatResult openswmm::gpkg::formats::parseHotstartHsf | ( | const std::string & | path, |
| HotstartSnapshot & | snapshot, | ||
| const HsfLayout & | layout = {} ) |
Read legacy-layout hot-start records and preserve raw runoff/trailer bytes.
Reads a 15-byte SWMM5 stamp and six native int32 counts in the v4-compatible layout regardless of parsed suffix. Caller supplies nonnegative representable counts/size products and matching storage layout; the parser has no global count/memory or finite-value cap. Native floats store feet/cfs and concentrations; runoff/trailer retained verbatim, subcatch_state not decoded. No checksum/model-fingerprint validation or whole-destination rollback; allocation/callback exceptions can escape.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in,out] | snapshot | Destination overwritten incrementally, with prior/partial fields retained on failure; caller normally starts fresh. |
| [in] | layout | Borrowed model-dependent runoff-length callback and storage-node mask; correct aligned dimensions required to locate routing records. |
| FormatResult openswmm::gpkg::formats::parseRaingageStd | ( | const std::string & | path, |
| std::vector< RaingageRow > & | rows ) |
Append standard SWMM station/date/time/rain records.
Uses 512-byte line reads and sscanf; comments/short malformed rows skip. No station filter, start-date clipping, unit/rain-type conversion, monotonic/finite validation or late IO checking. Timestamp validity follows permissive datetime encoders.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in,out] | rows | Caller-owned destination appended with station ID, OADate and raw rainfall values. |
| 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.
| path | Filesystem path to read. |
| meta | Output metadata (title, step, units, pollutants, objects). Pollutant_values length on each row equals meta.pollutant_ids.size(). |
| rows | Output data rows (appended; caller clears if needed). |
| FormatResult openswmm::gpkg::formats::parseTimeseriesText | ( | const std::string & | path, |
| std::vector< TimeseriesRow > & | rows ) |
Parse a SWMM-native timeseries text file at path into rows.
| path | Filesystem path to read. |
| rows | Output rows (appended; caller must clear if needed). |
ok on success; error carries open / parse diagnostics on failure. | FormatResult openswmm::gpkg::formats::writeClimateCsv | ( | const std::string & | path, |
| const std::vector< ClimateRow > & | rows ) |
Overwrite a daily climate CSV with the fixed seven-column header.
Writes numbers with four decimals, unescaped date text and row order unchanged. Does not check fprintf/fclose errors, atomically stage output, create directories or validate dates/units.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in] | rows | Borrowed date/tmin/tmax/evap/wind/sky/humidity rows in retained source-unit conventions. |
| FormatResult openswmm::gpkg::formats::writeHotstartHsf | ( | const std::string & | path, |
| const HotstartSnapshot & | snapshot ) |
Write retained legacy hot-start routing records and opaque raw sections.
Checks node/link vector counts and pollutant widths before opening. Writes v2..v4 stamp according to file_version, otherwise v4, using the same six-count native layout; empty runoff writes subcatch count zero. Values narrow to native floats; HRT is written whenever has_hrt even if version is older, so caller supplies compatible flags. Ignores derived overflow/volume/timing fields. Direct truncation, no atomic stage, finite validation or CRC; trailer preserved.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in] | snapshot | Coherent header/counts and node/link concentration arrays, with matching runoff bytes and storage HRT flags. |
| FormatResult openswmm::gpkg::formats::writeRaingageStd | ( | const std::string & | path, |
| const std::vector< RaingageRow > & | rows ) |
Overwrite a standard SWMM station precipitation text file.
Emits station, calendar date and hour/minute with rainfall four decimals; seconds are dropped. No escaping, sorting, format/range validation, staging or fprintf/fclose status propagation.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in] | rows | Borrowed station/OADate/raw-rain rows; rainfall remains its source unit convention. |
| FormatResult openswmm::gpkg::formats::writeRoutingInterfaceText | ( | const std::string & | path, |
| const RoutingInterfaceMetadata & | meta, | ||
| const std::vector< RoutingInterfaceRow > & | rows ) |
Overwrite a SWMM5 text routing interface from retained metadata and rows.
Emits missing pollutant-unit labels as empty strings, and each row's entire concentration vector without shape validation against metadata. Does not reorder/group periods, validate IDs/clocks, convert units, escape text or check late write/close errors. Direct truncation, no atomic stage.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in] | meta | Borrowed title/report-step/flow-unit/pollutant/object metadata; counts must be int-representable. |
| [in] | rows | Borrowed object/OADate/flow/concentration rows, already in the units named by metadata. |
| FormatResult openswmm::gpkg::formats::writeTimeseriesText | ( | const std::string & | path, |
| const std::vector< TimeseriesRow > & | rows ) |
Overwrite dated time-series text from raw samples.
Writes MM/DD/YYYY HH:MM:SS and six-decimal values. Does not transform units, sort/validate dates or values, create directories, atomically stage or propagate late fprintf/fclose errors.
| [in] | path | UTF-8 filesystem path; caller supplies parent directories and owns destination/source lifetime. |
| [in] | rows | Borrowed OADate/value samples, preserved in input order and source value units. |