UIValueService.h file
Value service: typed arithmetic for value widgets (toggle, slider, number).
A value widget edits its value in the value's own type. Stepping, clamping and snapping are done in that type, so an int never round-trips through float and a Fixed32 goes back to its source bit for bit.
ValueService<T> holds the arithmetic per type. The core stores every value type-erased (ValueBits) next to its ops table (ValueOps) and calls through that; it never switches on a kind at run time.
Supported: bool, int32_t, int64_t, float, double, Fixed32.
Namespaces
- namespace GGUI
Classes
- struct GGUI::ValueBits
- Type-erased value storage. Only the matching ValueService reads it.
- struct GGUI::ValueOps
- Per-type operations, as the core calls them.
-
template<ValueType T>struct GGUI::ValueService
- The arithmetic for
T:its ops table, and its values in and out of ValueBits. Specialised for each ValueType in ValueService.cpp. - struct GGUI::GGValue
- A typed value handed to code outside the UI (FieldSource::
SetValue).