![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Stores the full user-flags data: schema definitions + per-object values. More...
#include <UserFlags.hpp>
Public Types | |
| using | ValueMap |
Public Member Functions | |
| void | define (UserFlagDef def) |
| Register a flag definition. | |
| bool | undefine (const std::string &name) |
| Remove a flag definition and all per-object values assigned to it. | |
| bool | is_defined (const std::string &name) const |
| Check whether a flag name has been defined (schema). | |
| const UserFlagDef & | get_def (const std::string &name) const |
| Retrieve a flag definition by name. | |
| const std::vector< UserFlagDef > & | all_defs () const noexcept |
| All flag definitions, in insertion order. | |
| std::size_t | def_count () const noexcept |
| Number of defined flag schemas. | |
| void | set (const std::string &object_type, const std::string &object_name, const std::string &flag_name, UserFlagValue value) |
| Assign a value to (object_type, object_name, flag_name). | |
| bool | unset (const std::string &object_type, const std::string &object_name, const std::string &flag_name) |
| Remove the value assigned to (object_type, object_name, flag_name). | |
| bool | has_value (const std::string &object_type, const std::string &object_name, const std::string &flag_name) const |
| Check whether a value has been assigned for a given triple. | |
| const UserFlagValue & | get_value (const std::string &object_type, const std::string &object_name, const std::string &flag_name) const |
| Retrieve the value for (object_type, object_name, flag_name). | |
| std::optional< UserFlagValue > | try_get_value (const std::string &object_type, const std::string &object_name, const std::string &flag_name) const |
| Retrieve the value, or nullopt if not assigned. | |
| const ValueMap & | all_values () const noexcept |
| All per-object value assignments, keyed by composite string. | |
| std::size_t | value_count () const noexcept |
| Number of per-object value assignments. | |
| void | clear () noexcept |
| Clear both schema definitions and per-object value assignments. | |
Static Public Member Functions | |
| static std::string | make_key (const std::string &object_type, const std::string &object_name, const std::string &flag_name) |
| Build the composite lookup key "OBJECTTYPE:OBJECTNAME:FLAGNAME". | |
Stores the full user-flags data: schema definitions + per-object values.
Part of SimulationContext. Accessible at runtime via the C API and Python bindings.
Lookup key for per-object values is the composite string "OBJECTTYPE:OBJECTNAME:FLAGNAME" (all uppercase).
Composite-key value map; case-insensitive so object-name lookups match the engine's legacy-parity name semantics, while the stored key keeps the first-seen spelling for faithful [USER_FLAG_VALUES] round-trips.
|
inlinenoexcept |
All flag definitions, in insertion order.
|
inlinenoexcept |
All per-object value assignments, keyed by composite string.
|
inlinenoexcept |
Clear both schema definitions and per-object value assignments.
|
inlinenoexcept |
Number of defined flag schemas.
|
inline |
Register a flag definition.
Overwrites any existing definition with the same name.
|
inline |
Retrieve a flag definition by name.
| std::out_of_range | if not defined. |
|
inline |
Retrieve the value for (object_type, object_name, flag_name).
| std::out_of_range | if not found. |
|
inline |
Check whether a value has been assigned for a given triple.
|
inline |
Check whether a flag name has been defined (schema).
|
inlinestatic |
Build the composite lookup key "OBJECTTYPE:OBJECTNAME:FLAGNAME".
All components are used as-is; the value map itself compares keys case-insensitively (CiHash/CiEqual), so no component needs pre-normalization and the first-seen spelling is preserved.
|
inline |
Assign a value to (object_type, object_name, flag_name).
Overwrites any existing assignment for the same triple. object_type and flag_name are stored uppercase.
|
inline |
Retrieve the value, or nullopt if not assigned.
|
inline |
Remove a flag definition and all per-object values assigned to it.
|
inline |
Remove the value assigned to (object_type, object_name, flag_name).
|
inlinenoexcept |
Number of per-object value assignments.