TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::ElementDataStore Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ ElementDataStore() [1/2]

tachyon::ElementDataStore::ElementDataStore ( )
default

◆ ElementDataStore() [2/2]

tachyon::ElementDataStore::ElementDataStore ( const ElementDataStore & )
delete

Member Function Documentation

◆ operator=()

ElementDataStore & tachyon::ElementDataStore::operator= ( const ElementDataStore & )
delete

◆ Touch()

void tachyon::ElementDataStore::Touch ( ID id)

Keeps id's entry alive through this frame's EndFrame.

◆ Remove()

void tachyon::ElementDataStore::Remove ( ID id)

◆ Clear()

void tachyon::ElementDataStore::Clear ( )

◆ BeginFrame()

void tachyon::ElementDataStore::BeginFrame ( )

Starts a frame; call before any Get, GetOrCreate or Touch of the frame.

◆ EndFrame()

void tachyon::ElementDataStore::EndFrame ( )

Destroys the entries not touched since BeginFrame.

◆ EntryCount()

size_t tachyon::ElementDataStore::EntryCount ( ) const
inline

The documentation for this class was generated from the following file: