OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
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)
 Replace all subtype rows with defaults derived from current base link types.
 
void clear () noexcept
 Erase all owned link subtype tables and reverse-map entries.
 
void rebuild_index (int n_links)
 Rebuild base link indices to dense subtype-row lookup.
 
int set_link_type (LinkData &links, int i, LinkType t)
 Change one base link type and maintain its dense side-table row.
 
void erase_link (int i, int n_after)
 Drop a deleted base link's subtype row and renumber later join keys.
 
int conduit_row (int i) const noexcept
 Resolve a base link key into the conduit side table.
 
int pump_row (int i) const noexcept
 Resolve a base link key into the pump side table.
 
int orifice_row (int i) const noexcept
 Resolve a base link key into the orifice side table.
 
int weir_row (int i) const noexcept
 Resolve a base link key into the weir side table.
 
int outlet_row (int i) const noexcept
 Resolve a base link key into the outlet side table.
 

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

Replace all subtype rows with defaults derived from current base link types.

Clears all existing subtype configuration/state and recreates sorted default rows, then rebuilds reverse map. Primarily supports hand-built fixtures; does not infer custom geometry/parameters from other stores.

Parameters
[in]LBorrowed aligned LinkData with supported type for each existing row.
Here is the call graph for this function:

◆ clear()

void openswmm::LinkSubtypes::clear ( )
inlinenoexcept

Erase all owned link subtype tables and reverse-map entries.

Does not edit base LinkData rows; all borrowed subtype references/row indices must be re-resolved.

Here is the caller graph for this function:

◆ conduit_row()

int openswmm::LinkSubtypes::conduit_row ( int i) const
inlinenoexcept

Resolve a base link key into the conduit 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 conduit 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_link()

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

Drop a deleted base link's subtype row and renumber later join keys.

Drops only the first matching subtype row across conduits/pumps/orifices/weirs/outlets, 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 LinkData::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:

◆ orifice_row()

int openswmm::LinkSubtypes::orifice_row ( int i) const
inlinenoexcept

Resolve a base link key into the orifice 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 orifice 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:

◆ outlet_row()

int openswmm::LinkSubtypes::outlet_row ( int i) const
inlinenoexcept

Resolve a base link key into the outlet 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 outlet 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:

◆ pump_row()

int openswmm::LinkSubtypes::pump_row ( int i) const
inlinenoexcept

Resolve a base link key into the pump 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 pump 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::LinkSubtypes::rebuild_index ( int n_links)
inline

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

◆ set_link_type()

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

Change one base link 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]linksCaller-owned aligned base LinkData store; this function changes its type field.
[in]iExisting nonnegative base-object index; no bounds check on the base store.
[in]tSupported internal LinkType; caller validates enum and editable lifecycle.
Returns
Dense target row; unrecognized types can return -1. Same-type existing row returns unchanged.
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

Resolve a base link key into the weir 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 weir 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

◆ 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: