SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::controls::ControlRuleRegistry Class Reference

#include <controlruleregistry.h>

Inheritance diagram for openswmmvis::controls::ControlRuleRegistry:
Collaboration diagram for openswmmvis::controls::ControlRuleRegistry:

Signals

void providerAdded (openswmmvis::controls::ControlRuleProvider *provider)
 
void providerAboutToBeRemoved (openswmmvis::controls::ControlRuleProvider *provider)
 
void providerRenamed (openswmmvis::controls::ControlRuleProvider *provider, const QString &prevName, const QString &newName)
 

Public Member Functions

 ControlRuleRegistry (QObject *parent=nullptr)
 
 ~ControlRuleRegistry () override
 
QVector< ControlRuleProvider * > providers () const
 
int providerCount () const noexcept
 
ControlRuleProviderfindByName (const QString &name) const
 
bool hasName (const QString &name) const
 
ControlRuleProvidercreate (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.
 

Constructor & Destructor Documentation

◆ ControlRuleRegistry()

openswmmvis::controls::ControlRuleRegistry::ControlRuleRegistry ( QObject *  parent = nullptr)
explicit

◆ ~ControlRuleRegistry()

openswmmvis::controls::ControlRuleRegistry::~ControlRuleRegistry ( )
overridedefault

Member Function Documentation

◆ clear()

void openswmmvis::controls::ControlRuleRegistry::clear ( )

Drop every provider without touching the engine. Used by loadFromEngine and by project teardown.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findByName()

ControlRuleProvider * openswmmvis::controls::ControlRuleRegistry::findByName ( const QString &  name) const
Here is the caller graph for this function:

◆ hasName()

bool openswmmvis::controls::ControlRuleRegistry::hasName ( const QString &  name) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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).

Here is the call graph for this function:

◆ providerAboutToBeRemoved

void openswmmvis::controls::ControlRuleRegistry::providerAboutToBeRemoved ( openswmmvis::controls::ControlRuleProvider provider)
signal
Here is the caller graph for this function:

◆ providerAdded

void openswmmvis::controls::ControlRuleRegistry::providerAdded ( openswmmvis::controls::ControlRuleProvider provider)
signal
Here is the caller graph for this function:

◆ providerCount()

int openswmmvis::controls::ControlRuleRegistry::providerCount ( ) const
inlinenoexcept

◆ providerRenamed

void openswmmvis::controls::ControlRuleRegistry::providerRenamed ( openswmmvis::controls::ControlRuleProvider provider,
const QString &  prevName,
const QString &  newName 
)
signal
Here is the caller graph for this function:

◆ providers()

QVector< ControlRuleProvider * > openswmmvis::controls::ControlRuleRegistry::providers ( ) const
inline

◆ remove()

void openswmmvis::controls::ControlRuleRegistry::remove ( ControlRuleProvider p)

Remove a provider from the registry (no engine touch — the layer does that via applyControlRuleRemove).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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: