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