DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp::LinkedObjectWrapperBase Class Referenceabstract

Polymorphic base class to allow storing LinkedObjectWrapper of any type in a single list. More...

+ Inheritance diagram for DynExp::LinkedObjectWrapperBase:

Classes

struct  OwnedLinkedObjectWrapperType
 Helper type linking a LinkedObjectWrapperBasePtrType to the corresponding LinkedObjectWrapperContainerBase instance. More...
 

Public Member Functions

 LinkedObjectWrapperBase (const RunnableInstance &Owner)
 Constructs a LinkedObjectWrapperBase instance. More...
 
virtual ~LinkedObjectWrapperBase ()=0
 
const ObjectGetOwner () const noexcept
 Returns the owner of this wrapper. More...
 
Override

Override by derived class.

virtual bool IsRegistered () const noexcept=0
 Returns whether the wrapper has registered its owning Object instance (through Owner) as a user of the target resource (refer to LinkedObjectWrapper::DestinyResource). More...
 
- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyableoperator= (const INonCopyable &)=delete
 

Private Types

using LinkedObjectWrapperBasePtrType = std::unique_ptr< LinkedObjectWrapperBase >
 Alias for a smart pointer owning instances of this class. More...
 
using ListType = std::list< OwnedLinkedObjectWrapperType >
 Type of a list hold by RunnableInstance (RunnableInstance::OwnedLinkedObjectWrappers) that contains pointers to all LinkedObjectWrapperBase instances and their corresponding containers the RunnableInstance instance owns. More...
 

Private Attributes

const RunnableInstanceOwner
 Instance of class RunnableInstance managing the wrapper. More...
 

Friends

class RunnableInstance
 

Override (methods for class RunnableInstance)

Override by derived class. Accessed directly by class RunnableInstance.

ListType::const_iterator ListPos
 Position of this wrapper instance in the list of LinkedObjectWrapperBase instances kept by the owning RunnableInstance instance Owner (refer to RunnableInstance::OwnedLinkedObjectWrappers). For std::list, iterators are not invalidaded upon insertion or erasure (for non-affected entries). More...
 
virtual void Register (const std::chrono::milliseconds Timeout)=0
 Registers the wrapper's owning Object instance (through Owner) as a user of the target resource (refer to LinkedObjectWrapper::DestinyResource). More...
 
virtual void Deregister (const std::chrono::milliseconds Timeout)=0
 Deregisters the wrapper's owning Object instance (through Owner) as a user of the target resource (refer to LinkedObjectWrapper::DestinyResource). More...
 

Additional Inherited Members

- Protected Member Functions inherited from Util::INonCopyable
constexpr INonCopyable ()=default
 
 ~INonCopyable ()=default
 

Detailed Description

Polymorphic base class to allow storing LinkedObjectWrapper of any type in a single list.

Definition at line 2707 of file Object.h.

Member Typedef Documentation

◆ LinkedObjectWrapperBasePtrType

Alias for a smart pointer owning instances of this class.

Definition at line 2715 of file Object.h.

◆ ListType

Type of a list hold by RunnableInstance (RunnableInstance::OwnedLinkedObjectWrappers) that contains pointers to all LinkedObjectWrapperBase instances and their corresponding containers the RunnableInstance instance owns.

Definition at line 2750 of file Object.h.

Constructor & Destructor Documentation

◆ LinkedObjectWrapperBase()

DynExp::LinkedObjectWrapperBase::LinkedObjectWrapperBase ( const RunnableInstance Owner)
inline

Constructs a LinkedObjectWrapperBase instance.

Parameters
OwnerRefer to Owner.

Definition at line 2757 of file Object.h.

◆ ~LinkedObjectWrapperBase()

DynExp::LinkedObjectWrapperBase::~LinkedObjectWrapperBase ( )
pure virtual

Definition at line 729 of file Object.cpp.

Member Function Documentation

◆ Deregister()

virtual void DynExp::LinkedObjectWrapperBase::Deregister ( const std::chrono::milliseconds  Timeout)
privatepure virtual

Deregisters the wrapper's owning Object instance (through Owner) as a user of the target resource (refer to LinkedObjectWrapper::DestinyResource).

Parameters
TimeoutTimeout of the mutex-locking operation in ObjectUserList

Implemented in DynExp::LinkedObjectWrapper< ObjectT >.

◆ GetOwner()

const Object & DynExp::LinkedObjectWrapperBase::GetOwner ( ) const
noexcept

Returns the owner of this wrapper.

Returns
Instance of Object which acts as a user of the wrapped Object instance

Definition at line 733 of file Object.cpp.

◆ IsRegistered()

virtual bool DynExp::LinkedObjectWrapperBase::IsRegistered ( ) const
pure virtualnoexcept

Returns whether the wrapper has registered its owning Object instance (through Owner) as a user of the target resource (refer to LinkedObjectWrapper::DestinyResource).

Returns
Returns true if already registered, false otherwise.

Implemented in DynExp::LinkedObjectWrapper< ObjectT >.

◆ Register()

virtual void DynExp::LinkedObjectWrapperBase::Register ( const std::chrono::milliseconds  Timeout)
privatepure virtual

Registers the wrapper's owning Object instance (through Owner) as a user of the target resource (refer to LinkedObjectWrapper::DestinyResource).

Parameters
TimeoutTimeout of the mutex-locking operation in ObjectUserList

Implemented in DynExp::LinkedObjectWrapper< ObjectT >.

Friends And Related Function Documentation

◆ RunnableInstance

friend class RunnableInstance
friend

Definition at line 2709 of file Object.h.

Member Data Documentation

◆ ListPos

ListType::const_iterator DynExp::LinkedObjectWrapperBase::ListPos
private

Position of this wrapper instance in the list of LinkedObjectWrapperBase instances kept by the owning RunnableInstance instance Owner (refer to RunnableInstance::OwnedLinkedObjectWrappers). For std::list, iterators are not invalidaded upon insertion or erasure (for non-affected entries).

Definition at line 2803 of file Object.h.

◆ Owner

const RunnableInstance& DynExp::LinkedObjectWrapperBase::Owner
private

Instance of class RunnableInstance managing the wrapper.

Definition at line 2809 of file Object.h.


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