File GenericInstanceEditor.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
-
template<typename
BaseT
>
classGenericInstanceEditor
- #include <GenericInstanceEditor.h>
Same as GenericInstanceEditor, defined below, without create function for the case that the constructor needs more parameters, which can then be specified in the derived class.
Public Types
-
template<>
usingBaseClass
= BaseT¶
Public Functions
-
virtual
~GenericInstanceEditor
()¶
-
virtual DescriptorCollection
getSettingDescriptors
() const = 0 Get the descriptors for the settings for BaseClass.
-
virtual ValueCollection
getAppliedSettings
(const BaseClass &instance) const = 0 Get the current parameters for the given instance.
-
virtual bool
relatesToInstance
(const BaseClass &instance) const = 0 Enquire whether the Editor class can handle the given instance.
-
virtual void
apply
(BaseClass &instance, const ValueCollection &values) const = 0 Apply settings to some BaseClass instance.
-
template<>
-
template<typename
Base
>
classGenericInstanceEditorWithDefaultConstructor
: public Scine::Utils::UniversalSettings::GenericInstanceEditor<Base> - #include <GenericInstanceEditor.h>
Template for a class being able to create and modify instances of some polymorphic type from settings specified in the UniversalSettings syntax.
Public Types
-
template<>
usingBaseClass
= Base¶
Public Functions
-
virtual std::unique_ptr<Base>
create
(const ValueCollection &values) const = 0 Create an instance with given setting values.
-
std::unique_ptr<Base>
createDefault
() const Create an instance with default values.
-
template<>
-
template<typename
BaseEditor
, typenameT
>
classGenericInstanceEditorImpl
: public BaseEditor - #include <GenericInstanceEditor.h>
Specification of GenericInstanceEditorWithoutCreateFunction with the type T, to generate automatically some of the virtual functions.
- Template Parameters
BaseEditor
: must be some GenericInstanceEditorT
: class to instantiate, must be a * derived class of the template parameter of BaseEditor.
Subclassed by Scine::Utils::UniversalSettings::GenericInstanceEditorWithDefaultConstructorImpl< BaseEditor, T >
Public Types
-
template<>
usingInstanceClass
= T¶
-
template<>
usingBaseClass
= typename BaseEditor::BaseClass¶
Public Functions
-
bool
relatesToInstance
(const BaseClass &instance) const¶
-
void
apply
(BaseClass &instance, const ValueCollection &values) const¶
-
ValueCollection
getAppliedSettings
(const BaseClass &instance) const¶
Protected Functions
-
T &
castDown
(BaseClass &instance) const¶
-
const T &
castDown
(const BaseClass &instance) const¶
Private Functions
-
virtual void
applyImpl
(T &instance, const ValueCollection &values) const = 0¶
-
virtual ValueCollection
getAppliedSettingsImpl
(const T &instance) const = 0¶
-
template<typename
BaseEditor
, typenameT
>
classGenericInstanceEditorWithDefaultConstructorImpl
: public Scine::Utils::UniversalSettings::GenericInstanceEditorImpl<BaseEditor, T> - #include <GenericInstanceEditor.h>
Specification of GenericInstanceEditor with the type T, to generate automatically some of the virtual functions.
- Template Parameters
BaseEditor
: must be some GenericInstanceEditorWithDefaultConstructorT
: class to instantiate, must be a derived class of the template parameter of BaseEditor.
Public Types
-
template<>
usingInstanceClass
= T¶
-
template<>
usingBaseClass
= typename BaseEditor::BaseClass¶
Public Functions
-
std::unique_ptr<BaseClass>
create
(const ValueCollection &values) const¶
-
template<typename
-
namespace
-
namespace