DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Abstract base class of link parameters (to be saved in project files) describing relations between multiple Object
(e.g. a module making use of an instrument).
More...
Public Member Functions | |
LinkBase (std::string_view IconResourcePath={}, bool Optional=false) | |
Constructs a LinkBase object. More... | |
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. More... | |
bool | IsReady () |
Returns whether the object where this link parameter points to is in a ready state. More... | |
std::string_view | GetLinkTitle () const noexcept |
Returns a reference to this link parameter's title. More... | |
ItemIDListType | GetLinkedIDs () const |
Returns a list of all object IDs assigned to this parameter. More... | |
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. More... | |
Thread-safe | |
Thread-safe since const member variables are returned. | |
std::string_view | GetIconResourcePath () const noexcept |
bool | IsOptional () const noexcept |
Protected Member Functions | |
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. More... | |
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. More... | |
Private Member Functions | |
Override | |
Override by derived class to make public versions of these functions behave as described above. | |
virtual void | EnsureReadyStateChild ()=0 |
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. More... | |
virtual bool | IsReadyChild ()=0 |
Returns whether the object where this link parameter points to is in a ready state. More... | |
virtual std::string_view | GetLinkTitleChild () const noexcept=0 |
Returns a reference to this link parameter's title. More... | |
virtual ItemIDListType | GetLinkedIDsChild () const =0 |
Returns a list of all object IDs assigned to this parameter. More... | |
virtual const CommonResourceManagerBase * | GetCommonManagerChild () const noexcept=0 |
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. More... | |
Private Attributes | |
const std::string_view | IconResourcePath |
Qt resource path describing an icon being displayed along with this parameter in user interface dialogs. More... | |
const bool | Optional |
Determines whether this parameter is optional. Optional parameters do not have to point to valid object IDs. More... | |
Abstract base class of link parameters (to be saved in project files) describing relations between multiple Object
(e.g. a module making use of an instrument).
|
inline |
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. |
|
inlineprotectedvirtual |
|
inline |
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.
|
privatepure virtual |
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.
Implemented in DynExp::ParamsBase::ListParam< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >, and DynExp::ParamsBase::Param< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >.
|
inlinenoexcept |
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.
|
privatepure virtualnoexcept |
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.
Implemented in DynExp::ParamsBase::ListParam< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >, and DynExp::ParamsBase::Param< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >.
|
inlinenoexcept |
|
inline |
|
privatepure virtual |
Returns a list of all object IDs assigned to this parameter.
Implemented in DynExp::ParamsBase::LinkListParamBase, and DynExp::ParamsBase::LinkParamBase.
|
inlinenoexcept |
|
privatepure virtualnoexcept |
Returns a reference to this link parameter's title.
Implemented in DynExp::ParamsBase::LinkListParamBase, and DynExp::ParamsBase::LinkParamBase.
|
inline |
|
privatepure virtual |
Returns whether the object where this link parameter points to is in a ready state.
Implemented in DynExp::ParamsBase::ListParam< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >, and DynExp::ParamsBase::Param< LinkType, std::enable_if_t< std::is_base_of_v< ObjectLinkBase, LinkType > > >.
|
inlineprotected |
Finds all resources managed by the given resource manager matching type ObjectTpye
and returns a list of information about these objects.
ObjectType | Type of objects assignable to this link. |
Manager | Resource manager to find resources in. |
Util::TextValueListType
containing object IDs and their description (object names, categories and type names) of objects assignable to this link. Util::EmptyException | is thrown if Manager does not contain any resource matching type ObjectTpye and if LinkBase::Optional is false. |
|
inlineprotected |
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.
ResourceManagerType | Type ot the resource manager containing the resource specified by ID . |
Manager | Resource manager containing the resource specified by ID . |
ID | ID of the resource to share. |
|
private |
|
private |