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

Owns the five link subtype side-tables plus the reverse index map. More...

#include <LinkSubtypes.hpp>

Collaboration diagram for openswmm::LinkSubtypes:

Public Member Functions

void build_default_rows (const LinkData &L)
 Create a fresh default subtype row for every link, keyed by links.type[i], and rebuild the reverse index. Used by unit-test fixtures that hand-build a SimulationContext (set link types + write subtype config directly into these tables). Production never needs it — the parse/resolve/edit paths create rows as they go.
 
void clear () noexcept
 
void rebuild_index (int n_links)
 Recompute subtype_row from each table's link_idx (no row data touched).
 
int set_link_type (LinkData &links, int i, LinkType t)
 
void erase_link (int i, int n_after)
 
int conduit_row (int i) const noexcept
 
int pump_row (int i) const noexcept
 
int orifice_row (int i) const noexcept
 
int weir_row (int i) const noexcept
 
int outlet_row (int i) const noexcept
 

Public Attributes

ConduitData conduits
 
PumpData pumps
 
OrificeData orifices
 
WeirData weirs
 
OutletData outlets
 
std::vector< int > subtype_row
 base link index → row in its subtype table (-1 if unset).
 

Detailed Description

Owns the five link subtype side-tables plus the reverse index map.

subtype_row[i] is the row of link i within whichever side-table matches links.type[i] (every link type has exactly one). Together with each table's link_idx, this is O(1) in both directions.

Member Function Documentation

◆ build_default_rows()

void openswmm::LinkSubtypes::build_default_rows ( const LinkData & L)
inline

Create a fresh default subtype row for every link, keyed by links.type[i], and rebuild the reverse index. Used by unit-test fixtures that hand-build a SimulationContext (set link types + write subtype config directly into these tables). Production never needs it — the parse/resolve/edit paths create rows as they go.

Here is the call graph for this function:

◆ clear()

void openswmm::LinkSubtypes::clear ( )
inlinenoexcept
Here is the caller graph for this function:

◆ conduit_row()

int openswmm::LinkSubtypes::conduit_row ( int i) const
inlinenoexcept
Here is the caller graph for this function:

◆ erase_link()

void openswmm::LinkSubtypes::erase_link ( int i,
int n_after )
inline

Drop link i's subtype row and renumber join keys after a base link erase. Call after LinkData::erase_at(i) (n_after = new link count).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ orifice_row()

int openswmm::LinkSubtypes::orifice_row ( int i) const
inlinenoexcept
Here is the caller graph for this function:

◆ outlet_row()

int openswmm::LinkSubtypes::outlet_row ( int i) const
inlinenoexcept
Here is the caller graph for this function:

◆ pump_row()

int openswmm::LinkSubtypes::pump_row ( int i) const
inlinenoexcept
Here is the caller graph for this function:

◆ rebuild_index()

void openswmm::LinkSubtypes::rebuild_index ( int n_links)
inline

Recompute subtype_row from each table's link_idx (no row data touched).

Here is the caller graph for this function:

◆ set_link_type()

int openswmm::LinkSubtypes::set_link_type ( LinkData & links,
int i,
LinkType t )
inline

Set link i to t, creating/removing/moving its subtype row. Returns the new subtype row. Also sets links.type[i]. Idempotent for the same type. Mirrors NodeSubtypes::set_node_type.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ weir_row()

int openswmm::LinkSubtypes::weir_row ( int i) const
inlinenoexcept
Here is the caller graph for this function:

Member Data Documentation

◆ conduits

ConduitData openswmm::LinkSubtypes::conduits

◆ orifices

OrificeData openswmm::LinkSubtypes::orifices

◆ outlets

OutletData openswmm::LinkSubtypes::outlets

◆ pumps

PumpData openswmm::LinkSubtypes::pumps

◆ subtype_row

std::vector<int> openswmm::LinkSubtypes::subtype_row

base link index → row in its subtype table (-1 if unset).

◆ weirs

WeirData openswmm::LinkSubtypes::weirs

The documentation for this struct was generated from the following file: