Skip to content

EntropyEngine::Core::Debug::DebugRegistry

Registry for runtime object tracking and discovery. More…

#include <Debug.h>

Name
voidunregisterObject(const INamed * object)
Remove an object from tracking.
voidregisterObject(const INamed * object, std::string_view typeName)
Add an object to the registry.
voidlogAllObjects() 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.
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 WorkGraphs
auto graphs = DebugRegistry::getInstance().findByType("WorkGraph");
LOG_INFO("Found {} active WorkGraphs", graphs.size());
// Find a specific object
auto results = DebugRegistry::getInstance().findByName("MainMenuUI");
if (!results.empty()) {
LOG_INFO("MainMenuUI is at {}", results[0]);
}
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.

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.

inline void logAllObjects() const

Dump 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 0x7fff11111111
EventBus (15 instances):
...
static inline DebugRegistry & getInstance()
inline std::vector< const INamed * > findByType(
std::string_view typeName
) const

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

inline std::vector< const INamed * > findByName(
std::string_view name
) const

Search 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