58 template <
typename Type>
93 UndoManager* undoManager,
const Type& defaultToUse);
101 operator Type() const noexcept {
return cachedValue; }
106 Type
get()
const noexcept {
return cachedValue; }
119 template <
typename OtherType>
120 bool operator== (
const OtherType& other)
const {
return cachedValue == other; }
125 template <
typename OtherType>
126 bool operator!= (
const OtherType& other)
const {
return cachedValue != other; }
158 void setDefault (
const Type& value) { defaultValue = value; }
197 Type getTypedValue()
const;
199 void valueTreePropertyChanged (
ValueTree& changedTree,
const Identifier& changedProperty)
override;
208 template <
typename Type>
211 template <
typename Type>
213 : targetTree (v), targetProperty (i), undoManager (um),
214 defaultValue(), cachedValue (getTypedValue())
219 template <
typename Type>
221 : targetTree (v), targetProperty (i), undoManager (um),
222 defaultValue (defaultToUse), cachedValue (getTypedValue())
227 template <
typename Type>
233 template <
typename Type>
239 template <
typename Type>
246 template <
typename Type>
251 cachedValue = newValue;
256 template <
typename Type>
262 template <
typename Type>
269 template <
typename Type>
272 referToWithDefault (v, i, um, Type());
275 template <
typename Type>
278 referToWithDefault (v, i, um, defaultVal);
281 template <
typename Type>
284 cachedValue = getTypedValue();
287 template <
typename Type>
294 defaultValue = defaultVal;
295 cachedValue = getTypedValue();
299 template <
typename Type>
308 template <
typename Type>
311 if (changedProperty == targetProperty && targetTree == changedTree)
void setDefault(const Type &value)
Type * operator->() noexcept
void addListener(Listener *listener)
Value getPropertyAsValue()
Value getPropertyAsValue(const Identifier &name, UndoManager *undoManager, bool shouldUpdateSynchronously=false)
CachedValue & operator=(const Type &newValue)
void referTo(ValueTree &tree, const Identifier &property, UndoManager *um)
void setValue(const Type &newValue, UndoManager *undoManagerToUse)
bool isUsingDefault() const
void removeListener(Listener *listener)
bool operator!=(const OtherType &other) const
Type & operator*() noexcept
const Identifier & getPropertyID() const noexcept
ValueTree & setProperty(const Identifier &name, const var &newValue, UndoManager *undoManager)
ValueTree & getValueTree() noexcept
const var * getPropertyPointer(const Identifier &name) const noexcept
void removeProperty(const Identifier &name, UndoManager *undoManager)
bool operator==(const OtherType &other) const
UndoManager * getUndoManager() noexcept
bool hasProperty(const Identifier &name) const noexcept
void forceUpdateOfCachedValue()