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
PropertyEditorRegistry Class Reference

Process-wide dispatch table from editor kind → factory. More...

#include <propertyeditorregistry.h>

Collaboration diagram for PropertyEditorRegistry:

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< IPropertyEditorcreate (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 PropertyEditorRegistryinstance ()
 Access the singleton.
 

Detailed Description

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

Member Typedef Documentation

◆ Factory

using PropertyEditorRegistry::Factory = std::function<std::unique_ptr<IPropertyEditor>()>

Member Function Documentation

◆ clear()

void PropertyEditorRegistry::clear ( )

Drop every registration. Test-only helper.

◆ create()

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.

◆ hasFactory()

bool PropertyEditorRegistry::hasFactory ( const QString &  kind) const

True when at least one factory is registered for kind.

◆ instance()

PropertyEditorRegistry & PropertyEditorRegistry::instance ( )
static

Access the singleton.

◆ registerFactory()

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


The documentation for this class was generated from the following files: