SoA collection of all time series and curves in the model.
More...
#include <TableData.hpp>
|
| std::size_t | count () const noexcept |
| |
| Table & | operator[] (int idx) |
| |
| const Table & | operator[] (int idx) const |
| |
| int | add (const std::string &id, TableType type) |
| | Add a new empty table with the given ID and type.
|
| |
| void | rebuild_index () |
| | Rebuilds by_name from tables.
|
| |
| int | find_by_kind (std::string_view name, bool want_timeseries) const noexcept |
| | Lowest-indexed table with this name and kind; -1 if none.
|
| |
| void | reset_cursors () noexcept |
| | Reset all cursors (call before re-running a simulation).
|
| |
|
| std::vector< Table > | tables |
| | All tables in index order.
|
| |
| std::unordered_map< std::string, std::vector< int >, CiHash, CiEqual > | by_name |
| | Case-insensitive name → table indices, ascending.
|
| |
SoA collection of all time series and curves in the model.
Indexed by table index (integer). Lookup by name is done via the SimulationContext name-to-index hash map.
◆ add()
| int openswmm::TableData::add |
( |
const std::string & | id, |
|
|
TableType | type ) |
|
inline |
Add a new empty table with the given ID and type.
- Returns
- Index of the new table.
◆ count()
| std::size_t openswmm::TableData::count |
( |
| ) |
const |
|
inlinenoexcept |
◆ find_by_kind()
| int openswmm::TableData::find_by_kind |
( |
std::string_view | name, |
|
|
bool | want_timeseries ) const |
|
inlinenoexcept |
Lowest-indexed table with this name and kind; -1 if none.
- Parameters
-
| want_timeseries | true for TIMESERIES, false for any CURVE_*. |
◆ operator[]() [1/2]
| Table & openswmm::TableData::operator[] |
( |
int | idx | ) |
|
|
inline |
◆ operator[]() [2/2]
| const Table & openswmm::TableData::operator[] |
( |
int | idx | ) |
const |
|
inline |
◆ rebuild_index()
| void openswmm::TableData::rebuild_index |
( |
| ) |
|
|
inline |
Rebuilds by_name from tables.
Required after any structural change that is not an append — in practice only ObjectDeleter's erase-and-renumber, which is already O(n). Anything that mutates tables directly without calling this leaves lookups stale.
◆ reset_cursors()
| void openswmm::TableData::reset_cursors |
( |
| ) |
|
|
inlinenoexcept |
Reset all cursors (call before re-running a simulation).
◆ by_name
| std::unordered_map<std::string, std::vector<int>, CiHash, CiEqual> openswmm::TableData::by_name |
Case-insensitive name → table indices, ascending.
Replaces the linear ieq scan that find_timeseries() / find_curve() used to run over every table. That scan was the load path's worst complexity defect: [TIMESERIES] and [CURVES] rows repeat their object's name on every row in standard SWMM files, so parsing a model with many long series cost O(total_rows x n_tables) string compares before anything else happened.
A name maps to a list because legacy keeps TSERIES and CURVE in separate hash tables, so one name may legitimately denote both a timeseries and a curve. Lists are in ascending index order (add() only appends), which is what makes a hash hit return the same winner the old first-match scan did — the duplicate-name parity the name-case tests pin.
◆ tables
| std::vector<Table> openswmm::TableData::tables |
All tables in index order.
The documentation for this struct was generated from the following file:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/data/TableData.hpp