36 #ifndef _UCOMMON_ACCESS_H_
37 #define _UCOMMON_ACCESS_H_
39 #ifndef _UCOMMON_CPR_H_
43 #ifndef _UCOMMON_PROTOCOLS_H_
60 virtual void _unlock(
void) = 0;
74 virtual void _lock(
void) = 0;
106 virtual void _share(
void) = 0;
115 virtual void share(
void);
126 inline void shared_lock(
void) {
130 inline void release_share(
void) {
173 inline operator bool()
const {
227 inline operator bool()
const {
255 object.exclusive_lock();
264 object.release_exclusive();
273 object.shared_lock();
282 object.release_share();
336 #define exclusive_object() exlock_t __autolock__ = this
337 #define protected_object() shlock_t __autolock__ = this
338 #define exclusive_locking(x) exlock_t __autolock__ = &x
339 #define protected_locking(x) shlock_t __autolock__ = &x
void access(SharedAccess &object)
Convenience function to access (lock) shared object through it's protocol.
void exclusive(SharedAccess &object)
Convenience function to exclusive lock shared object through it's protocol.
bool operator!() const
Test if the reference holds an active lock.
void release(SharedAccess &object)
Convenience function to unlock shared object through it's protocol.
A kind of smart pointer object to support exclusive locking protocol.
Various miscellaneous platform specific headers and defines.
void release(void)
Release a held lock programmatically.
An exclusive locking access interface base.
ObjectProtocol * copy(ObjectProtocol *object)
Convenience function to access object copy.
void modify(accesslock_t &lock)
Convenience function to exclusively schedule conditional access.
void exclusive_lock(void)
Access interface to exclusive lock the object.
exclusive_access exlock_t
Convenience type to use for object referencing an exclusive object.
shared_access shlock_t
Convenience type to use for object referencing a shared object.
Common unlock protocol for locking protocol interface classes.
Common namespace for all ucommon objects.
bool operator!() const
Test if the reference holds an active lock.
void lock(ExclusiveAccess &object)
Convenience function to exclusively lock an object through it's protocol.
void release_exclusive(void)
Access interface to release a lock.
An exclusive locking protocol interface base.
void unlock(ExclusiveAccess &object)
Convenience function to unlock an exclusive object through it's protocol.
Abstract interfaces and support.
void share(SharedAccess &object)
Convenience function to restore shared locking for object through it's protocol.
void release(void)
Release a held lock programmatically.
A kind of smart pointer object to support shared locking protocol.