Classes | |
class | CachedValue< Type > |
This class acts as a typed wrapper around a property inside a ValueTree. More... | |
class | Value |
Represents a shared variant value. More... | |
class | Value::Listener |
Receives callbacks when a Value object changes. More... | |
class | Value::ValueSource |
Used internally by the Value class as the base class for its shared value objects. More... | |
class | ValueTree |
A powerful tree structure that can be used to hold free-form data, and which can handle its own undo and redo behaviour. More... | |
struct | ValueTree::Iterator |
Iterator for a ValueTree. More... | |
class | ValueTree::Listener |
Listener class for events that happen to a ValueTree. More... | |
class | ValueTreePropertyWithDefault |
This class acts as a wrapper around a property inside a ValueTree. More... | |
class | ValueTreeSynchroniser |
This class can be used to watch for all changes to the state of a ValueTree, and to convert them to a transmittable binary encoding. More... | |
Functions | |
OutputStream &JUCE_CALLTYPE | operator<< (OutputStream &, const Value &) |
Writes a Value to an OutputStream as a UTF8 string. | |
CachedValue< Type >::CachedValue () | |
Default constructor. | |
CachedValue< Type >::CachedValue (ValueTree &tree, const Identifier &propertyID, UndoManager *undoManager) | |
Constructor. | |
CachedValue< Type >::CachedValue (ValueTree &tree, const Identifier &propertyID, UndoManager *undoManager, const Type &defaultToUse) | |
Constructor. | |
Value | CachedValue< Type >::getPropertyAsValue () |
Returns the current property as a Value object. | |
bool | CachedValue< Type >::isUsingDefault () const |
Returns true if the current property does not exist and the CachedValue is using the fallback default value instead. | |
CachedValue & | CachedValue< Type >::operator= (const Type &newValue) |
Sets the property. | |
void | CachedValue< Type >::setValue (const Type &newValue, UndoManager *undoManagerToUse) |
Sets the property. | |
void | CachedValue< Type >::resetToDefault () |
Removes the property from the referenced ValueTree and makes the CachedValue return the fallback default value instead. | |
void | CachedValue< Type >::resetToDefault (UndoManager *undoManagerToUse) |
Removes the property from the referenced ValueTree and makes the CachedValue return the fallback default value instead. | |
void | CachedValue< Type >::referTo (ValueTree &tree, const Identifier &property, UndoManager *um) |
Makes the CachedValue refer to the specified property inside the given ValueTree. | |
void | CachedValue< Type >::referTo (ValueTree &tree, const Identifier &property, UndoManager *um, const Type &defaultVal) |
Makes the CachedValue refer to the specified property inside the given ValueTree, and specifies a fallback value to use if the property does not exist. | |
void | CachedValue< Type >::forceUpdateOfCachedValue () |
Force an update in case the referenced property has been changed from elsewhere. | |
OutputStream &JUCE_CALLTYPE operator<< | ( | OutputStream & | , |
const Value & | ) |
Writes a Value to an OutputStream as a UTF8 string.
|
default |
Default constructor.
Creates a default CachedValue not referring to any property. To initialise the object, call one of the referTo() methods.
CachedValue< Type >::CachedValue | ( | ValueTree & | tree, |
const Identifier & | propertyID, | ||
UndoManager * | undoManager ) |
Constructor.
Creates a CachedValue referring to a Value property inside a ValueTree. If you use this constructor, the fallback value will be a default-constructed instance of Type.
tree | The ValueTree containing the property |
propertyID | The identifier of the property |
undoManager | The UndoManager to use when writing to the property |
References ValueTree::addListener().
CachedValue< Type >::CachedValue | ( | ValueTree & | tree, |
const Identifier & | propertyID, | ||
UndoManager * | undoManager, | ||
const Type & | defaultToUse ) |
Constructor.
Creates a default Cached Value referring to a Value property inside a ValueTree, and specifies a fallback value to use if the property does not exist.
tree | The ValueTree containing the property |
propertyID | The identifier of the property |
undoManager | The UndoManager to use when writing to the property |
defaultToUse | The fallback default value to use. |
References ValueTree::addListener().
Value CachedValue< Type >::getPropertyAsValue | ( | ) |
Returns the current property as a Value object.
bool CachedValue< Type >::isUsingDefault | ( | ) | const |
Returns true if the current property does not exist and the CachedValue is using the fallback default value instead.
CachedValue< Type > & CachedValue< Type >::operator= | ( | const Type & | newValue | ) |
Sets the property.
This will actually modify the property in the referenced ValueTree.
void CachedValue< Type >::setValue | ( | const Type & | newValue, |
UndoManager * | undoManagerToUse ) |
Sets the property.
This will actually modify the property in the referenced ValueTree.
References exactlyEqual().
void CachedValue< Type >::resetToDefault | ( | ) |
Removes the property from the referenced ValueTree and makes the CachedValue return the fallback default value instead.
void CachedValue< Type >::resetToDefault | ( | UndoManager * | undoManagerToUse | ) |
Removes the property from the referenced ValueTree and makes the CachedValue return the fallback default value instead.
void CachedValue< Type >::referTo | ( | ValueTree & | tree, |
const Identifier & | property, | ||
UndoManager * | um ) |
Makes the CachedValue refer to the specified property inside the given ValueTree.
void CachedValue< Type >::referTo | ( | ValueTree & | tree, |
const Identifier & | property, | ||
UndoManager * | um, | ||
const Type & | defaultVal ) |
Makes the CachedValue refer to the specified property inside the given ValueTree, and specifies a fallback value to use if the property does not exist.
void CachedValue< Type >::forceUpdateOfCachedValue | ( | ) |
Force an update in case the referenced property has been changed from elsewhere.
Note: The CachedValue is a ValueTree::Listener and therefore will be informed of changes of the referenced property anyway (and update itself). But this may happen asynchronously. forceUpdateOfCachedValue() forces an update immediately.