|
TachyonUI 0.1.0
High-performance UI for building tools.
|
Per-element typed state keyed by ID, kept across frames (drag start, double-click timing). More...
#include <gui_core/elements/gui_element_data_store.h>
Public Member Functions | |
| ElementDataStore ()=default | |
| ElementDataStore (const ElementDataStore &)=delete | |
| ElementDataStore & | operator= (const ElementDataStore &)=delete |
| template<typename T, typename... Args> | |
| T & | GetOrCreate (ID id, Args &&... args) |
| The T stored for id, constructed from args when absent. | |
| template<typename T> | |
| T * | Get (ID id) |
| The T stored for id, or nullptr (also on a type mismatch). Touches the entry if found. | |
| void | Touch (ID id) |
| Keeps id's entry alive through this frame's EndFrame. | |
| void | Remove (ID id) |
| void | Clear () |
| void | BeginFrame () |
| Starts a frame; call before any Get, GetOrCreate or Touch of the frame. | |
| void | EndFrame () |
| Destroys the entries not touched since BeginFrame. | |
| size_t | EntryCount () const |
Per-element typed state keyed by ID, kept across frames (drag start, double-click timing).
Get, GetOrCreate and Touch keep an entry alive; EndFrame evicts the rest. GUIStateManager touches the IDs in a live interaction (capture, focus, drag, active), so their state survives frames without events. Types up to 64 bytes are stored inline.
|
default |
|
delete |
|
delete |
| void tachyon::ElementDataStore::Touch | ( | ID | id | ) |
Keeps id's entry alive through this frame's EndFrame.
| void tachyon::ElementDataStore::Remove | ( | ID | id | ) |
| void tachyon::ElementDataStore::Clear | ( | ) |
| void tachyon::ElementDataStore::BeginFrame | ( | ) |
Starts a frame; call before any Get, GetOrCreate or Touch of the frame.
| void tachyon::ElementDataStore::EndFrame | ( | ) |
Destroys the entries not touched since BeginFrame.
|
inline |