Class Scine::Utils::Settings

class Settings : public Scine::Utils::UniversalSettings::ValueCollection

An interface for settings of all sorts.

This interface allows all other interfaces in Scine::Core to have a central place for Settings, while their implementations maintain their specific settings independently.

Implementation Notes:

  • A derived class of the Settings class has to define a construcor that populates the protected _fields member with a set of possible options and their default/descriptions.

Subclassed by Scine::Utils::AfirOptimizerSettings< OptimizerType, ConvergenceCheckType >, Scine::Utils::ExternalQC::GaussianCalculatorSettings, Scine::Utils::ExternalQC::OrcaCalculatorSettings, Scine::Utils::GeometryOptimizerSettings< OptimizerType, ConvergenceCheckType >, Scine::Utils::IRCOptimizerSettings< OptimizerType, ConvergenceCheckType >, Scine::Utils::MolecularDynamicsSettings

Public Functions

Settings(std::string name)

Construct a new Settings object.

Parameters
  • name:

Settings(Utils::UniversalSettings::ValueCollection settings, Utils::UniversalSettings::DescriptorCollection fields)

Constructor from ValueCollection and DescriptorCollection.

const std::string &name() const

Getter for the name set in the constructor of the settings object.

Return

std::string Returns the name.

bool check() const

Checks if the current settings are acceptable w.r.t.

the defined boundaries.

Return

true If the settings are valid.

false If the settings are not valid.

void resetToDefaults()

Resets the current settings to the default ones.

const Utils::UniversalSettings::DescriptorCollection &getDescriptorCollection() const

Returns a const reference of the protected member _fields.

Return

const Utils::UniversalSettings::DescriptorCollection& Underlying descriptor collection.

Settings getDefaultSettingsForOptionListWithSettings(const std::string &key, const std::string &option)

Returns the default ValueCollection as a settings object for a given key and option.

Return

Settings The default settings corresponding to the option.

Parameters
  • key: The key describing the ParametrizedOptionListDescriptor.

  • option: The option of which the default ValueCollection should be returned.

Protected Attributes

std::string _name

The blueprint for the allowed options.

All derived classes need to populate this collection in their constructor.