File DescriptorCollection.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

Functions

ValueCollection createDefaultValueCollection(const DescriptorCollection &descriptors)
class DescriptorCollection : public Scine::Utils::UniversalSettings::SettingDescriptor
#include <DescriptorCollection.h>

Setting that wraps a vector<pair<str, GenericDescriptor>>.

A setting (string descriptor, generic value pair) whose value is a list of string, GenericDescriptor pairs, which altogether define a nested list of descriptors.

Iterators

iterator begin()
const_iterator begin() const
iterator end()
const_iterator end() const

Accessors and modifiers

void push_back(std::string key, GenericDescriptor e)
GenericDescriptor &operator[](unsigned i)
const GenericDescriptor &operator[](unsigned i) const
GenericDescriptor &at(unsigned i)
const GenericDescriptor &at(unsigned i) const
GenericDescriptor &get(const std::string &key)
const GenericDescriptor &get(const std::string &key) const

Information

Checks whether a particular descriptor field exists in the configuration

bool exists(const std::string &key) const
bool empty() const

Checks whether the list of string, descriptor pairs is empty.

int size() const

Returns the number of string, descriptor pairs.

bool validValue(const ValueCollection &v) const

Determines whether a corresponding list of string, GenericValue pairs matches the configuration of this setting.

Return

Whether the supplied values match the setting configuration

Parameters

Public Types

using KeyValuePair = std::pair<std::string, GenericDescriptor>
using Container = std::vector<KeyValuePair>
using value_type = Container::value_type
using iterator = Container::iterator
using const_iterator = Container::const_iterator

Public Functions

DescriptorCollection(std::string description)
std::unique_ptr<SettingDescriptor> clone() const

Create a heap-allocated base pointer copy of this instance.

Return

A heap-allocated copy of this instance

GenericValue getDefaultGenericValue() const

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

Return

A type-erased representation of the setting’s default value

bool validValue(const GenericValue &v) const

Checks if a particular type-erased representation of a setting is a valid value for this kind of setting.

Return

Whether the type-erased representation is a valid value for this kind of setting

Parameters
  • v: A type-erased setting representation

Private Members

Container descriptors_