![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Process-wide dispatch table from editor kind → factory. More...
#include <propertyeditorregistry.h>
Public Types | |
| using | Factory = std::function< std::unique_ptr< IPropertyEditor >()> |
Public Member Functions | |
| void | registerFactory (const QString &kind, Factory factory) |
Register a factory for an editor kind. Idempotent on the same (kind, factory) pair; replacing an existing factory with a different callable issues a qWarning and accepts the new one (deterministic for unit tests; concrete editor slices should not double-register). | |
| bool | hasFactory (const QString &kind) const |
True when at least one factory is registered for kind. | |
| std::unique_ptr< IPropertyEditor > | create (const QString &kind) const |
Build a fresh editor instance for kind, or nullptr if no factory is registered. Callers are responsible for wiring the editor to a concrete SWMMObjectRef via IPropertyEditor::editorForObject. | |
| void | clear () |
| Drop every registration. Test-only helper. | |
Static Public Member Functions | |
| static PropertyEditorRegistry & | instance () |
| Access the singleton. | |
Process-wide dispatch table from editor kind → factory.
Construction is private; callers go through instance(). The factory signature returns std::unique_ptr<IPropertyEditor> so ownership is explicit at the call site (PropertiesPanel holds the editor for the lifetime of the current selection).
| using PropertyEditorRegistry::Factory = std::function<std::unique_ptr<IPropertyEditor>()> |
| void PropertyEditorRegistry::clear | ( | ) |
Drop every registration. Test-only helper.
| std::unique_ptr< IPropertyEditor > PropertyEditorRegistry::create | ( | const QString & | kind | ) | const |
Build a fresh editor instance for kind, or nullptr if no factory is registered. Callers are responsible for wiring the editor to a concrete SWMMObjectRef via IPropertyEditor::editorForObject.
| bool PropertyEditorRegistry::hasFactory | ( | const QString & | kind | ) | const |
True when at least one factory is registered for kind.
|
static |
Access the singleton.
| void PropertyEditorRegistry::registerFactory | ( | const QString & | kind, |
| Factory | factory | ||
| ) |
Register a factory for an editor kind. Idempotent on the same (kind, factory) pair; replacing an existing factory with a different callable issues a qWarning and accepts the new one (deterministic for unit tests; concrete editor slices should not double-register).