DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
Loading...
Searching...
No Matches
Deki::ComponentInterfaceAdapters Namespace Reference

Functions

InterfaceAdapter Find (uint32_t interfaceId, ComponentType componentType, ComponentType baseType)
 The adapter Query would call for a component of this type (exact type first, then its base type), or nullptr.
void * Query (uint32_t interfaceId, Component *comp)
 The interface interfaceId of comp, or nullptr when it has none.
void Register (uint32_t interfaceId, ComponentType componentType, InterfaceAdapter adapter)
 Registers adapter as the way to get interface interfaceId from a component of type componentType.
uint32_t Version ()
 Goes up with every Register.

Function Documentation

◆ Find()

InterfaceAdapter Deki::ComponentInterfaceAdapters::Find ( uint32_t interfaceId,
ComponentType componentType,
ComponentType baseType )

The adapter Query would call for a component of this type (exact type first, then its base type), or nullptr.

A caller can cache it per component type instead of looking it up per component per frame; look again whenever Version() changes.

◆ Query()

void * Deki::ComponentInterfaceAdapters::Query ( uint32_t interfaceId,
Component * comp )

The interface interfaceId of comp, or nullptr when it has none.

◆ Register()

void Deki::ComponentInterfaceAdapters::Register ( uint32_t interfaceId,
ComponentType componentType,
InterfaceAdapter adapter )

Registers adapter as the way to get interface interfaceId from a component of type componentType.

◆ Version()

uint32_t Deki::ComponentInterfaceAdapters::Version ( )

Goes up with every Register.

A cache of adapters (the renderer keeps one per component type) compares it to notice adapters registered later, such as by a package that loaded after the cache was filled.