OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::NodeSubtypes Struct Reference

Owns the three node subtype side-tables plus the reverse index map. More...

#include <NodeSubtypes.hpp>

Collaboration diagram for openswmm::NodeSubtypes:

Public Member Functions

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.
 

Public Attributes

StorageData storages
 
OutfallData outfalls
 
DividerData dividers
 
std::vector< int > subtype_row
 base node index → row in its subtype table (-1 for junctions).
 

Detailed Description

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.

Member Function Documentation

◆ 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]iBase-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.
Here is the caller graph for this function:

◆ 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]iErased pre-deletion base-object index; call AFTER NodeData::erase_at(i).
[in]n_afterNonnegative base count after erasure; surviving join keys must fit this count.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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]iBase-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.
Here is the caller graph for this function:

◆ 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_nodesNonnegative total base-object count; every stored join key must be in [0,count).
Here is the caller graph for this function:

◆ 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]nodesCaller-owned aligned base NodeData store; this function changes its type field.
[in]iExisting nonnegative base-object index; no bounds check on the base store.
[in]tSupported 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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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]iBase-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.
Here is the caller graph for this function:

Member Data Documentation

◆ dividers

DividerData openswmm::NodeSubtypes::dividers

◆ outfalls

OutfallData openswmm::NodeSubtypes::outfalls

◆ storages

StorageData openswmm::NodeSubtypes::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: