Owns the three node subtype side-tables plus the reverse index map.
More...
#include <NodeSubtypes.hpp>
|
| void | clear () noexcept |
| | Erase all owned node subtype tables and reverse-map entries.
|
| |
| void | rebuild_index (int n_nodes) |
| | Rebuild base node indices to dense subtype-row lookup.
|
| |
| int | set_node_type (NodeData &nodes, int i, NodeType t) |
| | Change one base node type and maintain its dense side-table row.
|
| |
| void | erase_node (int i, int n_after) |
| | Drop a deleted base node's subtype row and renumber later join keys.
|
| |
| int | storage_row (int i) const noexcept |
| | Resolve a base node key into the storage side table.
|
| |
| int | outfall_row (int i) const noexcept |
| | Resolve a base node key into the outfall side table.
|
| |
| int | divider_row (int i) const noexcept |
| | Resolve a base node key into the divider side table.
|
| |
Owns the three node subtype side-tables plus the reverse index map.
subtype_row[i] is the row of node i within whichever side-table matches nodes.type[i] (i.e. an index into storages/outfalls/ dividers), or -1 for JUNCTION nodes. Together with each side-table's node_idx, this provides O(1) lookup in both directions.
◆ clear()
| void openswmm::NodeSubtypes::clear |
( |
| ) |
|
|
inlinenoexcept |
Erase all owned node subtype tables and reverse-map entries.
Does not edit base NodeData rows; all borrowed subtype references/row indices must be re-resolved.
◆ divider_row()
| int openswmm::NodeSubtypes::divider_row |
( |
int | i | ) |
const |
|
inlinenoexcept |
Resolve a base node key into the divider side table.
O(1), no allocation. Does not independently consult the base object type; correctness depends on coherent table maintenance.
- Parameters
-
| [in] | i | Base-object index; invalid/unbuilt/mismatched join keys yield -1. |
- Returns
- Dense divider row when reverse-map slot is in range and that table's stored key equals i; otherwise -1.
◆ erase_node()
| void openswmm::NodeSubtypes::erase_node |
( |
int | i, |
|
|
int | n_after ) |
|
inline |
Drop a deleted base node's subtype row and renumber later join keys.
Drops only the first matching subtype row across storages/outfalls/dividers, decrements surviving keys above i and rebuilds the map. Does not perform the base erase or repair unrelated model references.
- Parameters
-
| [in] | i | Erased pre-deletion base-object index; call AFTER NodeData::erase_at(i). |
| [in] | n_after | Nonnegative base count after erasure; surviving join keys must fit this count. |
◆ outfall_row()
| int openswmm::NodeSubtypes::outfall_row |
( |
int | i | ) |
const |
|
inlinenoexcept |
Resolve a base node key into the outfall side table.
O(1), no allocation. Does not independently consult the base object type; correctness depends on coherent table maintenance.
- Parameters
-
| [in] | i | Base-object index; invalid/unbuilt/mismatched join keys yield -1. |
- Returns
- Dense outfall row when reverse-map slot is in range and that table's stored key equals i; otherwise -1.
◆ rebuild_index()
| void openswmm::NodeSubtypes::rebuild_index |
( |
int | n_nodes | ) |
|
|
inline |
Rebuild base node indices to dense subtype-row lookup.
Replaces reverse map with -1 then writes each side-table row index. Does not validate duplicate/type-consistency or change table data; duplicate keys are overwritten by later visited tables. Invalid join keys cause unchecked indexing. Allocation exceptions propagate.
- Parameters
-
| [in] | n_nodes | Nonnegative total base-object count; every stored join key must be in [0,count). |
◆ set_node_type()
| int openswmm::NodeSubtypes::set_node_type |
( |
NodeData & | nodes, |
|
|
int | i, |
|
|
NodeType | t ) |
|
inline |
Change one base node type and maintain its dense side-table row.
Erases old row and inserts target defaults, preserving sorted join keys. End insertion updates one reverse entry; shifted rows trigger full rebuild. Does not perform higher-level conversion cleanup, topology validation, source rewiring or solver-cache refresh. Allocation failure is not transactional.
- Parameters
-
| [in,out] | nodes | Caller-owned aligned base NodeData store; this function changes its type field. |
| [in] | i | Existing nonnegative base-object index; no bounds check on the base store. |
| [in] | t | Supported internal NodeType; caller validates enum and editable lifecycle. |
- Returns
- Dense target row, or -1 for JUNCTION/unrecognized no-row types. Same-type existing row returns unchanged.
◆ storage_row()
| int openswmm::NodeSubtypes::storage_row |
( |
int | i | ) |
const |
|
inlinenoexcept |
Resolve a base node key into the storage side table.
O(1), no allocation. Does not independently consult the base object type; correctness depends on coherent table maintenance.
- Parameters
-
| [in] | i | Base-object index; invalid/unbuilt/mismatched join keys yield -1. |
- Returns
- Dense storage row when reverse-map slot is in range and that table's stored key equals i; otherwise -1.
◆ dividers
◆ outfalls
◆ storages
◆ subtype_row
| std::vector<int> openswmm::NodeSubtypes::subtype_row |
base node index → row in its subtype table (-1 for junctions).
The documentation for this struct was generated from the following file:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/data/NodeSubtypes.hpp