Ion
|
A generic field that represents some state in the resource. More...
#include "resourceholder.h"
Public Member Functions | |
Field (const int change_bit, const T &initial_value, ResourceHolder *holder) | |
Field (const Field &other) | |
~Field () override | |
virtual bool | IsValid (const T &value) |
Checks if a proposed value is valid. More... | |
const T & | Get () const |
Gets a const version of the current value. More... | |
T * | GetMutable () |
Gets an editable version of the current value. More... | |
bool | Set (const T &value) |
Sets the value of the Field if it is valid and tells the resource what has changed. More... | |
int | GetBit () const |
Get the change bit. More... | |
Protected Member Functions | |
void | OnChanged () |
void | OnChanged (const int bit) |
Trigger a change for a specific bit. More... | |
A generic field that represents some state in the resource.
When the Field value changes, it tells the resource that something has changed.
Definition at line 138 of file resourceholder.h.
|
inline |
Definition at line 140 of file resourceholder.h.
|
inline |
Definition at line 144 of file resourceholder.h.
|
inlineoverride |
Definition at line 148 of file resourceholder.h.
|
inline |
Gets a const version of the current value.
Definition at line 157 of file resourceholder.h.
|
inlineinherited |
Get the change bit.
Definition at line 102 of file resourceholder.h.
|
inline |
Gets an editable version of the current value.
Since the caller could do anything with the reference, also notify the resource.
Definition at line 161 of file resourceholder.h.
|
inlinevirtual |
Checks if a proposed value is valid.
Descendant classes can override this to provide validation (e.g. range checking).
Reimplemented in ion::gfx::ResourceHolder::RangedField< T >.
Definition at line 152 of file resourceholder.h.
|
inlineprotectedinherited |
Definition at line 113 of file resourceholder.h.
|
inlineprotectedinherited |
Trigger a change for a specific bit.
Definition at line 121 of file resourceholder.h.
|
inline |
Sets the value of the Field if it is valid and tells the resource what has changed.
If the value is not valid, an error message is logged. Returns whether the set occurred.
Definition at line 169 of file resourceholder.h.