Skip to content

EntropyCanvas::ComponentSchemaService

Service for managing component schema lifecycle and caching. More…

#include <ComponentSchemaService.h>

Inherits from EntropyEngine::Core::EntropyService, EntropyEngine::Core::EntropyObject

Name
~ComponentSchemaService() override =default
virtual const char *version() const override
virtual voidunload() override
virtual EntropyEngine::Core::TypeSystem::TypeIDtypeId() const override
virtual voidstop() override
virtual voidstart() override
size_tschemaCount() const
Get number of registered schemas.
EntropyEngine::Networking::ComponentSchemaRegistry *registry()
Get the underlying registry for low-level access.
const EntropyEngine::Networking::ComponentSchemaRegistry *registry() const
boolregisterSchema(const EntropyEngine::Networking::ComponentSchema & schema)
Register a schema (returns false if hash already exists).
ComponentSchemaService &operator=(const ComponentSchemaService & ) =delete
virtual const char *name() const override
virtual voidload() override
virtual const char *id() const override
boolhasSchema(const EntropyEngine::Networking::ComponentTypeHash & hash) const
Check if a schema is registered.
std::optional< EntropyEngine::Networking::ComponentSchema >getSchema(const EntropyEngine::Networking::ComponentTypeHash & hash) const
Lookup schema by hash - THE only way.
EntropyEngine::Networking::ComponentTypeHashgetBuiltinHash(ComponentType type) const
Get hash for a builtin component type.
ComponentSchemaService() =default
ComponentSchemaService(const ComponentSchemaService & ) =delete

Public Functions inherited from EntropyEngine::Core::EntropyService

Name
~EntropyService() override =default
ServiceStatestate() const
virtual std::vector< TypeSystem::TypeID >dependsOnTypes() const
virtual std::vector< std::string >dependsOn() const
virtual const char *className() const override
Runtime class name for diagnostics and reflection.

Protected Functions inherited from EntropyEngine::Core::EntropyService

Name
voidsetState(ServiceState s)

Friends inherited from EntropyEngine::Core::EntropyService

Name
classEntropyServiceRegistry

Protected Classes inherited from EntropyEngine::Core::EntropyObject

Name
structHandleCore
Optional handle identity stamped by an owner/registry.

Public Functions inherited from EntropyEngine::Core::EntropyObject

Name
virtual~EntropyObject() =default
virtual const TypeSystem::TypeInfo *typeInfo() const
Optional richer type information; may be null.
booltryRetain() const
Attempts to retain only if the object is still alive.
virtual std::stringtoString() const
Human-readable short string (class@ptr by default).
voidretain() const
Increments the reference count.
voidrelease() const
Decrements the reference count and deletes when it reaches zero.
uint32_trefCount() const
Current reference count (approximate under contention).
boolhasHandle() const
template <class OwnerT >
OwnerT *
handleOwnerAs() const
Returns the stamped owner pointer cast to the requested type.
const void *handleOwner() const
uint32_thandleIndex() const
uint64_thandleId() const
uint32_thandleGeneration() const
WeakControlBlock *getWeakControlBlock() const
Lazily retrieves or creates the weak control block.
virtual std::stringdescription() const
Long-form description; defaults to toString().
virtual std::stringdebugString() const
Debug-oriented string including refcount and handle when present.
virtual const char *className() const
Runtime class name for diagnostics and reflection.
virtual uint64_tclassHash() const
Stable type hash for cross-language identification.
EntropyObject() =default
EntropyObject(EntropyObject && ) =delete
EntropyObject(const EntropyObject & ) =delete

Protected Functions inherited from EntropyEngine::Core::EntropyObject

Name
void_setHandleIdentity(void * owner, uint32_t index, uint32_t generation)
void_clearHandleIdentity()

Protected Attributes inherited from EntropyEngine::Core::EntropyObject

Name
std::atomic< WeakControlBlock * >_weakBlock
Lazily allocated control block for weak refs.
std::atomic< uint32_t >_refCount
Thread-safe retain/release counter.
struct EntropyEngine::Core::EntropyObject::HandleCore_handle

Friends inherited from EntropyEngine::Core::EntropyObject

Name
structHandleAccess
class EntropyCanvas::ComponentSchemaService;

Service for managing component schema lifecycle and caching.

All schema lookups MUST go through this service. Schemas are created once during load() and cached by their ComponentTypeHash.

~ComponentSchemaService() override =default
inline virtual const char * version() const override

Reimplements: EntropyEngine::Core::EntropyService::version

virtual void unload() override

Reimplements: EntropyEngine::Core::EntropyService::unload

inline virtual EntropyEngine::Core::TypeSystem::TypeID typeId() const override

Reimplements: EntropyEngine::Core::EntropyService::typeId

inline virtual void stop() override

Reimplements: EntropyEngine::Core::EntropyService::stop

inline virtual void start() override

Reimplements: EntropyEngine::Core::EntropyService::start

inline size_t schemaCount() const

Get number of registered schemas.

inline EntropyEngine::Networking::ComponentSchemaRegistry * registry()

Get the underlying registry for low-level access.

Return: Pointer to owned registry, or nullptr if not loaded

Use this for advanced features like structural hash lookup, public/private filtering, or thread-safe concurrent access.

inline const EntropyEngine::Networking::ComponentSchemaRegistry * registry() const
bool registerSchema(
const EntropyEngine::Networking::ComponentSchema & schema
)

Register a schema (returns false if hash already exists).

Parameters:

  • schema The schema to register

Return: true if registered, false if hash collision

ComponentSchemaService & operator=(
const ComponentSchemaService &
) =delete
inline virtual const char * name() const override

Reimplements: EntropyEngine::Core::EntropyService::name

virtual void load() override

Reimplements: EntropyEngine::Core::EntropyService::load

inline virtual const char * id() const override

Reimplements: EntropyEngine::Core::EntropyService::id

bool hasSchema(
const EntropyEngine::Networking::ComponentTypeHash & hash
) const

Check if a schema is registered.

Parameters:

  • hash Component type hash

Return: true if registered

std::optional< EntropyEngine::Networking::ComponentSchema > getSchema(
const EntropyEngine::Networking::ComponentTypeHash & hash
) const

Lookup schema by hash - THE only way.

Parameters:

  • hash Component type hash

Return: Optional schema if found

EntropyEngine::Networking::ComponentTypeHash getBuiltinHash(
ComponentType type
) const

Get hash for a builtin component type.

Parameters:

  • type Component type enum

Return: Type hash, or null hash if not found

Convenience method for built-in types. Uses internal mapping.

ComponentSchemaService() =default
ComponentSchemaService(
const ComponentSchemaService &
) =delete

Updated on 2026-01-26 at 17:14:35 -0500