EntropyEngine::Core::Debug::DebugRegistry
EntropyEngine::Core::Debug::DebugRegistry
Section titled “EntropyEngine::Core::Debug::DebugRegistry”Registry for runtime object tracking and discovery. More…
#include <Debug.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| void | unregisterObject(const INamed * object) Remove an object from tracking. |
| void | registerObject(const INamed * object, std::string_view typeName) Add an object to the registry. |
| void | logAllObjects() const Dump the entire registry to the log. |
| DebugRegistry & | getInstance() |
| std::vector< const INamed * > | findByType(std::string_view typeName) const Find all objects of a specific type. |
| std::vector< const INamed * > | findByName(std::string_view name) const Search for all objects with a specific name. |
Detailed Description
Section titled “Detailed Description”class EntropyEngine::Core::Debug::DebugRegistry;Registry for runtime object tracking and discovery.
Tracks INamed objects with their types, names, and creation times. Thread-safe. Useful for debugging lifecycle issues and leak detection.
// Find all WorkGraphsauto graphs = DebugRegistry::getInstance().findByType("WorkGraph");LOG_INFO("Found {} active WorkGraphs", graphs.size());
// Find a specific objectauto results = DebugRegistry::getInstance().findByName("MainMenuUI");if (!results.empty()) { LOG_INFO("MainMenuUI is at {}", results[0]);}Public Functions Documentation
Section titled “Public Functions Documentation”function unregisterObject
Section titled “function unregisterObject”inline void unregisterObject( const INamed * object)Remove an object from tracking.
Parameters:
- object The object to stop tracking
Must be called before object destruction to avoid dangling pointers.
function registerObject
Section titled “function registerObject”inline void registerObject( const INamed * object, std::string_view typeName)Add an object to the registry.
Parameters:
- object The object to track (must outlive the registration)
- typeName Human-readable type name for grouping
Registry holds non-owning pointers - unregister before destruction.
function logAllObjects
Section titled “function logAllObjects”inline void logAllObjects() constDump the entire registry to the log.
Outputs all registered objects grouped by type. Can be verbose!
Output format:
=== Registered Debug Objects (42) ===WorkGraph (3 instances): - 'MainGraph' at 0x7fff12345678 - 'UIGraph' at 0x7fff87654321 - 'AudioGraph' at 0x7fff11111111EventBus (15 instances): ...function getInstance
Section titled “function getInstance”static inline DebugRegistry & getInstance()function findByType
Section titled “function findByType”inline std::vector< const INamed * > findByType( std::string_view typeName) constFind all objects of a specific type.
Parameters:
- typeName The type name used during registration
Return: Vector of all objects of this type
Useful for counting active instances or type-specific debugging.
function findByName
Section titled “function findByName”inline std::vector< const INamed * > findByName( std::string_view name) constSearch for all objects with a specific name.
Parameters:
- name The name to search for
Return: Vector of matching object pointers
Names can be non-unique. Returns all exact matches.
Updated on 2026-01-26 at 16:50:32 -0500