 |
OpendTect
6.6
|
Go to the documentation of this file.
95 {
return mSelf().chgnotif_; }
97 {
return mSelf().delnotif_; }
101 virtual void touch()
const { dirtycount_++; }
106 {
return ChangeData::cEntireObjectChgType(); }
108 {
return ChangeData::cNoChgType(); }
110 {
return ChangeData::cUnspecChgID(); }
112 {
return ChangeData::cUnspecChgID(); }
133 {
return ct == first || isEntireObject(); }
148 template<
class T>
inline
150 {
return static_cast<const T*
>( auxdata_.
ptr() ); }
151 template<
class T>
inline
153 {
return static_cast<T*
>( auxdata_.
ptr() ); }
172 void reLock(Locker::WaitType wt=Locker::WaitIfLocked);
200 { chgnotifblocklevel_++; }
204 inline T getMemberSimple(
const T&)
const;
205 template <
class TMember,
class TSetTo>
225 #define mGetMonitoredChgData(cb,chgdata) \
226 mCBCapsuleUnpack( MonitoredObject::ChangeData, chgdata, cb )
228 #define mGetMonitoredChgDataWithAux(cb,chgdata,T,auxvar) \
229 mCBCapsuleUnpack( MonitoredObject::ChangeData, chgdata, cb ); \
230 T* auxvar = chgdata.auxDataAs<T>()
232 #define mGetMonitoredChgDataWithCaller(cb,chgdata,caller) \
233 mCBCapsuleUnpackWithCaller( MonitoredObject::ChangeData, chgdata, caller, cb )
235 #define mGetMonitoredChgDataWithAuxAndCaller(cb,chgdata,T,auxvar,caller) \
236 mGetMonitoredChgDataWithCaller(cb,chgdata,caller); \
237 T* auxvar = chgdata.auxDataAs<T>()
239 #define mGetMonitoredChgDataDoAll(cb,chgdata,doallact) \
240 mGetMonitoredChgData(chgdata,cb); \
241 if ( chgdata.changeType() == Monitored::cEntireObjectChange() ) \
244 #define mGetIDFromChgData( typ, var, chgdata ) \
245 const typ var = typ::get( (typ::IDType)chgdata.ID() )
303 bool send_notif=
true);
338 template <
class Mon>
inline
342 const Mon* curptr = ref.
ptr();
343 if ( curptr == newptr )
347 if ( (newptr && !curptr) || (!newptr && curptr) )
349 else if ( curptr && newptr )
351 ct = curptr->compareWith( *newptr );
352 curptr->transferNotifsTo( *newptr, only_for );
359 template <
class Mon>
inline
366 template <
class Mon>
inline
373 template <
class Mon>
inline
381 template <
class Mon>
inline
388 template <
class Mon>
inline
Threads ::Locker Locker
Definition: monitoredobject.h:80
AccessLocker(const MonitoredObject &, bool forread=true)
IDType ID() const
Definition: monitoredobject.h:128
void sendEntireObjectChangeNotification() const
MonitoredObject::AccessLocker locker_
Definition: monitoredobject.h:285
Threads::Atomic< int > chgnotifblocklevel_
Definition: monitoredobject.h:211
#define mDeclInstanceCreatedNotifierAccess(clss)
Definition: notify.h:248
#define mUseType(scope, typ)
Definition: commondefs.h:146
virtual Notifier< MonitoredObject > & objectToBeDeleted() const
Definition: monitoredobject.h:96
void sendChgNotif(AccessLocker &, const ChangeData &) const
calls objectChanged with released lock
int64_t IDType
Definition: monitoredobject.h:85
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:289
#define od_int64
Definition: plftypes.h:35
MonitorLock(const MonitoredObject &)
protects a MonitoredObject against change.
Definition: monitoredobject.h:275
#define mExpClass(module)
Definition: commondefs.h:177
virtual ~MonitoredObject()
prevents change notifications coming out of a MonitoredObject.
Definition: monitoredobject.h:300
void stopChangeNotifications() const
Definition: monitoredobject.h:199
const MonitoredObject & obj_
Definition: monitoredobject.h:311
bool isEntireObject() const
Definition: monitoredobject.h:129
void reLock(Locker::WaitType wt=Locker::WaitIfLocked)
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
virtual DirtyCountType dirtyCount() const
Definition: monitoredobject.h:102
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
MonitoredObject(const MonitoredObject &)
int ChangeType
Definition: monitoredobject.h:84
bool delalreadytriggered_
Definition: monitoredobject.h:215
static IDType cUnspecChgID()
Definition: monitoredobject.h:137
virtual MonitoredObject * getClone() const =0
bool isNoChange() const
Definition: monitoredobject.h:130
static IDType cUnspecChgID()
Definition: monitoredobject.h:109
static ChangeType cNoChange()
Definition: monitoredobject.h:107
const T * auxDataAs() const
Definition: monitoredobject.h:149
ChangeType changeType() const
Definition: monitoredobject.h:127
ChangeData(ChangeType typ, IDType id, AuxData *data=0)
Definition: monitoredobject.h:120
ChangeDataNotifier chgnotif_
Definition: monitoredobject.h:213
virtual MonitoredObject * clone() const
Definition: monitoredobject.h:92
DirtyCounter dirtycount_
Definition: monitoredobject.h:210
virtual ChangeDataNotifier & objectChanged() const
Definition: monitoredobject.h:94
virtual ChangeType compareWith(const MonitoredObject &) const
const T * ptr() const
Definition: ptrman.h:100
static ChangeType cNoChgType()
Definition: monitoredobject.h:136
ChangeType compareClassData(const MonitoredObject &) const
ChangeNotifyBlocker(const MonitoredObject &, bool send_notif=true)
static ChangeType changeNotificationTypeOf(CallBacker *)
static void enableLocking(bool yn)
don't use unless you understand the implications
static ChangeType cEntireObjectChgType()
Definition: monitoredobject.h:135
static IDType cEntireObjectChgID()
Definition: monitoredobject.h:111
void copyAll(const MonitoredObject &)
bool unlocked_
Definition: monitoredobject.h:286
RefMan< AuxData > auxdata_
Definition: monitoredobject.h:147
Definition: monitoredobject.h:162
Locker * theLock()
Definition: monitoredobject.h:178
virtual ~ChangeData()
Definition: monitoredobject.h:124
MonitoredObject::ChangeType replaceMonitoredRef(ConstRefMan< Mon > &ref, const Mon *newptr, CallBacker *only_for)
replaces a ref to a MonitoredObject with a new one.
Definition: monitoredobject.h:339
bool includes(ChangeType ct) const
Definition: monitoredobject.h:132
virtual ~AuxData()
Definition: monitoredobject.h:144
ChangeData(const ChangeData &)
void transferNotifsTo(const MonitoredObject &, const CallBacker *onlyfor=0) const
Definition: fixedstreambuf.h:20
Definition: monitoredobject.h:115
#define mSelf()
Definition: commondefs.h:144
static ChangeData NoChange()
Definition: monitoredobject.h:139
Notifier< MonitoredObject > delnotif_
Definition: monitoredobject.h:214
void sendChgNotif(AccessLocker &, ChangeType, IDType) const
calls objectChanged with released lock
void sendDelNotif() const
bool hasUnspecID() const
Definition: monitoredobject.h:131
bool unblocked_
Definition: monitoredobject.h:312
void sendChangeNotification(const ChangeData &) const
const T * ptr() const
Definition: ptrman.h:82
Threads::Lock accesslock_
Definition: monitoredobject.h:191
T * auxDataAs()
Definition: monitoredobject.h:152
static ChangeData AllChanged()
Definition: monitoredobject.h:138
bool sendnotif_
Definition: monitoredobject.h:313
virtual void touch() const
Definition: monitoredobject.h:101
interface to threads that should be portable.
Definition: atomic.h:23
CNotifier< MonitoredObject, ChangeData > ChangeDataNotifier
Definition: monitoredobject.h:86
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class.
Definition: threadlock.h:53
Definition: monitoredobject.h:142
AccessLocker(const AccessLocker &)
Object that can be MT-safely monitored from cradle to grave.
Definition: monitoredobject.h:77
void resumeChangeNotifications() const
od_int64 DirtyCountType
Definition: commontypes.h:36
static ChangeType cEntireObjectChange()
Definition: monitoredobject.h:105
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021