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

Description:

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

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

Definition at line 330 of file owner.hpp.

#include <owner.hpp>

Collaboration diagram for OwnerTryShared< TOwnable >:
[legend]

Public Method Index:

 OwnerTryShared (TOwnable &ownable, const CallerInfo &ci)
 
 ~OwnerTryShared ()
 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 338 of file owner.hpp.

◆ isOwning

template<typename TOwnable >
bool isOwning
protected

The result of the call to TryAcquire.

Definition at line 336 of file owner.hpp.

◆ owned

template<typename TOwnable >
TOwnable& owned
protected

The resource to acquire and release.

Definition at line 335 of file owner.hpp.

Constructor(s) / Destructor Details:

◆ OwnerTryShared()

template<typename TOwnable >
OwnerTryShared ( TOwnable & ownable,
const CallerInfo & ci )
inline

Constructor. Invokes TryAcquire() on member owned.

Parameters
ownableThe ownable to acquire.
ciCaller information.

Definition at line 359 of file owner.hpp.

◆ ~OwnerTryShared()

template<typename TOwnable >
~OwnerTryShared ( )
inline

Destructor. Invokes Release() on member owned.

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


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