![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
C API implementation — [INITIAL_QUALITY] per-element rows (E-A4). More...
#include "openswmm_api_common.hpp"#include "../transport/MsxInitialQuality.hpp"#include "../../../include/openswmm/engine/openswmm_initial_quality.h"#include <cstring>#include <string>Functions | |
| SWMM_ENGINE_API int | swmm_init_quality_count (SWMM_Engine engine) |
| Number of [INITIAL_QUALITY] entries. | |
| SWMM_ENGINE_API int | swmm_init_quality_get (SWMM_Engine engine, int entry_idx, int *is_link, int *elem_idx, char *constituent_buf, int constituent_len, double *value) |
| Read one entry. | |
| SWMM_ENGINE_API int | swmm_init_quality_set (SWMM_Engine engine, int is_link, int elem_idx, const char *constituent, double value) |
| Upsert one entry keyed on (is_link, elem_idx, constituent). | |
| SWMM_ENGINE_API int | swmm_init_quality_remove (SWMM_Engine engine, int entry_idx) |
Remove the entry at entry_idx. Subsequent entries shift down by one — callers holding cached indices must re-enumerate. | |
| SWMM_ENGINE_API int | swmm_init_quality_file_get (SWMM_Engine engine, char *buf, int buflen) |
| The FILE path as written ("" when none). | |
| SWMM_ENGINE_API int | swmm_init_quality_file_set (SWMM_Engine engine, const char *path) |
| Set (or clear with "" / NULL) the FILE reference. | |
| SWMM_ENGINE_API int | swmm_init_quality_is_file (SWMM_Engine engine, int entry_idx) |
1 when row entry_idx was loaded from the FILE sidecar, else 0. | |
C API implementation — [INITIAL_QUALITY] per-element rows (E-A4).
| SWMM_ENGINE_API int swmm_init_quality_count | ( | SWMM_Engine | engine | ) |
Number of [INITIAL_QUALITY] entries.
| engine | Engine handle. |
| SWMM_ENGINE_API int swmm_init_quality_file_get | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
The FILE path as written ("" when none).
| SWMM_ENGINE_API int swmm_init_quality_file_set | ( | SWMM_Engine | engine, |
| const char * | path ) |
Set (or clear with "" / NULL) the FILE reference.
| SWMM_ENGINE_API int swmm_init_quality_get | ( | SWMM_Engine | engine, |
| int | entry_idx, | ||
| int * | is_link, | ||
| int * | elem_idx, | ||
| char * | constituent_buf, | ||
| int | constituent_len, | ||
| double * | value ) |
Read one entry.
| engine | Engine handle. |
| entry_idx | Entry index (0..count-1). |
| is_link | [out] 0 = node row, 1 = link row. |
| elem_idx | [out] Resolved node/link index (-1 if unresolved). |
| constituent_buf | [out] Constituent name (NUL-terminated). |
| constituent_len | Buffer size in bytes. |
| value | [out] Raw value (pollutant units / hours / degC). |
| SWMM_ENGINE_API int swmm_init_quality_is_file | ( | SWMM_Engine | engine, |
| int | entry_idx ) |
1 when row entry_idx was loaded from the FILE sidecar, else 0.
| SWMM_ENGINE_API int swmm_init_quality_remove | ( | SWMM_Engine | engine, |
| int | entry_idx ) |
Remove the entry at entry_idx. Subsequent entries shift down by one — callers holding cached indices must re-enumerate.
BUILDING/OPENED only.
| SWMM_ENGINE_API int swmm_init_quality_set | ( | SWMM_Engine | engine, |
| int | is_link, | ||
| int | elem_idx, | ||
| const char * | constituent, | ||
| double | value ) |
Upsert one entry keyed on (is_link, elem_idx, constituent).
BUILDING/OPENED only. Unknown constituent name, bad element index, or a negative pollutant value returns SWMM_ERR_BADPARAM. (Negative values are legal for "__WATER_AGE__" and "__TEMPERATURE__".)
| engine | Engine handle. |
| is_link | 0 = node row, 1 = link row. |
| elem_idx | Node/link index. |
| constituent | Pollutant name or reserved species name. |
| value | Raw value (pollutant units / hours / degC). |