A kind of smart pointer object to support shared locking protocol.
More...
#include <access.h>
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.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 224 of file access.h.
◆ shared_access() [1/2]
Create an instance of an exclusive object reference.
- Parameters
-
object | containing Exclusive base class protocol to lock. |
◆ shared_access() [2/2]
ucommon::shared_access::shared_access |
( |
const shared_access & |
copy | ) |
|
◆ ~shared_access()
ucommon::shared_access::~shared_access |
( |
| ) |
|
Destroy reference to shared locked object, release lock.
◆ exclusive()
void ucommon::shared_access::exclusive |
( |
void |
| ) |
|
Call exclusive access on referenced objects protocol.
◆ operator bool()
ucommon::shared_access::operator bool |
( |
| ) |
const |
|
inline |
Test if the reference holds an active lock.
- Returns
- true if locking an object.
Definition at line 259 of file access.h.
◆ operator!()
bool ucommon::shared_access::operator! |
( |
| ) |
const |
|
inline |
Test if the reference holds an active lock.
- Returns
- true if is not locking an object.
Definition at line 251 of file access.h.
◆ operator=()
◆ release()
void ucommon::shared_access::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.
◆ share()
void ucommon::shared_access::share |
( |
void |
| ) |
|
Restore shared access on referenced objects protocol.
◆ lock
◆ modify
bool ucommon::shared_access::modify |
|
private |
◆ state
int ucommon::shared_access::state |
|
private |
The documentation for this class was generated from the following file: