OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches

User-defined model flags (InfoWorks ICM-style, two-section design). More...

#include <string>
#include <unordered_map>
#include <vector>
#include <variant>
#include <optional>
#include <stdexcept>
Include dependency graph for UserFlags.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmm::UserFlagDef
 Schema entry for a single user-defined flag. More...
 
struct  openswmm::UserFlagAssignment
 A (object_type, object_name, flag_name) → value assignment. More...
 
class  openswmm::UserFlags
 Stores the full user-flags data: schema definitions + per-object values. More...
 

Namespaces

namespace  openswmm
 

Typedefs

using openswmm::UserFlagValue = std::variant< bool, int, double, std::string >
 A concrete flag value assigned to a specific object.
 

Enumerations

enum class  openswmm::UserFlagType : int {
  openswmm::UserFlagType::BOOLEAN = 0 ,
  openswmm::UserFlagType::INTEGER = 1 ,
  openswmm::UserFlagType::REAL = 2 ,
  openswmm::UserFlagType::STRING = 3
}
 Value type for a user flag. More...
 

Detailed Description

User-defined model flags (InfoWorks ICM-style, two-section design).

User flags are a two-section feature:

  1. [USER_FLAGS] — defines the flag schema (name, type, description). Each entry declares that a flag exists and what type of value it holds. This is analogous to defining a custom attribute category.
  2. [USER_FLAG_VALUES] — assigns concrete flag values to specific objects identified by (object type, object name, flag name).

Input file syntax:

[USER_FLAGS]
;;Name Type Description
INSPECTED BOOLEAN "Has the object been field-inspected?"
PRIORITY INTEGER "Maintenance priority (1 = highest)"
ROUGHNESS_ADJ REAL "Site-specific roughness multiplier"
ASSET_ID STRING "External asset-management system ID"
[USER_FLAG_VALUES]
;;ObjectType ObjectName FlagName Value
NODE J1 INSPECTED YES
NODE J1 PRIORITY 2
LINK C_MAIN ROUGHNESS_ADJ 1.05
LINK C_MAIN ASSET_ID "AM-00341"
SUBCATCHMENT S_WEST INSPECTED NO
ObjectType
Enumeration of object types used in SWMM5.
Definition enums.h:53
@ NODE
Node.
Definition enums.h:59
@ LINK
Link.
Definition enums.h:61
@ NO
No option.
Definition enums.h:1208
@ YES
Yes option.
Definition enums.h:1210
See also
Legacy reference: InfoWorks ICM user-defined flags concept. No equivalent in legacy SWMM 5.x.
docs/MASTER_IMPLEMENTATION_PLAN.md R28
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License