#include <controlruleregistry.h>
|
| | ControlRuleRegistry (QObject *parent=nullptr) |
| |
| | ~ControlRuleRegistry () override |
| |
| QVector< ControlRuleProvider * > | providers () const |
| |
| int | providerCount () const noexcept |
| |
| ControlRuleProvider * | findByName (const QString &name) const |
| |
| bool | hasName (const QString &name) const |
| |
| ControlRuleProvider * | create (const QString &name, const QString &body) |
| | Create + own a new provider with the given name + body. Returns the new provider, or nullptr if the name collides. Does NOT push to the engine — the layer's apply-helpers do that.
|
| |
| void | remove (ControlRuleProvider *p) |
| | Remove a provider from the registry (no engine touch — the layer does that via applyControlRuleRemove).
|
| |
| bool | rename (ControlRuleProvider *p, const QString &newName) |
| | Rename a provider with uniqueness check. Returns false on collision (case-insensitive) or empty name.
|
| |
| int | loadFromEngine (void *engineHandle) |
| | Reload every provider from a live SWMM engine. Walks swmm_control_count + _get_rule + _get_id. Rules whose text has no parseable RULE <name> header (engine returns SWMM_ERR_BADPARAM) get a sentinel name "Rule N [unnamed]" matching the DA.1 convention. Existing providers are cleared before the reload so the registry is a faithful mirror of the engine's current rule list. Returns the number of providers loaded (0 on empty engine).
|
| |
| int | saveToEngine (void *engineHandle) |
| | Push every provider back to the engine via swmm_control_clear_rules + a swmm_control_add_rule loop. Used by the layer's apply-helpers and by the project-save serialiser.
|
| |
| void | clear () |
| | Drop every provider without touching the engine. Used by loadFromEngine and by project teardown.
|
| |
◆ ControlRuleRegistry()
| openswmmvis::controls::ControlRuleRegistry::ControlRuleRegistry |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ ~ControlRuleRegistry()
| openswmmvis::controls::ControlRuleRegistry::~ControlRuleRegistry |
( |
| ) |
|
|
overridedefault |
◆ clear()
| void openswmmvis::controls::ControlRuleRegistry::clear |
( |
| ) |
|
Drop every provider without touching the engine. Used by loadFromEngine and by project teardown.
◆ create()
| ControlRuleProvider * openswmmvis::controls::ControlRuleRegistry::create |
( |
const QString & |
name, |
|
|
const QString & |
body |
|
) |
| |
Create + own a new provider with the given name + body. Returns the new provider, or nullptr if the name collides. Does NOT push to the engine — the layer's apply-helpers do that.
◆ findByName()
| ControlRuleProvider * openswmmvis::controls::ControlRuleRegistry::findByName |
( |
const QString & |
name | ) |
const |
◆ hasName()
| bool openswmmvis::controls::ControlRuleRegistry::hasName |
( |
const QString & |
name | ) |
const |
|
inline |
◆ loadFromEngine()
| int openswmmvis::controls::ControlRuleRegistry::loadFromEngine |
( |
void * |
engineHandle | ) |
|
Reload every provider from a live SWMM engine. Walks swmm_control_count + _get_rule + _get_id. Rules whose text has no parseable RULE <name> header (engine returns SWMM_ERR_BADPARAM) get a sentinel name "Rule N [unnamed]" matching the DA.1 convention. Existing providers are cleared before the reload so the registry is a faithful mirror of the engine's current rule list. Returns the number of providers loaded (0 on empty engine).
◆ providerAboutToBeRemoved
◆ providerAdded
◆ providerCount()
| int openswmmvis::controls::ControlRuleRegistry::providerCount |
( |
| ) |
const |
|
inlinenoexcept |
◆ providerRenamed
◆ providers()
| QVector< ControlRuleProvider * > openswmmvis::controls::ControlRuleRegistry::providers |
( |
| ) |
const |
|
inline |
◆ remove()
Remove a provider from the registry (no engine touch — the layer does that via applyControlRuleRemove).
◆ rename()
| bool openswmmvis::controls::ControlRuleRegistry::rename |
( |
ControlRuleProvider * |
p, |
|
|
const QString & |
newName |
|
) |
| |
Rename a provider with uniqueness check. Returns false on collision (case-insensitive) or empty name.
◆ saveToEngine()
| int openswmmvis::controls::ControlRuleRegistry::saveToEngine |
( |
void * |
engineHandle | ) |
|
Push every provider back to the engine via swmm_control_clear_rules + a swmm_control_add_rule loop. Used by the layer's apply-helpers and by the project-save serialiser.
The documentation for this class was generated from the following files: