|
| #define | mImplSimpleMonitoredGet(fnnm, typ, memb) typ fnnm() const { return getMemberSimple( memb ); } |
| | Defines simple MT-safe copyable member get. More...
|
| |
| #define | mImplSimpleMonitoredSet(fnnm, typ, memb, chgtyp) |
| | Defines simple MT-safe copyable member change. More...
|
| |
| #define | mImplSimpleMonitoredGetSet(pfx, fnnmget, fnnmset, typ, memb, chgtyp) |
| | Defines simple MT-safe copyable member access. More...
|
| |
| #define | mLockMonitorable4Read(obj) Monitorable::AccessLocker accesslocker_( obj ) |
| |
| #define | mLockMonitorable4Write(obj) Monitorable::AccessLocker accesslocker_( obj, false ) |
| |
| #define | mMonitorableLock2Write(obj) accesslocker_.convertToWrite() |
| |
| #define | mMonitorableReLock(obj) accesslocker_.reLock() |
| |
| #define | mMonitorableUnlockAllAccess(obj) accesslocker_.unlockNow() |
| |
| #define | mMonitorableAccessLocker(obj) accesslocker_ |
| |
| #define | mSendMonitorableChgNotif(obj, typ, id) (obj).sendChgNotif(accesslocker_,typ,id) |
| |
| #define | mSendMonitorableEntireObjChgNotif(obj) |
| |
| #define | mLock4Read() mLockMonitorable4Read(*this) |
| |
| #define | mLock4Write() mLockMonitorable4Write(*this) |
| |
| #define | mLock2Write() mMonitorableLock2Write(*this) |
| |
| #define | mReLock() mMonitorableReLock(*this) |
| |
| #define | mUnlockAllAccess() mMonitorableUnlockAllAccess(*this) |
| |
| #define | mAccessLocker() mMonitorableAccessLocker(*this) |
| |
| #define | mSendChgNotif(typ, id) mSendMonitorableChgNotif(*this,typ,id) |
| |
| #define | mSendEntireObjChgNotif() mSendMonitorableEntireObjChgNotif(*this) |
| |
| #define | mDeclGenMonitorableAssignment(clss) |
| |
| #define | mDeclAbstractMonitorableAssignment(clss) mDeclGenMonitorableAssignment(clss) |
| | Monitorable subclasses: assignment and comparison. More...
|
| |
| #define | mDeclMonitorableAssignment(clss) |
| | like mDeclAbstractMonitorableAssignment but for non-abstract subclasses. Implements the clone() method. More...
|
| |
| #define | mImplEmptyMonitorableCopyClassData(clssnm) |
| |
| #define | mImplAlwaysDifferentMonitorableCompareClassData(clssnm) |
| |
| #define | mImplEmptyMonitorableCompare(clssnm) |
| |
| #define | mGenImplMonitorableAssignment(pfx, clss, baseclss) |
| | Implementation of assignment and comparison methods for Monitorable's. More...
|
| |
| #define | mImplMonitorableAssignment(clss, baseclss) mGenImplMonitorableAssignment(,clss,baseclss) |
| |
| #define | mImplMonitorableAssignmentWithNoMembers(clss, baseclss) |
| |
| #define | mStartMonitorableCompare() ChangeType chgtype = cNoChange() |
| | Helper macro to easily implement your compareClassData() in standard situations. More...
|
| |
| #define | mHandleMonitorableCompare(memb, val) |
| |
| #define | mHandleMonitorableComparePtrContents(memb, val) |
| |
| #define | mDeliverMonitorableCompare() return chgtype; |
| |
| #define | mDeliverSingCondMonitorableCompare(nochgcond, chgtype) return (nochgcond) ? cNoChange() : chgtype |
| | Helper macro to implement a simple yes/no change compareClassData() More...
|
| |
| #define | mDeliverYesNoMonitorableCompare(nochgcond) mDeliverSingCondMonitorableCompare( nochgcond, cEntireObjectChange() ) |
| | Helper macro to implement a simple yes/no change compareClassData() More...
|
| |
Monitorable subclasses: assignment and comparison.
Declares assignment method that will emit notifications, by default 'Entire Object'. Because of the locking, assignment operators are essential. These will need to copy both the 'own' members aswell as base class members, and emit the notification afterwards. For this, you have to implement a function that copies only the class' own data (unlocked): void copyClassData(const clss&).
To be able to provide more fine-grained notifications than always 'Entire Object Changed', you also have to provide a method compareClassData(). in this way we also define the equality operators (== and !=).
The stuff with clone() vs getClone() is because of Windows, and my obsession to make clone() return a pointer to the actual class.
| #define mGenImplMonitorableAssignment |
( |
|
pfx, |
|
|
|
clss, |
|
|
|
baseclss |
|
) |
| |
Implementation of assignment and comparison methods for Monitorable's.
you have to implement the copyClassData and compareClassData functions yourself. These functions are calles in a locked state, so do not use locking member functions.
void MyClass::copyClassData( const MyClass& oth ) { x_ = oth.x_; y_ = oth.y_; } bool MyClass::compareClassData( const MyClass& oth ) const { if ( x_ != oth.x_ ) return cXChanged(); if ( y_ != oth.y_ ) return cYChanged(); return cNoChange(); }
For standard situations, there are macros to help you implement the compareClassData function.
Usually, you can use the mImplMonitorableAssignment macro.