Struct star::KeyRegistry¶
ClassList > star > KeyRegistry
Global key registry using data-oriented design (Structure of Arrays). More...
#include <stards.h>
Public Attributes¶
| Type | Name |
|---|---|
| std::unordered_map< uint64_t, uint16_t > | hash_to_index |
| std::vector< uint64_t > | hashes |
| std::unordered_map< std::string, uint16_t > | name_to_index |
| std::vector< std::string > | names |
Public Functions¶
| Type | Name |
|---|---|
| bool | contains (const std::string & key) const Check if key exists in registry. |
| uint16_t | get_index (const std::string & key) const Get existing key index (throws if not found). |
| uint16_t | get_or_create (const std::string & key) Get or create a key index. |
Detailed Description¶
Stores all unique keys once with precomputed hashes for O(1) lookups. Keys are referenced by uint16 indices throughout the system.
Public Attributes Documentation¶
variable hash_to_index¶
variable hashes¶
variable name_to_index¶
variable names¶
Public Functions Documentation¶
function contains¶
Check if key exists in registry.
function get_index¶
Get existing key index (throws if not found).
Returns:
uint16 index into the registry
function get_or_create¶
Get or create a key index.
Returns:
uint16 index into the registry
The documentation for this class was generated from the following file StarDS/include/stards.h