|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Base class for link parameters to a single Object of any type specifying the underlying parameter type. The underlying type is the integral DynExp::ItemIDType type, which stores the ID of the linked object.
More...
#include <Object.h>
Inheritance diagram for DynExp::ParamsBase::LinkParamBase:Public Member Functions | |
| const ParamType & | operator= (const ParamType &NewValue) |
Assigns a new value to this parameter. The operator cannot be accessed by Object because this function is not const. | |
Public Member Functions inherited from DynExp::LinkBase | |
| LinkBase (std::string_view IconResourcePath={}, bool Optional=false) | |
| Constructs a LinkBase object. | |
| void | EnsureReadyState () |
| Makes sure that the object where this link parameter points to is in a ready state. Only to be called by main thread. Otherwise, RunnableObject::Run() throws Util::InvalidCallException. | |
| bool | IsReady () |
| Returns whether the object where this link parameter points to is in a ready state. | |
| std::string_view | GetLinkTitle () const noexcept |
| Returns a reference to this link parameter's title. | |
| ItemIDListType | GetLinkedIDs () const |
| Returns a list of all object IDs assigned to this parameter. | |
| const CommonResourceManagerBase * | GetCommonManager () const noexcept |
This function can be used to determine the object type the parameter is expecting by comparing the resource manager's address to resource managers owned by a DynExpCore instance. | |
| std::string_view | GetIconResourcePath () const noexcept |
| bool | IsOptional () const noexcept |
Public Member Functions inherited from DynExp::ParamsBase::TypedParamBase< ParamType > | |
| ParamType | GetDefaultValue () const noexcept |
| Returns this parameter's default value. Thread-safe since a const member variable is returned. | |
| operator ParamType () const noexcept | |
| Converts the parameter implicitly to its underlying type returning its current value. | |
| const ParamType & | Get () const noexcept |
| Returns the parameter's value. | |
| const ParamType & | operator= (const ParamType &NewValue) |
Assigns a new value to this parameter. The operator cannot be accessed by Object because this function is not const. | |
Public Member Functions inherited from DynExp::ParamsBase::ParamBase | |
| 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). | |
| void | FromXMLNode (const QDomElement &XMLElement) |
| Restores this parameter's value from the given Qt dom element (describing an XML node) | |
| 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. | |
| void | Reset () |
| Resets this parameter to its default value. | |
| bool | IsUserEditable () const noexcept |
| Returns ParamBase::UserEditable. | |
| std::string_view | GetParamName () const noexcept |
| Returns ParamBase::ParamName. | |
| std::string_view | GetParamTitle () const noexcept |
| Returns ParamBase::ParamTitle. | |
| std::string_view | GetParamDescription () const noexcept |
| Returns ParamBase::ParamDescription. | |
| bool | GetNeedsResetToApplyChange () const noexcept |
| Returns ParamBase::NeedsResetToApplyChange. | |
Protected Member Functions | |
| LinkParamBase (ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, std::string_view IconResourcePath={}, bool Optional=false) | |
| Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true). | |
Protected Member Functions inherited from DynExp::LinkBase | |
| virtual | ~LinkBase () |
| template<typename ResourceManagerType > | |
| auto | ShareResource (const ResourceManagerType &Manager, ItemIDType ID) |
Returns a shared_ptr pointing to the resource with the given ID contained in the given resource manager Manager. The returned pointer points to a non-const instance of class Object. Throws an exception of type Util::NotFoundException if the resource is not found. | |
| template<typename ObjectType > | |
| auto | MakeObjectIDsWithLabels (const ManagerTypeOfObjectType_t< ObjectType > &Manager) const |
Finds all resources managed by the given resource manager matching type ObjectTpye and returns a list of information about these objects. | |
Protected Member Functions inherited from DynExp::ParamsBase::TypedParamBase< ParamType > | |
| TypedParamBase (ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, ParamType DefaultValue=ParamType()) | |
| Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true). | |
| TypedParamBase (ParamsBase &Owner, std::string ParamName, ParamType DefaultValue=ParamType()) | |
| Base constructor of any parameter to be used if a parameter should not be displayed in a settings dialog (UserEditable is set to false). | |
| 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). | |
| virtual void | FromXMLNodeChild (const QDomElement &XMLElement) override |
| Restores this parameter's value from the given Qt dom element (describing an XML node) | |
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). | |
| 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). | |
| virtual | ~ParamBase ()=0 |
| const auto & | GetOwner () const noexcept |
| Returns the ParamsBase instance owning this ParamBase instance. | |
| auto & | GetOwner () noexcept |
| Returns the ParamsBase instance owning this ParamBase instance. | |
Private Member Functions | |
| virtual std::string_view | GetLinkTitleChild () const noexcept override |
| Returns a reference to this link parameter's title. | |
| virtual ItemIDListType | GetLinkedIDsChild () const override |
| Returns a list of all object IDs assigned to this parameter. | |
Additional Inherited Members | |
Public Types inherited from DynExp::ParamsBase::TypedParamBase< ParamType > | |
| using | UnderlyingType = ParamType |
Public Attributes inherited from DynExp::ParamsBase::ParamBase | |
| ParamsBaseOnlyType | ParamsBaseOnly |
Provides the class ParamsBase access to some private members of class ParamBase. | |
Base class for link parameters to a single Object of any type specifying the underlying parameter type. The underlying type is the integral DynExp::ItemIDType type, which stores the ID of the linked object.
|
inlineprotected |
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. |
| DefaultValue | Default value to assign to the constructed parameter |
Constructs a LinkBase object.
| IconResourcePath | Qt resource path describing an icon being displayed along with this parameter in user interface dialogs. |
| Optional | Determines whether this parameter is optional. Optional parameters do not have to point to valid object IDs. |
No further constructor since LinkParamBase parameters must be editable by the user.
|
inlineoverrideprivatevirtual |
Returns a list of all object IDs assigned to this parameter.
Implements DynExp::LinkBase.
|
inlineoverrideprivatevirtualnoexcept |
Returns a reference to this link parameter's title.
Implements DynExp::LinkBase.
|
inline |
Assigns a new value to this parameter. The operator cannot be accessed by Object because this function is not const.
| NewValue | New value to assign |
| Util::InvalidArgException | is thrown if the value to assign to the parameter is not considered valid as determined by a call to ParamBase::Validate(). |