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 {
130 virtual void _share(
void) = 0;
132 virtual void _unshare(
void) = 0;
177 inline operator bool()
const {
191 void exclusive(
void);
205 virtual void share(
void);
214 virtual void exclusive(
void);
259 inline operator bool()
const {
273 void exclusive(
void);
282 class autoexclusive :
private ExclusiveProtocol::Locking
285 __DELETE_DEFAULTS(autoexclusive);
288 inline autoexclusive(T *lock) :
289 Locking(polystatic_cast<ExclusiveProtocol *>(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 A kind of smart pointer object to support shared locking protocol.
Locking(SharedProtocol *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.
bool operator!() const
Test if the reference holds an active lock.
bool operator!() const
Test if the reference holds an active lock.
Various miscellaneous platform specific headers and defines.
Common namespace for all ucommon objects.
An exclusive locking access interface base.
T copy(const T &src)
Convenience function to copy objects.
Abstract interfaces and support.
A kind of smart pointer object to support shared locking protocol.
A kind of smart pointer object to support exclusive locking protocol.