class

TAttribute

Module
Arc
Header
#include "Arc/Core/TAttribute.h"
Namespace
Arcf
Template
template<typename T>

Type aliases

AliasDescription
using GetterFunc = std::function<T()>

Constructors

SignatureNameDescription
TAttribute() : m_valueTAttribute
TAttribute(const T& value) : m_value(value), m_isSet(true), m_isBound(false)TAttribute
TAttribute(T&& value) : m_value(std::move(value)), m_isSet(true), m_isBound(fals…TAttribute
template<typename F, typename = std::enable_if_t<std::is_invocable_r<T, F>::valu…TAttribute
TAttribute(const TAttribute& other) : m_value(other.m_value), m_getter(other.m_g…TAttributeThe owner belongs to the storage location, not to the value: copies never inherit it and assignment keeps the destination's owner, so the ubiquitous m_attr = args._Attr inside Construct cannot unhook it.
TAttribute(TAttribute&& other) noexcept : m_value(std::move(other.m_value)), m_g…TAttribute

Public functions

ReturnsNameDescription
m_isSet
TAttribute&operator=
TAttribute&operator=
TAttributeCreateLambda
TGetGet the value (evaluates lambda if bound)
voidSetSet a static value (unbinds any lambda)
voidSetIfUnboundThe write a widget makes to its own attribute while the user edits it (a keystroke, a scrub, a toggle).
voidBind
boolIsSetTrue for a plain value as well as a binding
boolIsBound
voidSetOwner
AWidget*GetOwner
boolPollForChangeRe-evaluates a bound getter and reports whether the produced value differs from the one seen at the previous poll.
boolPollAndInvalidatePollForChange plus owner invalidation.
boolPollAndInvalidatePaintPollForChange plus a paint-only invalidation, for an attribute the body paints from but never measures against — a colour, a radius.
operatorT

Function details

TAttribute

C++
TAttribute() : m_value

TAttribute

C++
TAttribute(const T& value) : m_value(value), m_isSet(true), m_isBound(false)

TAttribute

C++
TAttribute(T&& value) : m_value(std::move(value)), m_isSet(true), m_isBound(false)

TAttribute

C++
template<typename F, typename = std::enable_if_t<std::is_invocable_r<T, F>::value && !std::is_same<std::decay_t<F>, TAttribute<T>>::value>> TAttribute(F&& getter) : m_getter(std::forward<F>(getter)), m_isSet(true), m_isBound(true)

TAttribute

C++
TAttribute(const TAttribute& other) : m_value(other.m_value), m_getter(other.m_getter), m_isSet(other.m_isSet), m_isBound(other.m_isBound)

The owner belongs to the storage location, not to the value: copies never inherit it and assignment keeps the destination's owner, so the ubiquitous m_attr = args._Attr inside Construct cannot unhook it.

TAttribute

C++
TAttribute(TAttribute&& other) noexcept : m_value(std::move(other.m_value)), m_getter(std::move(other.m_getter)), m_isSet(other.m_isSet), m_isBound(other.m_isBound)

m_isSet

C++
m_isSet(false), m_isBound(false)

operator=

C++
TAttribute& operator=(const TAttribute& other)

operator=

C++
TAttribute& operator=(TAttribute&& other) noexcept

CreateLambda

C++
static TAttribute CreateLambda(GetterFunc getter)

Get

C++
T Get() const

Get the value (evaluates lambda if bound)

Set

C++
void Set(const T& value)

Set a static value (unbinds any lambda)

SetIfUnbound

C++
void SetIfUnbound(const T& value)

The write a widget makes to its own attribute while the user edits it (a keystroke, a scrub, a toggle). A bound attribute belongs to whoever bound it — they hear the edit through the widget's change delegate and the getter reports the result — so the write is skipped instead of replacing the getter with a frozen copy. Using Set here cut the details panel's live binding on the first edit.

Bind

C++
void Bind(GetterFunc getter)

IsSet

C++
bool IsSet() const

True for a plain value as well as a binding

IsBound

C++
bool IsBound() const

SetOwner

C++
void SetOwner(AWidget* owner)

GetOwner

C++
AWidget* GetOwner() const

PollForChange

C++
bool PollForChange()

Re-evaluates a bound getter and reports whether the produced value differs from the one seen at the previous poll. A T without operator== always reports a change, so a bound attribute can never silently stop updating just because its type is not comparable.

PollAndInvalidate

C++
bool PollAndInvalidate()

PollForChange plus owner invalidation. Returns true when it fired.

PollAndInvalidatePaint

C++
bool PollAndInvalidatePaint()

PollForChange plus a paint-only invalidation, for an attribute the body paints from but never measures against — a colour, a radius.

operatorT

C++
operator T() const
Generated from Arc/Core/TAttribute.h via arc.json · Nov 5, 2026Version 1.0.0