File GenericDescriptor.h

Copyright

This code is licensed under the 3-clause BSD license.

Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.

See LICENSE.txt for details.

namespace Scine

This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.

This header contains alias definitions defining which classes to use for the different degrees of derivatives.

namespace Utils
namespace UniversalSettings
class GenericDescriptor
#include <GenericDescriptor.h>

Wrapper around SettingDescriptor that hides the setting type.

Makes it possible to handle setting descriptors as objects (but is in principle similar to a pointer to the base class SettingDescriptor).

Special member functions

GenericDescriptor()
GenericDescriptor(const GenericDescriptor&)
GenericDescriptor(GenericDescriptor&&)
GenericDescriptor &operator=(const GenericDescriptor&)
GenericDescriptor &operator=(GenericDescriptor&&)
~GenericDescriptor()

Specific constructors from SettingDescriptor-derived instances

GenericDescriptor(BoolDescriptor d)
GenericDescriptor(IntDescriptor d)
GenericDescriptor(DoubleDescriptor d)
GenericDescriptor(StringDescriptor d)
GenericDescriptor(FileDescriptor d)
GenericDescriptor(DirectoryDescriptor d)
GenericDescriptor(OptionListDescriptor d)
GenericDescriptor(DescriptorCollection d)
GenericDescriptor(ParametrizedOptionListDescriptor d)
GenericDescriptor(IntListDescriptor d)
GenericDescriptor(StringListDescriptor d)
GenericDescriptor(CollectionListDescriptor d)

Figure out which SettingsDescriptor derived type is stored

bool relatesToBool() const
bool relatesToInt() const
bool relatesToDouble() const
bool relatesToString() const
bool relatesToFile() const
bool relatesToDirectory() const
bool relatesToOptionList() const
bool relatesToSettingCollection() const
bool relatesToParametrizedOptionList() const
bool relatesToIntList() const
bool relatesToStringList() const
bool relatesToCollectionList() const

Fetch reference to specific descriptor

const SettingDescriptor &getDescriptor() const
const BoolDescriptor &getBoolDescriptor() const
const IntDescriptor &getIntDescriptor() const
const DoubleDescriptor &getDoubleDescriptor() const
const StringDescriptor &getStringDescriptor() const
const FileDescriptor &getFileDescriptor() const
const DirectoryDescriptor &getDirectoryDescriptor() const
const OptionListDescriptor &getOptionListDescriptor() const
const DescriptorCollection &getSettingCollectionDescriptor() const
const ParametrizedOptionListDescriptor &getParametrizedOptionListDescriptor() const
const IntListDescriptor &getIntListDescriptor() const
const StringListDescriptor &getStringListDescriptor() const
const CollectionListDescriptor &getCollectionListDescriptor() const

Public Types

enum Type

To store what type the setting descriptor is for.

Values:

Bool
Int
Double
String
File
Directory
OptionList
SettingCollection
ParametrizedOptionList
IntList
StringList
CollectionList

Public Functions

Type getType() const

Extract what type a setting descriptor is for.

const std::string &getPropertyDescription() const

Fetches the string describing what the setting descriptor is for.

const GenericValue getDefaultValue() const

Fetches a type-erased representation of the setting descriptor’s default value.

Private Members

std::unique_ptr<SettingDescriptor> descriptor_