MCPcopy Create free account
hub / github.com/MITK/MITK / GetDouble

Method GetDouble

Modules/Core/src/IO/mitkPreferences.cpp:122–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122double mitk::Preferences::GetDouble(const std::string& key, double def) const
123{
124 auto value = this->FindValue(key);
125
126 if (!value.has_value())
127 return def;
128
129 try
130 {
131 return std::stod(value.value());
132 }
133 catch (...)
134 {
135 mitkThrow() << "The property [\"" << key << "\": \"" << value.value() << "\"] does not represent a valid double value!";
136 }
137}
138
139void mitk::Preferences::PutDouble(const std::string& key, double value)
140{

Callers 5

AddRTDoseToDataStorageFunction · 0.80
LoadPresetsMapMethod · 0.80
GetReferenceDoseValueMethod · 0.80
UpdateMethod · 0.80
UpdateMethod · 0.80

Calls 2

FindValueMethod · 0.95
valueMethod · 0.45

Tested by

no test coverage detected