ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lang::OwnerTimed< TOwnable > Class Template Reference

Description:

template<typename TOwnable>
class alib::lang::OwnerTimed< TOwnable >

Similar to class Owner, but calls method TryAcquireTimed instead of Acquire. The result is retrievable with method IsOwning().

See also
Chapter 3.3.1 Class Owner And Its Siblings of the Programmer's Manual of module ALib Threads
Template Parameters
TOwnableThe type to own. Requirements are to have methods TryAcquireTimed and Release available.

Definition at line 149 of file owner.inl.

Collaboration diagram for alib::lang::OwnerTimed< TOwnable >:
[legend]

Public Method Index:

template<typename TTimeValue>
 OwnerTimed (TOwnable &ownable, const TTimeValue &time, const CallerInfo &ci)
 
 ~OwnerTimed ()
 Destructor. Invokes Release() on member owned.
 
bool IsOwning () const noexcept
 

Protected Field Index:

CallerInfo dbgCI
 Caller information. Available only with debug-builds.
 
bool isOwning
 The result of the call to TryAcquire.
 
TOwnable & owned
 The resource to acquire and release.
 

Field Details:

◆ dbgCI

template<typename TOwnable>
CallerInfo alib::lang::OwnerTimed< TOwnable >::dbgCI
protected

Caller information. Available only with debug-builds.

Definition at line 157 of file owner.inl.

◆ isOwning

template<typename TOwnable>
bool alib::lang::OwnerTimed< TOwnable >::isOwning
protected

The result of the call to TryAcquire.

Definition at line 155 of file owner.inl.

◆ owned

template<typename TOwnable>
TOwnable& alib::lang::OwnerTimed< TOwnable >::owned
protected

The resource to acquire and release.

Definition at line 154 of file owner.inl.

Constructor(s) / Destructor Details:

◆ OwnerTimed()

template<typename TOwnable>
template<typename TTimeValue>
alib::lang::OwnerTimed< TOwnable >::OwnerTimed ( TOwnable & ownable,
const TTimeValue & time,
const CallerInfo & ci )
inline

Constructor. Invokes TryAcquire() on member owned.

Template Parameters
TTimeValueType of time parameter accepted with construction and passed to method TOwnable::TryAcquireTimed.
Usually this is type Ticks or Ticks::Duration.
Parameters
ownableThe ownable to acquire.
timeThe duration to wait for, or point in time to wait until.
ciCaller information.

Definition at line 196 of file owner.inl.

◆ ~OwnerTimed()

template<typename TOwnable>
alib::lang::OwnerTimed< TOwnable >::~OwnerTimed ( )
inline

Destructor. Invokes Release() on member owned.

Definition at line 207 of file owner.inl.

Method Details:

◆ IsOwning()

template<typename TOwnable>
bool alib::lang::OwnerTimed< TOwnable >::IsOwning ( ) const
inlinenoexcept
Returns
true if the try to acquire the owned with construction of this type was successful, false otherwise.

Definition at line 211 of file owner.inl.


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