Go to the documentation of this file.
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) :
293 class 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
~Locking()
Destroy reference to exclusively locked object, release lock.
bool operator!() const
Test if the reference holds an active lock.
T copy(const T &src)
Convenience function to copy objects.
void release(void)
Release a held lock programmatically.
~shared_access()
Destroy reference to shared locked object, release lock.
Locking(SharedProtocol *object)
Create an instance of an exclusive object reference.
~Locking()
Destroy reference to shared locked object, release lock.
virtual void exclusive(void)
Convert object to an exclusive lock.
virtual void _share(void)=0
Access interface to share lock the object.
A kind of smart pointer object to support shared locking 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.
void exclusive(void)
Call exclusive access on referenced objects protocol.
An exclusive locking access interface base.
void share(void)
Restore shared access on referenced objects protocol.
shared_access(SharedProtocol *object)
Create an instance of an exclusive object reference.
virtual void share(void)
Share the lock with other referencers.
Various miscellaneous platform specific headers and defines.
Common namespace for all ucommon objects.
Locking(ExclusiveProtocol *object)
Create an instance of an exclusive object reference.
An exclusive locking protocol interface base.
bool operator!() const
Test if the reference holds an active lock.
A kind of smart pointer object to support shared locking protocol.
Abstract interfaces and support.
void release(void)
Release a held lock programmatically.
void share(void)
Restore shared access on referenced objects protocol.
A kind of smart pointer object to support exclusive locking protocol.