ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
OwnerSharedTimed< TOwnable > Class Template Reference

Description:

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

Similar to class Owner, but calls method TryAcquireSharedTimed instead of Acquire and ReleaseShared instead of Shared. 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 TryAcquireSharedTimed and ReleaseShared available.

Definition at line 386 of file owner.hpp.

#include <owner.hpp>

Collaboration diagram for OwnerSharedTimed< TOwnable >:
[legend]

Public Method Index:

template<typename TTimeValue >
 OwnerSharedTimed (TOwnable &ownable, const TTimeValue &time, const CallerInfo &ci)
 
 ~OwnerSharedTimed ()
 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 394 of file owner.hpp.

◆ isOwning

template<typename TOwnable >
bool isOwning
protected

The result of the call to TryAcquire.

Definition at line 392 of file owner.hpp.

◆ owned

template<typename TOwnable >
TOwnable& owned
protected

The resource to acquire and release.

Definition at line 391 of file owner.hpp.

Constructor(s) / Destructor Details:

◆ OwnerSharedTimed()

template<typename TOwnable >
template<typename TTimeValue >
OwnerSharedTimed ( 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
timeThe duration to wait for, or point in time to wait until.
ownableThe ownable to acquire.
ciCaller information.

Definition at line 421 of file owner.hpp.

◆ ~OwnerSharedTimed()

template<typename TOwnable >
~OwnerSharedTimed ( )
inline

Destructor. Invokes Release() on member owned.

Definition at line 432 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 436 of file owner.hpp.


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