Loading...
Searching...
No Matches
Public Member Functions | List of all members
ScopedValueSetter< ValueType > Class Template Reference

Helper class providing an RAII-based mechanism for temporarily setting and then re-setting a value. More...

#include <juce_ScopedValueSetter.h>

Public Member Functions

 ScopedValueSetter (ValueType &valueToSet, ValueType newValue)
 Creates a ScopedValueSetter that will immediately change the specified value to the given new value, and will then reset it to its original value when this object is deleted.
 
 ScopedValueSetter (ValueType &valueToSet, ValueType newValue, ValueType valueWhenDeleted)
 Creates a ScopedValueSetter that will immediately change the specified value to the given new value, and will then reset it to be valueWhenDeleted when this object is deleted.
 
 ~ScopedValueSetter ()
 

Detailed Description

template<typename ValueType>
class ScopedValueSetter< ValueType >

Helper class providing an RAII-based mechanism for temporarily setting and then re-setting a value.

E.g.

int x = 1;
{
// x is now 2
}
// x is now 1 again
{
// x is now 3
}
// x is now 4
Helper class providing an RAII-based mechanism for temporarily setting and then re-setting a value.
Definition juce_ScopedValueSetter.h:70
Helper class for using linear interpolation between a begin and an end value.
Definition juce_StaticAnimationLimits.h:77
float x
Definition juce_UnityPluginInterface.h:200

Constructor & Destructor Documentation

◆ ScopedValueSetter() [1/2]

Creates a ScopedValueSetter that will immediately change the specified value to the given new value, and will then reset it to its original value when this object is deleted.

◆ ScopedValueSetter() [2/2]

template<typename ValueType >
ScopedValueSetter< ValueType >::ScopedValueSetter ( ValueType & valueToSet,
ValueType newValue,
ValueType valueWhenDeleted )

Creates a ScopedValueSetter that will immediately change the specified value to the given new value, and will then reset it to be valueWhenDeleted when this object is deleted.

◆ ~ScopedValueSetter()


The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram