DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > > Class Template Reference

List parameter for numbers. If ParamType is an arithmetic type (integral or floating point), then extend TypedListParamBase's functionality by specifying the allowed number range and format. More...

+ Inheritance diagram for DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >:

Public Types

using PrecisionType = unsigned short
 
- Public Types inherited from DynExp::ParamsBase::TypedListParamBase< ParamType >
using UnderlyingType = std::vector< ParamType >
 List type to be used for the parameter. More...
 

Public Member Functions

 ListParam (ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, typename TypedListParamBase< ArithmeticType >::UnderlyingType DefaultValues={}, ArithmeticType MinValue=std::numeric_limits< ArithmeticType >::lowest(), ArithmeticType MaxValue=std::numeric_limits< ArithmeticType >::max(), ArithmeticType Increment=1, PrecisionType Precision=0)
 Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true). More...
 
 ListParam (ParamsBase &Owner, std::string ParamName, typename TypedListParamBase< ArithmeticType >::UnderlyingType DefaultValues={}, ArithmeticType MinValue=std::numeric_limits< ArithmeticType >::lowest(), ArithmeticType MaxValue=std::numeric_limits< ArithmeticType >::max(), ArithmeticType Increment=1, PrecisionType Precision=0)
 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...
 
Thread-safe getter functions

Thread-safe since const member variables are returned.

ArithmeticType GetMinValue () const noexcept
 Returns the minimal allowed value of the list items. More...
 
ArithmeticType GetMaxValue () const noexcept
 Returns the maximal allowed value of the list items. More...
 
ArithmeticType GetIncrement () const noexcept
 Returns the value increment of the list items. More...
 
PrecisionType GetPrecision () const noexcept
 Returns the value precision of the list items. More...
 
- Public Member Functions inherited from DynExp::ParamsBase::TypedListParamBase< ParamType >
const auto & GetDefaultValue () const noexcept
 Returns this parameter's default value list. Thread-safe since a reference to a const member variable is returned. More...
 
const auto & Get () const noexcept
 Returns the parameter's values. More...
 
auto & operator= (const UnderlyingType &NewValues)
 Assigns new values to this parameter. The operator cannot be accessed by Object because this function is not const. More...
 
- Public Member Functions inherited from DynExp::ParamsBase::ParamBase
 ParamBase (const ParamBase &)=delete
 
ParamBaseoperator= (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...
 
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...
 

Private Member Functions

virtual void AddToDialogChild (ParamsConfigDialog &Dialog) override final
 Appends this parameter to a settings dialog making it configurable by the user. More...
 
bool ValidateValues (const typename TypedListParamBase< ArithmeticType >::UnderlyingType &NewValues) const override
 

Private Attributes

const ArithmeticType MinValue
 Minimal allowed list item value. More...
 
const ArithmeticType MaxValue
 Maximal allowed list item value. More...
 
const ArithmeticType Increment
 List item value increment (used in the settings dialog for manual parameter adjustment) More...
 
const PrecisionType Precision
 List item value precision (used in the settings dialog for manual parameter adjustment) More...
 

Additional Inherited Members

- Public Attributes inherited from DynExp::ParamsBase::ParamBase
ParamsBaseOnlyType ParamsBaseOnly
 Provides the class ParamsBase access to some private members of class ParamBase. More...
 
- Protected Member Functions inherited from DynExp::ParamsBase::TypedListParamBase< ParamType >
 TypedListParamBase (ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, UnderlyingType DefaultValues={})
 Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true). More...
 
 TypedListParamBase (ParamsBase &Owner, std::string ParamName, UnderlyingType DefaultValues={})
 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 void ToXMLNodeChild (QDomDocument &Document, QDomElement &XMLElement) const override
 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) override
 Restores this parameter's value from the given Qt dom element (describing an XML node) More...
 
- Protected Member Functions inherited from DynExp::ParamsBase::ParamBase
 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...
 

Detailed Description

template<typename ArithmeticType>
class DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >

List parameter for numbers. If ParamType is an arithmetic type (integral or floating point), then extend TypedListParamBase's functionality by specifying the allowed number range and format.

Template Parameters
ArithmeticTypeNumber type (std::is_arithmetic fulfilled)

Definition at line 1328 of file Object.h.

Member Typedef Documentation

◆ PrecisionType

template<typename ArithmeticType >
using DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::PrecisionType = unsigned short

Definition at line 1331 of file Object.h.

Constructor & Destructor Documentation

◆ ListParam() [1/2]

template<typename ArithmeticType >
DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::ListParam ( ParamsBase Owner,
std::string  ParamName,
std::string_view  ParamTitle,
std::string_view  ParamDescription,
bool  NeedsResetToApplyChange = true,
typename TypedListParamBase< ArithmeticType >::UnderlyingType  DefaultValues = {},
ArithmeticType  MinValue = std::numeric_limits<ArithmeticType>::lowest(),
ArithmeticType  MaxValue = std::numeric_limits<ArithmeticType>::max(),
ArithmeticType  Increment = 1,
PrecisionType  Precision = 0 
)
inline

Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true).

Parameters
OwnerParamsBase instance owning this parameter.
ParamNameName of the parameter to be used in the XML config file. std::string to allow for auto-generated names.
ParamTitleTitle of the parameter to be displayed in settings dialogs. A static string literal with a constant address is expected.
ParamDescriptionDetailed description of the parameter to be displayed in settings dialogs. A static string literal with a constant address is expected.
NeedsResetToApplyChangeIndicated whether the object this parameter belongs to needs to be reset to apply changes if this parameter's value has changed.
DefaultValuesList of default values to assign to the constructed parameter
MinValueMinimal allowed value
MaxValueMaximal allowed value
IncrementIncrement/decrement step size (used in the settings dialog for manual parameter adjustment)
PrecisionFloating point precision (used in the settings dialog for manual parameter adjustment)

Definition at line 1341 of file Object.h.

◆ ListParam() [2/2]

template<typename ArithmeticType >
DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::ListParam ( ParamsBase Owner,
std::string  ParamName,
typename TypedListParamBase< ArithmeticType >::UnderlyingType  DefaultValues = {},
ArithmeticType  MinValue = std::numeric_limits<ArithmeticType>::lowest(),
ArithmeticType  MaxValue = std::numeric_limits<ArithmeticType>::max(),
ArithmeticType  Increment = 1,
PrecisionType  Precision = 0 
)
inline

Base constructor of any parameter to be used if a parameter should not be displayed in a settings dialog (UserEditable is set to false).

Parameters
OwnerParamsBase instance owning this parameter.
ParamNameName of the parameter to be used in the XML config file. std::string to allow for auto-generated names.
DefaultValuesList of default values to assign to the constructed parameter
MinValueMinimal allowed value
MaxValueMaximal allowed value
IncrementIncrement/decrement step size (used in the settings dialog for manual parameter adjustment)
PrecisionFloating point precision (used in the settings dialog for manual parameter adjustment)

Definition at line 1355 of file Object.h.

Member Function Documentation

◆ AddToDialogChild()

template<typename ArithmeticType >
virtual void DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::AddToDialogChild ( ParamsConfigDialog Dialog)
inlinefinaloverrideprivatevirtual

Appends this parameter to a settings dialog making it configurable by the user.

Parameters
DialogReference to the settings dialog to append the parameter to

Implements DynExp::ParamsBase::ParamBase.

Definition at line 1372 of file Object.h.

◆ GetIncrement()

template<typename ArithmeticType >
ArithmeticType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::GetIncrement ( ) const
inlinenoexcept

Returns the value increment of the list items.

Definition at line 1367 of file Object.h.

◆ GetMaxValue()

template<typename ArithmeticType >
ArithmeticType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::GetMaxValue ( ) const
inlinenoexcept

Returns the maximal allowed value of the list items.

Definition at line 1366 of file Object.h.

◆ GetMinValue()

template<typename ArithmeticType >
ArithmeticType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::GetMinValue ( ) const
inlinenoexcept

Returns the minimal allowed value of the list items.

Definition at line 1365 of file Object.h.

◆ GetPrecision()

template<typename ArithmeticType >
PrecisionType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::GetPrecision ( ) const
inlinenoexcept

Returns the value precision of the list items.

Definition at line 1368 of file Object.h.

◆ ValidateValues()

template<typename ArithmeticType >
bool DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::ValidateValues ( const typename TypedListParamBase< ArithmeticType >::UnderlyingType NewValues) const
inlineoverrideprivate

Definition at line 1378 of file Object.h.

Member Data Documentation

◆ Increment

template<typename ArithmeticType >
const ArithmeticType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::Increment
private

List item value increment (used in the settings dialog for manual parameter adjustment)

Definition at line 1389 of file Object.h.

◆ MaxValue

template<typename ArithmeticType >
const ArithmeticType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::MaxValue
private

Maximal allowed list item value.

Definition at line 1388 of file Object.h.

◆ MinValue

template<typename ArithmeticType >
const ArithmeticType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::MinValue
private

Minimal allowed list item value.

Definition at line 1387 of file Object.h.

◆ Precision

template<typename ArithmeticType >
const PrecisionType DynExp::ParamsBase::ListParam< ArithmeticType, std::enable_if_t< std::is_arithmetic_v< ArithmeticType > > >::Precision
private

List item value precision (used in the settings dialog for manual parameter adjustment)

Definition at line 1390 of file Object.h.


The documentation for this class was generated from the following file: