#include <SpeciesRegistry.hpp>
|
| void | clear () |
| | Erase all species and reset the pollutant count.
|
| |
| int | add (std::string name, SpeciesKind kind, std::string units) |
| | Append a uniquely named species across all kinds.
|
| |
| int | find (std::string_view name) const |
| | Find the first byte-exact species name.
|
| |
| int | count () const noexcept |
| | Count registered constituents of all kinds.
|
| |
| int | pollutant_count () const noexcept |
| | Count registered entries marked POLLUTANT.
|
| |
| int | transported_count () const noexcept |
| | Count mesh-transported constituent kinds.
|
| |
| const std::string & | name (int i) const |
| | Borrow a species identifier.
|
| |
| SpeciesKind | kind (int i) const |
| | Read a species category.
|
| |
| const std::string & | units (int i) const |
| | Borrow a species unit label.
|
| |
| void | truncate_to (int n) |
| | Drop registry entries from a specified index onward.
|
| |
◆ add()
| int openswmm::SpeciesRegistry::add |
( |
std::string | name, |
|
|
SpeciesKind | kind, |
|
|
std::string | units ) |
|
inline |
Append a uniquely named species across all kinds.
Does not enforce pollutant-first ordering. Independent vector appends may fail without rollback; caller keeps dependent arrays and registry blocks coherent.
- Parameters
-
| [in] | name | Owned name moved into storage if accepted; exact-case collision detection. |
| [in] | kind | Kind stored without enum or ordering validation. |
| [in] | units | Owned display/unit label moved verbatim; not parsed. |
- Returns
- New registry index, or -1 on an exact-name collision with no mutation.
◆ clear()
| void openswmm::SpeciesRegistry::clear |
( |
| ) |
|
|
inline |
Erase all species and reset the pollutant count.
Retains vector capacities and invalidates borrowed species strings; does not update any external concentration arrays or ReactionData indexes.
◆ count()
| int openswmm::SpeciesRegistry::count |
( |
| ) |
const |
|
inlinenoexcept |
Count registered constituents of all kinds.
- Returns
- Owned name vector length converted to int.
◆ find()
| int openswmm::SpeciesRegistry::find |
( |
std::string_view | name | ) |
const |
|
inline |
Find the first byte-exact species name.
- Parameters
-
| [in] | name | Borrowed untrimmed name; case-sensitive and allocation-free lookup. |
- Returns
- Registry index or -1; linear scan over all kinds.
◆ kind()
| SpeciesKind openswmm::SpeciesRegistry::kind |
( |
int | i | ) |
const |
|
inline |
Read a species category.
- Parameters
-
| [in] | i | Existing registry index; unchecked. |
- Returns
- Stored SpeciesKind value without normalization.
◆ name()
| const std::string & openswmm::SpeciesRegistry::name |
( |
int | i | ) |
const |
|
inline |
Borrow a species identifier.
- Parameters
-
| [in] | i | Existing registry index in [0,count()); unchecked. |
- Returns
- Reference to owned string, invalidated by growth, truncation, clear or destruction.
◆ pollutant_count()
| int openswmm::SpeciesRegistry::pollutant_count |
( |
| ) |
const |
|
inlinenoexcept |
Count registered entries marked POLLUTANT.
- Returns
- Maintained pollutant-kind count; does not imply those entries occupy the first slots unless caller enforces ordering.
◆ transported_count()
| int openswmm::SpeciesRegistry::transported_count |
( |
| ) |
const |
|
inlinenoexcept |
Count mesh-transported constituent kinds.
This kind whitelist reports registry membership, not the active solver's supported configuration or allocated mesh dimensions.
- Returns
- Number of POLLUTANT, MSX_BULK, RESERVED_AGE and RESERVED_TEMPERATURE entries; excludes MSX_WALL and unknown kinds.
◆ truncate_to()
| void openswmm::SpeciesRegistry::truncate_to |
( |
int | n | ) |
|
|
inline |
Drop registry entries from a specified index onward.
Shrinks all columns and recounts pollutant kinds. Preserves retained prefix values but invalidates erased strings/references; does not repair dependent species indexes or state arrays. Used when rebuilding reaction-species blocks.
- Parameters
-
| [in] | n | First removed index; negative treated as zero, values >=count() leave storage unchanged. |
◆ units()
| const std::string & openswmm::SpeciesRegistry::units |
( |
int | i | ) |
const |
|
inline |
Borrow a species unit label.
- Parameters
-
| [in] | i | Existing registry index; unchecked. |
- Returns
- Reference to owned string, invalidated by registry vector mutation/destruction.
The documentation for this class was generated from the following file: