DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp::LinkedObjectWrapperContainer< ObjectT > Class Template Reference

This class holds a pointer (LinkedObjectWrapperPointer) to a LinkedObjectWrapper. Intances of this class should be owned by classes derived from class InstrumentDataBase or class ModuleDataBase. These instances provide access to objects referenced by object link parameters. LinkedObjectWrapperContainer does not own the referenced LinkedObjectWrapper. The LinkedObjectWrapper itself is owned by class RunnableInstance. The pointer hold here is also set and managed by class RunnableInstance. Also refer to class RunnableInstance. More...

+ Inheritance diagram for DynExp::LinkedObjectWrapperContainer< ObjectT >:

Public Member Functions

 LinkedObjectWrapperContainer (bool PerformReadyCheck=true) noexcept
 Constructs a LinkedObjectWrapperContainer instance. More...
 
virtual ~LinkedObjectWrapperContainer ()=default
 
Logical const-ness

Const methods to also operate on const LinkedObjectWrapperContainer instances.

auto get () const
 Returns the LinkedObjWrapperPtr and checks (depending on PerformReadyCheck) whether the Object LinkedObjWrapperPtr points to is ready. If this is not the case, this LinkedObjectWrapperContainer instance remembers the linked object's state updating LinkedObjectWrapperContainerBase::LinkedObjectState. More...
 
auto & operator* () const
 Dereferences and returns the result of a call to get(). More...
 
auto operator-> () const
 Returns the result of a call to get(). More...
 
bool valid () const noexcept
 Checks whether LinkedObjWrapperPtr points to a valid distination. More...
 
- Public Member Functions inherited from DynExp::LinkedObjectWrapperContainerBase
auto GetState () const noexcept
 Returns LinkedObjectState. More...
 
std::string GetLinkedObjectDesc () const
 Builds and returns a human-readable string uniquely identifying the Object instance which is wrapped by the linked LinkedObjectWrapper. More...
 
bool CheckIfReady ()
 Returns whether the Object instance which is wrapped by the linked LinkedObjectWrapper is in a ready state. More...
 
- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyableoperator= (const INonCopyable &)=delete
 

Private Member Functions

virtual void ResetChild () noexcept override
 Removes any linked LinkedObjectWrapper and updates LinkedObjectState. More...
 
virtual std::string GetLinkedObjectDescChild () const override
 Builds and returns a human-readable string uniquely identifying the Object instance which is wrapped by the linked LinkedObjectWrapper. More...
 
virtual bool CheckIfReadyChild () override
 Returns whether the Object instance which is wrapped by the linked LinkedObjectWrapper is in a ready state. More...
 
void CheckIfNullptr () const
 Checks whether LinkedObjWrapperPtr is nullptr. Does nothing if this is not the case. More...
 
auto & GetLinkedObjWrapperPtr () const
 Returns LinkedObjWrapperPtr after checking whether LinkedObjWrapperPtr is nullptr. More...
 
void SetLinkedObjWrapperPtr (LinkedObjectWrapperPointer< ObjectT > NewLinkedObjWrapperPtr) noexcept
 Sets LinkedObjWrapperPtr to a new destination and updates LinkedObjectWrapperContainerBase::LinkedObjectState. More...
 

Private Attributes

LinkedObjectWrapperPointer< ObjectT > LinkedObjWrapperPtr
 Pointer to a LinkedObjectWrapper instance holding a pointer to the destiny object instance of type const ObjectT. More...
 
const bool PerformReadyCheck
 Determines whether a call to get() checks the return value of Object::IsReady() before returning LinkedObjWrapperPtr. More...
 

Friends

class RunnableInstance
 

Additional Inherited Members

- Public Types inherited from DynExp::LinkedObjectWrapperContainerBase
enum class  LinkedObjectStateType { NotLinked , Ready , NotReady }
 Indicates the current state of the Object referenced by the linked LinkedObjectWrapper. More...
 
- Protected Member Functions inherited from DynExp::LinkedObjectWrapperContainerBase
 LinkedObjectWrapperContainerBase () noexcept
 Constructs a LinkedObjectWrapperContainerBase instance which is not linked to any LinkedObjectWrapper. More...
 
virtual ~LinkedObjectWrapperContainerBase ()=0
 
void Reset () noexcept
 Removes any linked LinkedObjectWrapper and updates LinkedObjectState. More...
 
- Protected Member Functions inherited from Util::INonCopyable
constexpr INonCopyable ()=default
 
 ~INonCopyable ()=default
 
- Protected Attributes inherited from DynExp::LinkedObjectWrapperContainerBase
LinkedObjectStateType LinkedObjectState
 Stores the current state of this LinkedObjectWrapperContainerBase instance. Refer to LinkedObjectStateType. Mutable to be updated in calls to LinkedObjectWrapperContainer::get(). More...
 

Detailed Description

template<typename ObjectT>
class DynExp::LinkedObjectWrapperContainer< ObjectT >

This class holds a pointer (LinkedObjectWrapperPointer) to a LinkedObjectWrapper. Intances of this class should be owned by classes derived from class InstrumentDataBase or class ModuleDataBase. These instances provide access to objects referenced by object link parameters. LinkedObjectWrapperContainer does not own the referenced LinkedObjectWrapper. The LinkedObjectWrapper itself is owned by class RunnableInstance. The pointer hold here is also set and managed by class RunnableInstance. Also refer to class RunnableInstance.

Template Parameters
ObjectTType of the managed Object.

Definition at line 3159 of file Object.h.

Constructor & Destructor Documentation

◆ LinkedObjectWrapperContainer()

template<typename ObjectT >
DynExp::LinkedObjectWrapperContainer< ObjectT >::LinkedObjectWrapperContainer ( bool  PerformReadyCheck = true)
inlinenoexcept

Constructs a LinkedObjectWrapperContainer instance.

Parameters
PerformReadyCheckRefer to LinkedObjectWrapperContainer::PerformReadyCheck.

Definition at line 3168 of file Object.h.

◆ ~LinkedObjectWrapperContainer()

template<typename ObjectT >
virtual DynExp::LinkedObjectWrapperContainer< ObjectT >::~LinkedObjectWrapperContainer ( )
virtualdefault

Member Function Documentation

◆ CheckIfNullptr()

template<typename ObjectT >
void DynExp::LinkedObjectWrapperContainer< ObjectT >::CheckIfNullptr ( ) const
inlineprivate

Checks whether LinkedObjWrapperPtr is nullptr. Does nothing if this is not the case.

Exceptions
Util::LinkedObjectNotLockedExceptionis thrown if LinkedObjWrapperPtr is nullptr.

Definition at line 3248 of file Object.h.

◆ CheckIfReadyChild()

template<typename ObjectT >
virtual bool DynExp::LinkedObjectWrapperContainer< ObjectT >::CheckIfReadyChild ( )
inlineoverrideprivatevirtual

Returns whether the Object instance which is wrapped by the linked LinkedObjectWrapper is in a ready state.

Returns
Returns e.g. the result of a call to Object::IsReady() on the related Object instance.

Implements DynExp::LinkedObjectWrapperContainerBase.

Definition at line 3230 of file Object.h.

◆ get()

template<typename ObjectT >
auto DynExp::LinkedObjectWrapperContainer< ObjectT >::get ( ) const
inline

Returns the LinkedObjWrapperPtr and checks (depending on PerformReadyCheck) whether the Object LinkedObjWrapperPtr points to is ready. If this is not the case, this LinkedObjectWrapperContainer instance remembers the linked object's state updating LinkedObjectWrapperContainerBase::LinkedObjectState.

Returns
The returned pointer/reference is always const. Refer to LinkedObjectWrapperPointer.

Definition at line 3185 of file Object.h.

◆ GetLinkedObjectDescChild()

template<typename ObjectT >
virtual std::string DynExp::LinkedObjectWrapperContainer< ObjectT >::GetLinkedObjectDescChild ( ) const
inlineoverrideprivatevirtual

Builds and returns a human-readable string uniquely identifying the Object instance which is wrapped by the linked LinkedObjectWrapper.

Returns
String containing e.g. the type category, type name, and user-defined name of the related Object instance

Implements DynExp::LinkedObjectWrapperContainerBase.

Definition at line 3222 of file Object.h.

◆ GetLinkedObjWrapperPtr()

template<typename ObjectT >
auto& DynExp::LinkedObjectWrapperContainer< ObjectT >::GetLinkedObjWrapperPtr ( ) const
inlineprivate

Returns LinkedObjWrapperPtr after checking whether LinkedObjWrapperPtr is nullptr.

Returns
Refer to LinkedObjWrapperPtr.

Definition at line 3258 of file Object.h.

◆ operator*()

template<typename ObjectT >
auto& DynExp::LinkedObjectWrapperContainer< ObjectT >::operator* ( ) const
inline

Dereferences and returns the result of a call to get().

Definition at line 3209 of file Object.h.

◆ operator->()

template<typename ObjectT >
auto DynExp::LinkedObjectWrapperContainer< ObjectT >::operator-> ( ) const
inline

Returns the result of a call to get().

Definition at line 3210 of file Object.h.

◆ ResetChild()

template<typename ObjectT >
virtual void DynExp::LinkedObjectWrapperContainer< ObjectT >::ResetChild ( )
inlineoverrideprivatevirtualnoexcept

Removes any linked LinkedObjectWrapper and updates LinkedObjectState.

Implements DynExp::LinkedObjectWrapperContainerBase.

Definition at line 3220 of file Object.h.

◆ SetLinkedObjWrapperPtr()

template<typename ObjectT >
void DynExp::LinkedObjectWrapperContainer< ObjectT >::SetLinkedObjWrapperPtr ( LinkedObjectWrapperPointer< ObjectT >  NewLinkedObjWrapperPtr)
inlineprivatenoexcept

Sets LinkedObjWrapperPtr to a new destination and updates LinkedObjectWrapperContainerBase::LinkedObjectState.

Parameters
NewLinkedObjWrapperPtrPointer to a LinkedObjectWrapper as a new destination

Definition at line 3270 of file Object.h.

◆ valid()

template<typename ObjectT >
bool DynExp::LinkedObjectWrapperContainer< ObjectT >::valid ( ) const
inlinenoexcept

Checks whether LinkedObjWrapperPtr points to a valid distination.

Returns
Returns true if LinkedObjWrapperPtr is not nullptr, false otherwise.

Definition at line 3216 of file Object.h.

Friends And Related Function Documentation

◆ RunnableInstance

template<typename ObjectT >
friend class RunnableInstance
friend

Definition at line 3161 of file Object.h.

Member Data Documentation

◆ LinkedObjWrapperPtr

template<typename ObjectT >
LinkedObjectWrapperPointer<ObjectT> DynExp::LinkedObjectWrapperContainer< ObjectT >::LinkedObjWrapperPtr
private

Pointer to a LinkedObjectWrapper instance holding a pointer to the destiny object instance of type const ObjectT.

Definition at line 3282 of file Object.h.

◆ PerformReadyCheck

template<typename ObjectT >
const bool DynExp::LinkedObjectWrapperContainer< ObjectT >::PerformReadyCheck
private

Determines whether a call to get() checks the return value of Object::IsReady() before returning LinkedObjWrapperPtr.

Definition at line 3288 of file Object.h.


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