UCommon
|
A kind of smart pointer object to support shared locking protocol. More...
#include <access.h>
Inherited by ucommon::autoshared< T > [private]
.
Public Member Functions | |
void | exclusive (void) |
Call exclusive access on referenced objects protocol. | |
Locking (const Locking ©) | |
Locking (SharedProtocol *object) | |
Create an instance of an exclusive object reference. | |
operator bool () const | |
Test if the reference holds an active lock. | |
bool | operator! () const |
Test if the reference holds an active lock. | |
Locking & | operator= (const Locking ©) |
void | release (void) |
Release a held lock programmatically. | |
void | share (void) |
Restore shared access on referenced objects protocol. | |
~Locking () | |
Destroy reference to shared locked object, release lock. | |
A kind of smart pointer object to support shared locking protocol.
This object initiates a shared lock for the object being referenced when it is instantiated, and releases the shared lock when it is destroyed. You would pass the pointer an object that has the Shared as a base class.
ucommon::SharedProtocol::Locking::Locking | ( | SharedProtocol * | object | ) |
Create an instance of an exclusive object reference.
object | containing Exclusive base class protocol to lock. |
|
inline |
|
inline |
void ucommon::SharedProtocol::Locking::release | ( | void | ) |
Release a held lock programmatically.
This can be used to de-reference the object being share locked without having to wait for the destructor to be called when the shared_lock falls out of scope.