DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Abstract base class for a single object parameter. Parameters derived from this class are automatically stored in the DynExp project file. Additionally, derived parameters might be configured in settings dialogs dynamically generated for objects according to the parameters belonging to it. More...
Classes | |
class | ParamsBaseOnlyType |
Provides the class ParamsBase access to some private members of class ParamBase . More... | |
Public Member Functions | |
ParamBase (const ParamBase &)=delete | |
ParamBase & | operator= (const ParamBase &)=delete |
QDomElement | ToXMLNode (QDomDocument &Document) const |
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name and value). More... | |
void | FromXMLNode (const QDomElement &XMLElement) |
Restores this parameter's value from the given Qt dom element (describing an XML node) More... | |
bool | Validate () |
Checks whether a valid value is assigned to this parameter. This function is not const since it is also intended to reset the parameter if it is invalid. More... | |
void | Reset () |
Resets this parameter to its default value. More... | |
Thread-safe getter functions | |
Thread-safe since const member variables are returned. | |
bool | IsUserEditable () const noexcept |
Returns ParamBase::UserEditable. More... | |
std::string_view | GetParamName () const noexcept |
Returns ParamBase::ParamName. More... | |
std::string_view | GetParamTitle () const noexcept |
Returns ParamBase::ParamTitle. More... | |
std::string_view | GetParamDescription () const noexcept |
Returns ParamBase::ParamDescription. More... | |
bool | GetNeedsResetToApplyChange () const noexcept |
Returns ParamBase::NeedsResetToApplyChange. More... | |
Public Attributes | |
ParamsBaseOnlyType | ParamsBaseOnly |
Provides the class ParamsBase access to some private members of class ParamBase . More... | |
Protected Member Functions | |
ParamBase (ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange) | |
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true). More... | |
ParamBase (ParamsBase &Owner, std::string ParamName) | |
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dialog (UserEditable is set to false). More... | |
virtual | ~ParamBase ()=0 |
const auto & | GetOwner () const noexcept |
Returns the ParamsBase instance owning this ParamBase instance. More... | |
auto & | GetOwner () noexcept |
Returns the ParamsBase instance owning this ParamBase instance. More... | |
Private Member Functions | |
void | DisableUserEditable () noexcept |
Sets the UserEditable property to false. More... | |
void | AddToDialog (ParamsConfigDialog &Dialog) |
Appends this parameter to a settings dialog making it configurable by the user. More... | |
Override | |
Override by derived class to make public versions of these functions behave as described above. | |
virtual void | ToXMLNodeChild (QDomDocument &Document, QDomElement &XMLElement) const =0 |
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name and value). More... | |
virtual void | FromXMLNodeChild (const QDomElement &XMLElement)=0 |
Restores this parameter's value from the given Qt dom element (describing an XML node) More... | |
virtual void | AddToDialogChild (ParamsConfigDialog &Dialog)=0 |
Appends this parameter to a settings dialog making it configurable by the user. More... | |
virtual bool | ValidateChild () const |
Checks whether a valid value is assigned to this parameter. This function is not const since it is also intended to reset the parameter if it is invalid. Returns true by default. More... | |
virtual void | ResetChild ()=0 |
Resets this parameter to its default value. More... | |
Private Attributes | |
ParamsBase & | Owner |
Owner of this parameter. Owner always lives longer than this object. More... | |
bool | UserEditable |
Is this parameter displayed in a settings dialog und thus editable by the user directly? Not const since derived objects might want to hide a parameter declared by a base class. More... | |
const std::string | ParamName |
Identifier which is stored in project file. More... | |
const std::string_view | ParamTitle |
String which is displayed as a label when editing the parameter using ParamsConfigDialog. More... | |
const std::string_view | ParamDescription |
String which describes the parameter as a tooltip when using ParamsConfigDialog. More... | |
const bool | NeedsResetToApplyChange |
Indicates whether the object owning this parameter needs to be reset to apply changes to this parameter. More... | |
Abstract base class for a single object parameter. Parameters derived from this class are automatically stored in the DynExp project file. Additionally, derived parameters might be configured in settings dialogs dynamically generated for objects according to the parameters belonging to it.
|
protected |
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true).
Owner | ParamsBase instance owning this parameter. |
ParamName | Name of the parameter to be used in the XML config file. std::string to allow for auto-generated names. |
ParamTitle | Title of the parameter to be displayed in settings dialogs. A static string literal with a constant address is expected. |
ParamDescription | Detailed description of the parameter to be displayed in settings dialogs. A static string literal with a constant address is expected. |
NeedsResetToApplyChange | Indicated whether the object this parameter belongs to needs to be reset to apply changes if this parameter's value has changed. |
Definition at line 113 of file Object.cpp.
|
protected |
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dialog (UserEditable is set to false).
Owner | ParamsBase instance owning this parameter. |
ParamName | Name of the parameter to be used in the XML config file. std::string to allow for auto-generated names. |
Definition at line 125 of file Object.cpp.
|
protectedpure virtual |
Definition at line 133 of file Object.cpp.
|
delete |
|
inlineprivate |
|
privatepure virtual |
Appends this parameter to a settings dialog making it configurable by the user.
Dialog | Reference to the settings dialog to append the parameter to |
Implemented in DynExp::ParamsBase::ListParam< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >, DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >, DynExp::ParamsBase::ListParam< ParamType, std::enable_if_t< !std::is_arithmetic_v< ParamType > &&!std::is_base_of_v< ObjectLinkBase, ParamType > > >, DynExp::ParamsBase::Param< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >, DynExp::ParamsBase::Param< EnumType, std::enable_if_t< std::is_enum_v< EnumType > > >, DynExp::ParamsBase::Param< ParamType, std::enable_if_t< std::is_base_of_v< IndexedTextList, ParamType > > >, DynExp::ParamsBase::Param< ParamType, std::enable_if_t< std::is_base_of_v< TextList, ParamType > > >, DynExp::ParamsBase::Param< ParamType, std::enable_if_t< std::is_base_of_v< Text, ParamType > > >, DynExp::ParamsBase::Param< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >, DynExp::ParamsBase::Param< ParamType, std::enable_if_t< !std::is_arithmetic_v< ParamType > &&!std::is_base_of_v< Text, ParamType > &&!std::is_base_of_v< TextList, ParamType > &&!std::is_base_of_v< IndexedTextList, ParamType > &&!std::is_enum_v< ParamType > &&!std::is_base_of_v< ObjectLinkBase, ParamType > > >, and DynExp::ParamsBase::DummyParam.
|
inlineprivatenoexcept |
void DynExp::ParamsBase::ParamBase::FromXMLNode | ( | const QDomElement & | XMLElement | ) |
Restores this parameter's value from the given Qt dom element (describing an XML node)
XMLElement | Qt dom element containing information about this parameter. |
Definition at line 145 of file Object.cpp.
|
privatepure virtual |
Restores this parameter's value from the given Qt dom element (describing an XML node)
XMLElement | Qt dom element containing information about this parameter. |
Implemented in DynExp::ParamsBase::ListParam< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >, DynExp::ParamsBase::Param< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >, DynExp::ParamsBase::TypedListParamBase< ParamType >, DynExp::ParamsBase::TypedParamBase< ParamType >, and DynExp::ParamsBase::DummyParam.
|
inlinenoexcept |
Returns ParamBase::NeedsResetToApplyChange.
|
inlineprotectednoexcept |
Returns the ParamsBase instance owning this ParamBase instance.
|
inlineprotectednoexcept |
Returns the ParamsBase instance owning this ParamBase instance.
|
inlinenoexcept |
Returns ParamBase::ParamDescription.
|
inlinenoexcept |
Returns ParamBase::ParamName.
|
inlinenoexcept |
Returns ParamBase::ParamTitle.
|
inlinenoexcept |
Returns ParamBase::UserEditable.
|
inline |
|
privatepure virtual |
Resets this parameter to its default value.
Implemented in DynExp::ParamsBase::TypedListParamBase< ParamType >, DynExp::ParamsBase::TypedParamBase< ParamType >, and DynExp::ParamsBase::DummyParam.
QDomElement DynExp::ParamsBase::ParamBase::ToXMLNode | ( | QDomDocument & | Document | ) | const |
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name and value).
Document | Qt dom document within to create the dom element. |
Definition at line 137 of file Object.cpp.
|
privatepure virtual |
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name and value).
Document | Qt dom document within to create the dom element. |
XMLElement | Qt dom element to save information about this parameter to. |
Implemented in DynExp::ParamsBase::TypedListParamBase< ParamType >, DynExp::ParamsBase::TypedParamBase< ParamType >, and DynExp::ParamsBase::DummyParam.
bool DynExp::ParamsBase::ParamBase::Validate | ( | ) |
Checks whether a valid value is assigned to this parameter. This function is not const since it is also intended to reset the parameter if it is invalid.
Definition at line 164 of file Object.cpp.
|
inlineprivatevirtual |
Checks whether a valid value is assigned to this parameter. This function is not const since it is also intended to reset the parameter if it is invalid. Returns true by default.
Reimplemented in DynExp::ParamsBase::TypedListParamBase< ParamType >, and DynExp::ParamsBase::TypedParamBase< ParamType >.
|
private |
|
private |
|
private |
String which describes the parameter as a tooltip when using ParamsConfigDialog.
|
private |
ParamsBaseOnlyType DynExp::ParamsBase::ParamBase::ParamsBaseOnly |
Provides the class ParamsBase
access to some private members of class ParamBase
.
|
private |
String which is displayed as a label when editing the parameter using ParamsConfigDialog.
|
private |