DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
DynExp::LinkedObjectWrapperBase Class Referenceabstract

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

#include <Object.h>

+ 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.
 
virtual ~LinkedObjectWrapperBase ()=0
 
const Object & GetOwner () const noexcept
 Returns the owner of this wrapper.
 
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).
 
- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyable & operator= (const INonCopyable &)=delete
 

Private Types

using LinkedObjectWrapperBasePtrType = std::unique_ptr< LinkedObjectWrapperBase >
 Alias for a smart pointer owning instances of this class.
 
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.
 

Private Attributes

const RunnableInstance & Owner
 Instance of class RunnableInstance managing the wrapper.
 

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).
 
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).
 
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).
 

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 2723 of file Object.h.

Member Typedef Documentation

◆ LinkedObjectWrapperBasePtrType

Alias for a smart pointer owning instances of this class.

Definition at line 2731 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 2766 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 2773 of file Object.h.

◆ ~LinkedObjectWrapperBase()

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

Definition at line 736 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 740 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 Symbol Documentation

◆ RunnableInstance

friend class RunnableInstance
friend

Definition at line 2725 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 2819 of file Object.h.

◆ Owner

const RunnableInstance& DynExp::LinkedObjectWrapperBase::Owner
private

Instance of class RunnableInstance managing the wrapper.

Definition at line 2825 of file Object.h.


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