36#ifndef _UCOMMON_ACCESS_H_
37#define _UCOMMON_ACCESS_H_
39#ifndef _UCOMMON_CPR_H_
43#ifndef _UCOMMON_PROTOCOLS_H_
60 virtual void _lock(
void) = 0;
62 virtual void _unlock(
void) = 0;
103 inline operator bool()
const {
132 virtual void _unshare(
void) = 0;
177 inline operator bool()
const {
259 inline operator bool()
const {
285 __DELETE_DEFAULTS(autoexclusive);
288 inline autoexclusive(T *lock) :
293class autoshared :
private SharedProtocol::Locking
296 __DELETE_DEFAULTS(autoshared);
299 inline autoshared(T *lock) :
300 Locking(polystatic_cast<SharedProtocol *>(lock)) {};
308#define __EXCLUSIVE(x) exclusive_access __autolock__ = x
309#define __SHARE(x) shared_access __autolock__ = x
Various miscellaneous platform specific headers and defines.
Abstract interfaces and support.
Common namespace for all ucommon objects.
An exclusive locking protocol interface base.
A kind of smart pointer object to support exclusive locking protocol.
~Locking()
Destroy reference to exclusively locked object, release lock.
void release(void)
Release a held lock programmatically.
bool operator!() const
Test if the reference holds an active lock.
Locking(ExclusiveProtocol *object)
Create an instance of an exclusive object reference.
An exclusive locking access interface base.
virtual void share(void)
Share the lock with other referencers.
virtual void _share(void)=0
Access interface to share lock the object.
virtual void exclusive(void)
Convert object to an exclusive lock.
A kind of smart pointer object to support shared locking protocol.
Locking(SharedProtocol *object)
Create an instance of an exclusive object reference.
~Locking()
Destroy reference to shared locked object, release lock.
void share(void)
Restore shared access on referenced objects protocol.
void exclusive(void)
Call exclusive access on referenced objects protocol.
bool operator!() const
Test if the reference holds an active lock.
void release(void)
Release a held lock programmatically.
A kind of smart pointer object to support shared locking protocol.
void share(void)
Restore shared access on referenced objects protocol.
void exclusive(void)
Call exclusive access on referenced objects protocol.
bool operator!() const
Test if the reference holds an active lock.
shared_access(SharedProtocol *object)
Create an instance of an exclusive object reference.
void release(void)
Release a held lock programmatically.
~shared_access()
Destroy reference to shared locked object, release lock.