ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
![]() ![]() |
#include <access.h>
Public Member Functions | |
Locking (SharedProtocol *object) | |
Locking (const Locking ©) | |
Locking & | operator= (const Locking ©) |
~Locking () | |
bool | operator! () const |
operator bool () const | |
void | release (void) |
void | exclusive (void) |
void | share (void) |
Private Attributes | |
SharedProtocol * | lock |
int | state |
bool | modify |
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. |
Definition at line 41 of file access.cpp.
References ucommon::SharedProtocol::_share(), lock, modify, and state.
ucommon::SharedProtocol::Locking::Locking | ( | const Locking & | copy | ) |
Definition at line 50 of file access.cpp.
References ucommon::copy().
ucommon::SharedProtocol::Locking::~Locking | ( | ) |
Destroy reference to shared locked object, release lock.
Definition at line 81 of file access.cpp.
void ucommon::SharedProtocol::Locking::exclusive | ( | void | ) |
Call exclusive access on referenced objects protocol.
Definition at line 119 of file access.cpp.
|
inline |
|
inline |
SharedProtocol::Locking & ucommon::SharedProtocol::Locking::operator= | ( | const Locking & | copy | ) |
Definition at line 61 of file access.cpp.
References ucommon::copy().
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.
Definition at line 100 of file access.cpp.
void ucommon::SharedProtocol::Locking::share | ( | void | ) |
Restore shared access on referenced objects protocol.
Definition at line 127 of file access.cpp.
|
private |
|
private |
|
private |