ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 159 of file owner.hpp.

#include <owner.hpp>

Collaboration diagram for 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 dbgCI
protected

Caller information. Available only with debug-builds.

Definition at line 167 of file owner.hpp.

◆ isOwning

template<typename TOwnable >
bool isOwning
protected

The result of the call to TryAcquire.

Definition at line 165 of file owner.hpp.

◆ owned

template<typename TOwnable >
TOwnable& owned
protected

The resource to acquire and release.

Definition at line 164 of file owner.hpp.

Constructor(s) / Destructor Details:

◆ OwnerTimed()

template<typename TOwnable >
template<typename TTimeValue >
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 206 of file owner.hpp.

◆ ~OwnerTimed()

template<typename TOwnable >
~OwnerTimed ( )
inline

Destructor. Invokes Release() on member owned.

Definition at line 217 of file owner.hpp.

Method Details:

◆ IsOwning()

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

Definition at line 221 of file owner.hpp.


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