DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
DekiEditorInternal::EditorRegistry Class Reference

Collects the editor factories that static initializers register when a DLL loads. More...

#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/EditorRegistry.h>

Public Member Functions

void AddFactory (DekiEditor::EditorExtension *prototype, std::function< std::unique_ptr< DekiEditor::EditorExtension >()> factory)
 Adds a factory, with a static prototype used for metadata.
const std::vector< EditorFactoryInfo > & GetAllFactories () const
size_t GetTotalCount () const
void Clear ()
 Removes every factory. Must be called before package DLLs unload.
void TrimTo (size_t count)
 Removes every factory after the first count.

Static Public Member Functions

static EditorRegistry & Instance ()

Detailed Description

Collects the editor factories that static initializers register when a DLL loads.

The engine exports functions to walk this list, and the editor creates a fresh instance per component so no state goes stale.

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

Adds a factory, with a static prototype used for metadata.

◆ GetAllFactories()

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

◆ GetTotalCount()

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

◆ Clear()

void DekiEditorInternal::EditorRegistry::Clear ( )
inline

Removes every factory. Must be called before package DLLs unload.

◆ TrimTo()

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

Removes every factory after the first count.

Entries are added in DLL load order, so a count taken before a DLL loaded marks where its registrations begin. Trimming to it removes that DLL's entries and keeps those of packages loaded earlier, which Clear() would lose for good (their static registrars do not run again without a DLL reload).

MUST run while the owning DLL is still loaded. A std::function points at 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. Always trim, then unload.


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