UCommon
Public Member Functions
ucommon::ExclusiveProtocol::Locking Class Reference

A kind of smart pointer object to support exclusive locking protocol. More...

#include <access.h>

Inherited by ucommon::autoexclusive< T > [private].

Public Member Functions

 Locking (ExclusiveProtocol *object)
 Create an instance of an exclusive object reference. More...
 
 operator bool () const
 Test if the reference holds an active lock. More...
 
bool operator! () const
 Test if the reference holds an active lock. More...
 
void release (void)
 Release a held lock programmatically. More...
 
 ~Locking ()
 Destroy reference to exclusively locked object, release lock.
 

Detailed Description

A kind of smart pointer object to support exclusive locking protocol.

This object initiates an exclusive lock for the object being referenced when it is instantiated, and releases the exclusive lock when it is destroyed. You would pass the pointer an object that has the Exclusive as a base class.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 72 of file access.h.

Constructor & Destructor Documentation

◆ Locking()

ucommon::ExclusiveProtocol::Locking::Locking ( ExclusiveProtocol object)

Create an instance of an exclusive object reference.

Parameters
objectcontaining Exclusive base class protocol to lock.

Member Function Documentation

◆ operator bool()

ucommon::ExclusiveProtocol::Locking::operator bool ( ) const
inline

Test if the reference holds an active lock.

Returns
true if locking an object.

Definition at line 103 of file access.h.

◆ operator!()

bool ucommon::ExclusiveProtocol::Locking::operator! ( ) const
inline

Test if the reference holds an active lock.

Returns
true if is not locking an object.

Definition at line 95 of file access.h.

◆ release()

void ucommon::ExclusiveProtocol::Locking::release ( void  )

Release a held lock programmatically.

This can be used to de-reference the object being exclusively locked without having to wait for the destructor to be called when the exclusive_lock falls out of scope.


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