|
Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
|
Functions | |
| void | Register (uint32_t interfaceId, ComponentType componentType, InterfaceAdapter adapter) |
| void * | Query (uint32_t interfaceId, DekiComponent *comp) |
| 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. | |
| uint32_t | Version () |
| Bumped by every Register. | |
| void ComponentInterfaceAdapters::Register | ( | uint32_t | interfaceId, |
| ComponentType | componentType, | ||
| InterfaceAdapter | adapter ) |
| void * ComponentInterfaceAdapters::Query | ( | uint32_t | interfaceId, |
| DekiComponent * | comp ) |
| InterfaceAdapter 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.
Lets a caller cache the function pointer per component type instead of hashing per component per frame; re-check whenever Version() changes.
| uint32_t ComponentInterfaceAdapters::Version | ( | ) |
Bumped by every Register.
A cache of Query results (the renderer keeps one per component type) compares it to notice adapters registered later, e.g. by a package that loaded after the cache was filled.