Audacity 3.2.0
Public Member Functions | List of all members
DoubleSetting Class Referencefinal

Specialization of Setting for double. More...

#include <Prefs.h>

Inheritance diagram for DoubleSetting:
[legend]
Collaboration diagram for DoubleSetting:
[legend]

Public Member Functions

 Setting (const SettingBase &path, const T &defaultValue)
 Usual overload supplies a default value. More...
 
 Setting (const SettingBase &path, DefaultValueFunction function)
 This overload causes recomputation of the default each time it is needed. More...
 
- Public Member Functions inherited from Setting< double >
 Setting (const SettingBase &path, const double &defaultValue)
 Usual overload supplies a default value. More...
 
 Setting (const SettingBase &path, DefaultValueFunction function)
 This overload causes recomputation of the default each time it is needed. More...
 
const double & GetDefault () const
 
bool Read (double *pVar) const
 overload of Read returning a boolean that is true if the value was previously defined *‍/ More...
 
double Read () const
 overload of Read, always returning a value More...
 
bool ReadWithDefault (double *pVar, const double &defaultValue) const
 overload of ReadWithDefault returning a boolean that is true if the value was previously defined *‍/ More...
 
double ReadWithDefault (const double &defaultValue) const
 new direct use is discouraged but it may be needed in legacy code More...
 
bool Write (const double &value)
 Write value to config and return true if successful. More...
 
bool Reset ()
 Reset to the default value. More...
 
void Invalidate () override
 
- Public Member Functions inherited from CachingSettingBase< double >
 CachingSettingBase (const SettingBase &path)
 
- Public Member Functions inherited from TransactionalSettingBase
virtual void Invalidate ()=0
 
 SettingBase (const char *path)
 
 SettingBase (const wxChar *path)
 
 SettingBase (const wxString &path)
 
 SettingBase (const SettingBase &)=default
 
- Public Member Functions inherited from SettingBase
 SettingBase (const char *path)
 
 SettingBase (const wxChar *path)
 
 SettingBase (const wxString &path)
 
audacity::BasicSettingsGetConfig () const
 
const SettingPathGetPath () const
 
bool Delete ()
 Delete the key if present, and return true iff it was. More...
 

Additional Inherited Members

- Public Types inherited from Setting< double >
using ValueType = double
 
using DefaultValueFunction = std::function< double() >
 
- Protected Member Functions inherited from Setting< double >
bool DoWrite ()
 Write cached value to config and return true if successful. More...
 
- Protected Member Functions inherited from CachingSettingBase< double >
 CachingSettingBase (const CachingSettingBase &)=default
 
virtual void EnterTransaction (size_t depth)=0
 
virtual bool Commit ()=0
 
virtual void Rollback () noexcept=0
 
- Protected Member Functions inherited from SettingBase
 SettingBase (const SettingBase &)=default
 
- Protected Attributes inherited from Setting< double >
const DefaultValueFunction mFunction
 
double mDefaultValue
 
std::vector< double > mPreviousValues
 
- Protected Attributes inherited from CachingSettingBase< double >
double mCurrentValue
 
bool mValid
 
- Protected Attributes inherited from SettingBase
const SettingPath mPath
 

Detailed Description

Specialization of Setting for double.

Definition at line 362 of file Prefs.h.

Member Function Documentation

◆ Setting() [1/2]

Setting< T >::Setting ( const SettingBase path,
const T &  defaultValue 
)
inline

Usual overload supplies a default value.

Definition at line 187 of file Prefs.h.

189 , mDefaultValue{ defaultValue }
190 {}
Class template adds an in-memory cache of a value to TransactionalSettingBase and support for Setting...
Definition: Prefs.h:162
double mDefaultValue
Definition: Prefs.h:340

◆ Setting() [2/2]

Setting< T >::Setting ( const SettingBase path,
DefaultValueFunction  function 
)
inline

This overload causes recomputation of the default each time it is needed.

Definition at line 193 of file Prefs.h.

195 , mFunction{ function }
196 {}
const DefaultValueFunction mFunction
Definition: Prefs.h:339

The documentation for this class was generated from the following file: