![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| struct | ComponentConfigSections |
| struct | ProcessComponentEntry |
| class | ProcessComponentRegistry |
| Process-global id → entry table. More... | |
Typedefs | |
| using | ComponentConfigApply |
| using | ComponentConfigSave |
| Save hook (IO3a): render this component's CURRENT engine state back to config-file text — the inverse of ComponentConfigApply. | |
Functions | |
| std::string | parse_component_config_stream (std::istream &in, const std::string &label, ComponentConfigSections &out) |
| std::string | parse_component_config_text (const std::string &text, const std::string &label, ComponentConfigSections &out) |
| std::string | read_component_config (const std::string &path, const std::string &base_dir, ComponentConfigSections &out) |
| Parse a component configuration file (phase IO2). | |
| std::vector< std::string > | resolve_process_components (SimulationContext &ctx, const std::string &base_dir) |
| Resolve every [PROCESS_COMPONENTS] spec (phase IO1): look up the id, read its config file, and invoke the apply hook. | |
Apply hook: consume the parsed config into engine state. Push diagnostics into errors (fatal) — never throw.
Save hook (IO3a): render this component's CURRENT engine state back to config-file text — the inverse of ComponentConfigApply.
Until this existed, swmm_model_write emitted the [PROCESS_COMPONENTS] config= PATH and copied the file the model was read from, but nothing rewrote its CONTENT. So every edit made through a C API or the GUI — a [HEAT_SOURCES] temperature, a reaction expression — was silently lost on save, while a hand-edit of the same file persisted. InpWriter's own comment states the intended division ("the component config FILES are each
component's own to write, never ours"); this is the hook that lets a component honour it.
ctx is CONST. A save must not mutate the model it is describing; that is the property that makes writing twice give the same file. | std::string openswmm::components::parse_component_config_stream | ( | std::istream & | in, |
| const std::string & | label, | ||
| ComponentConfigSections & | out ) |
| std::string openswmm::components::parse_component_config_text | ( | const std::string & | text, |
| const std::string & | label, | ||
| ComponentConfigSections & | out ) |
Parse config TEXT (same dialect/rules as read_component_config) — E-C3's swmm_reactions_check_text / apply_text surface. label names the source in diagnostics.
| std::string openswmm::components::read_component_config | ( | const std::string & | path, |
| const std::string & | base_dir, | ||
| ComponentConfigSections & | out ) |
Parse a component configuration file (phase IO2).
| path | As given in config="…". |
| base_dir | Directory of the parent .inp ("" ⇒ cwd) — relative paths resolve against it ([2D_MESH_FILE] §3). |
| out | [out] cleared and filled. |
| std::vector< std::string > openswmm::components::resolve_process_components | ( | SimulationContext & | ctx, |
| const std::string & | base_dir ) |
Resolve every [PROCESS_COMPONENTS] spec (phase IO1): look up the id, read its config file, and invoke the apply hook.
| base_dir | Directory of the parent .inp for relative config paths. |