Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Raven::TypeRegistry Class Reference

Global runtime type registry for Raven Engine. More...

#include <Type.h>

Public Types

using TypeStorage = std::unordered_map<TypeID, TypeData>

Public Member Functions

template<typename T>
constexpr void RegisterType ()
 Registers a type T with the registry if not already present.
TypeDataGetTypeData (const TypeID &id)
 Retrieves type metadata by ID.
const bool IsTypeRegistered (const TypeID &id) const noexcept
 Checks if a type is registered.
TypeStorageGetStorage () noexcept

Static Public Member Functions

static TypeRegistryGet ()
 Singleton access to the TypeRegistry.

Detailed Description

Global runtime type registry for Raven Engine.

Acts as a global runtime registry mapping TypeID values to TypeData metadata. Types are registered either explicitly or via static initialization helpers.

Registration is idempotent: registering the same type multiple times has no effect. This behavior is intentional to support registration across multiple translation units.

Note
  • The registry is not thread-safe.
  • All registrations must complete before concurrent access.
  • Static initialization order across translation units is unspecified.

Member Typedef Documentation

◆ TypeStorage

using Raven::TypeRegistry::TypeStorage = std::unordered_map<TypeID, TypeData>

Member Function Documentation

◆ Get()

TypeRegistry & Raven::TypeRegistry::Get ( )
inlinestatic

Singleton access to the TypeRegistry.

Returns
Reference to the global TypeRegistry instance.

◆ GetStorage()

TypeStorage & Raven::TypeRegistry::GetStorage ( )
inlinenoexcept

◆ GetTypeData()

TypeData & Raven::TypeRegistry::GetTypeData ( const TypeID & id)
inline

Retrieves type metadata by ID.

Parameters
idThe unique TypeID.
Returns
Corresponding TypeData.

◆ IsTypeRegistered()

const bool Raven::TypeRegistry::IsTypeRegistered ( const TypeID & id) const
inlinenoexcept

Checks if a type is registered.

Parameters
idThe TypeID to query.
Returns
True if registered, false otherwise.

◆ RegisterType()

template<typename T>
void Raven::TypeRegistry::RegisterType ( )
inlineconstexpr

Registers a type T with the registry if not already present.

Creates a TypeID for T and inserts corresponding TypeData into the registry. If the type has already been registered, the function returns without modifying state.

Template Parameters
TThe type to register.
Note
Although declared constexpr, this function performs runtime operations and is intended to be called during static initialization or early startup.

The documentation for this class was generated from the following file:
  • Engine/src/Raven/Reflection/Type.h