Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
DekiEditorInternal::EditorRegistry Class Reference

Internal registry for auto-registered editor extensions. More...

#include <EditorRegistry.h>

Public Member Functions

void AddFactory (DekiEditor::EditorExtension *prototype, std::function< std::unique_ptr< DekiEditor::EditorExtension >()> factory)
 Add an editor factory (preferred method).
const std::vector< EditorFactoryInfo > & GetAllFactories () const
 Get all factory infos.
size_t GetTotalCount () const
 Get total count of registered factories.
void Clear ()
 Clear all factories (must be called before package DLLs are unloaded).
void TrimTo (size_t count)
 Drop every factory registered after the first count, keeping the earlier ones untouched.

Static Public Member Functions

static EditorRegistry & Instance ()

Detailed Description

Internal registry for auto-registered editor extensions.

This registry collects editor factories at DLL load time via static initializers. The engine exports functions to iterate this list, and the editor can create fresh instances per-component to avoid stale state issues.

Member Function Documentation

◆ Instance()

EditorRegistry & DekiEditorInternal::EditorRegistry::Instance ( )
static

◆ AddFactory()

void DekiEditorInternal::EditorRegistry::AddFactory ( DekiEditor::EditorExtension * prototype,
std::function< std::unique_ptr< DekiEditor::EditorExtension >()> factory )
inline

Add an editor factory (preferred method).

Parameters
prototypeStatic instance for metadata queries
factoryFunction that creates new instances

◆ GetAllFactories()

const std::vector< EditorFactoryInfo > & DekiEditorInternal::EditorRegistry::GetAllFactories ( ) const
inline

Get all factory infos.

◆ GetTotalCount()

size_t DekiEditorInternal::EditorRegistry::GetTotalCount ( ) const
inline

Get total count of registered factories.

◆ Clear()

void DekiEditorInternal::EditorRegistry::Clear ( )
inline

Clear all factories (must be called before package DLLs are unloaded).

◆ TrimTo()

void DekiEditorInternal::EditorRegistry::TrimTo ( size_t count)
inline

Drop every factory registered after the first count, keeping the earlier ones untouched.

Entries are appended in DLL load order, so a count taken before a DLL was loaded marks exactly where that DLL's registrations begin. Trimming back to it removes one DLL's entries without disturbing the packages loaded before it, which a blunt Clear() would also destroy (their static registrars never rerun without a DLL reload).

MUST run while the owning DLL is still loaded. A std::function carries a pointer to manager code inside the DLL that created it, and that code runs on COPY and on DESTRUCTION alike — so after FreeLibrary even discarding the entry faults, and there is no way to recover. This is the only safe order: trim, then unload.


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