openMSX
Public Member Functions | List of all members
openmsx::FloatSetting Class Referencefinal

A Setting with a floating point value. More...

#include <FloatSetting.hh>

Inheritance diagram for openmsx::FloatSetting:
Inheritance graph
[legend]
Collaboration diagram for openmsx::FloatSetting:
Collaboration graph
[legend]

Public Member Functions

 FloatSetting (CommandController &commandController, std::string_view name, static_string_view description, double initialValue, double minValue, double maxValue)
 
std::string_view getTypeString () const override
 Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an appropriate setting widget.
 
void additionalInfo (TclObject &result) const override
 Helper method for info().
 
double getDouble () const noexcept
 
float getFloat () const noexcept
 
void setDouble (double d)
 
void setFloat (float f)
 
double getMinValue () const
 
double getMaxValue () const
 
- Public Member Functions inherited from openmsx::Setting
 Setting (const Setting &)=delete
 
Settingoperator= (const Setting &)=delete
 
virtual ~Setting ()
 
const TclObjectgetValue () const final
 Gets the current value of this setting as a TclObject.
 
std::optional< TclObjectgetOptionalValue () const final
 Like getValue(), but in case of error returns an empty optional instead of throwing an exception.
 
void setChecker (std::function< void(TclObject &)> checkFunc_)
 Set value-check-callback.
 
void setValue (const TclObject &newValue) final
 Change the value of this setting to the given value.
 
std::string_view getDescription () const final
 pure virtual methods ///
 
TclObject getDefaultValue () const final
 Get the default value of this setting.
 
void setValueDirect (const TclObject &newValue) final
 Similar to setValue(), but doesn't trigger Tcl traces.
 
void tabCompletion (std::vector< std::string > &tokens) const override
 Complete a partly typed value.
 
bool needLoadSave () const final
 Does this setting need to be loaded or saved (settings.xml).
 
void additionalInfo (TclObject &result) const override
 Helper method for info().
 
bool needTransfer () const final
 Does this setting need to be transfered on reverse.
 
CommandControllergetCommandController () const
 
InterpretergetInterpreter () const
 
- Public Member Functions inherited from openmsx::BaseSetting
const TclObjectgetFullNameObj () const
 Get the name of this setting.
 
const TclObjectgetBaseNameObj () const
 
std::string_view getFullName () const
 
std::string_view getBaseName () const
 
void setPrefix (std::string_view prefix)
 Set a machine specific prefix.
 
void info (TclObject &result) const
 For SettingInfo.
 
- Public Member Functions inherited from openmsx::Subject< Setting >
void attach (Observer< Setting > &observer)
 
void detach (Observer< Setting > &observer)
 
bool anyObservers () const
 

Additional Inherited Members

- Public Types inherited from openmsx::Setting
enum  SaveSetting { SAVE , DONT_SAVE , DONT_TRANSFER }
 
- Protected Member Functions inherited from openmsx::Setting
 Setting (CommandController &commandController, std::string_view name, static_string_view description, const TclObject &initialValue, SaveSetting save=SAVE)
 
void init ()
 
void notifyPropertyChange () const
 
- Protected Member Functions inherited from openmsx::BaseSetting
 BaseSetting (std::string_view name)
 
 BaseSetting (TclObject name)
 
 ~BaseSetting ()=default
 
- Protected Member Functions inherited from openmsx::Subject< Setting >
 Subject ()=default
 
 ~Subject ()
 
void notify () const
 

Detailed Description

A Setting with a floating point value.

Definition at line 10 of file FloatSetting.hh.

Constructor & Destructor Documentation

◆ FloatSetting()

openmsx::FloatSetting::FloatSetting ( CommandController commandController,
std::string_view  name,
static_string_view  description,
double  initialValue,
double  minValue,
double  maxValue 
)

Member Function Documentation

◆ additionalInfo()

void openmsx::FloatSetting::additionalInfo ( TclObject result) const
overridevirtual

Helper method for info().

Implements openmsx::BaseSetting.

Definition at line 27 of file FloatSetting.cc.

References openmsx::TclObject::addListElement(), and openmsx::makeTclList().

◆ getDouble()

double openmsx::FloatSetting::getDouble ( ) const
inlinenoexcept

◆ getFloat()

float openmsx::FloatSetting::getFloat ( ) const
inlinenoexcept

◆ getMaxValue()

double openmsx::FloatSetting::getMaxValue ( ) const
inline

Definition at line 26 of file FloatSetting.hh.

◆ getMinValue()

double openmsx::FloatSetting::getMinValue ( ) const
inline

Definition at line 25 of file FloatSetting.hh.

◆ getTypeString()

std::string_view openmsx::FloatSetting::getTypeString ( ) const
overridevirtual

Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an appropriate setting widget.

Implements openmsx::BaseSetting.

Definition at line 22 of file FloatSetting.cc.

◆ setDouble()

void openmsx::FloatSetting::setDouble ( double  d)

Definition at line 32 of file FloatSetting.cc.

References openmsx::Setting::setValue().

Referenced by setFloat().

◆ setFloat()

void openmsx::FloatSetting::setFloat ( float  f)

Definition at line 37 of file FloatSetting.cc.

References setDouble().


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