OpendTect  6.6
Classes | Macros | Functions
monitoredobject.h File Reference
Include dependency graph for monitoredobject.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MonitoredObject
 Object that can be MT-safely monitored from cradle to grave. More...
 
class  MonitoredObject::ChangeData
 
class  MonitoredObject::ChangeData::AuxData
 
class  MonitoredObject::AccessLocker
 
class  MonitorLock
 protects a MonitoredObject against change. More...
 
class  ChangeNotifyBlocker
 prevents change notifications coming out of a MonitoredObject. More...
 

Macros

#define mGetMonitoredChgData(cb, chgdata)   mCBCapsuleUnpack( MonitoredObject::ChangeData, chgdata, cb )
 
#define mGetMonitoredChgDataWithAux(cb, chgdata, T, auxvar)
 
#define mGetMonitoredChgDataWithCaller(cb, chgdata, caller)   mCBCapsuleUnpackWithCaller( MonitoredObject::ChangeData, chgdata, caller, cb )
 
#define mGetMonitoredChgDataWithAuxAndCaller(cb, chgdata, T, auxvar, caller)
 
#define mGetMonitoredChgDataDoAll(cb, chgdata, doallact)
 
#define mGetIDFromChgData(typ, var, chgdata)   const typ var = typ::get( (typ::IDType)chgdata.ID() )
 

Functions

template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef (ConstRefMan< Mon > &ref, const Mon *newptr, CallBacker *only_for)
 replaces a ref to a MonitoredObject with a new one. More...
 
template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef (ConstRefMan< Mon > &ref, const Mon &newref, CallBacker *only_for)
 
template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef (ConstRefMan< Mon > &ref, ConstRefMan< Mon > &newref, CallBacker *only_for)
 
template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef (RefMan< Mon > &ref, Mon *newptr, CallBacker *only_for)
 
template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef (RefMan< Mon > &ref, Mon &newref, CallBacker *only_for)
 
template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef (RefMan< Mon > &ref, RefMan< Mon > &newref, CallBacker *only_for)
 

Macro Definition Documentation

◆ mGetIDFromChgData

#define mGetIDFromChgData (   typ,
  var,
  chgdata 
)    const typ var = typ::get( (typ::IDType)chgdata.ID() )

◆ mGetMonitoredChgData

#define mGetMonitoredChgData (   cb,
  chgdata 
)    mCBCapsuleUnpack( MonitoredObject::ChangeData, chgdata, cb )

◆ mGetMonitoredChgDataDoAll

#define mGetMonitoredChgDataDoAll (   cb,
  chgdata,
  doallact 
)
Value:
mGetMonitoredChgData(chgdata,cb); \
if ( chgdata.changeType() == Monitored::cEntireObjectChange() ) \
{ doallact; }

◆ mGetMonitoredChgDataWithAux

#define mGetMonitoredChgDataWithAux (   cb,
  chgdata,
  T,
  auxvar 
)
Value:
T* auxvar = chgdata.auxDataAs<T>()

◆ mGetMonitoredChgDataWithAuxAndCaller

#define mGetMonitoredChgDataWithAuxAndCaller (   cb,
  chgdata,
  T,
  auxvar,
  caller 
)
Value:
mGetMonitoredChgDataWithCaller(cb,chgdata,caller); \
T* auxvar = chgdata.auxDataAs<T>()

◆ mGetMonitoredChgDataWithCaller

#define mGetMonitoredChgDataWithCaller (   cb,
  chgdata,
  caller 
)    mCBCapsuleUnpackWithCaller( MonitoredObject::ChangeData, chgdata, caller, cb )

Function Documentation

◆ replaceMonitoredRef() [1/6]

template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef ( ConstRefMan< Mon > &  ref,
const Mon &  newref,
CallBacker only_for 
)
inline

◆ replaceMonitoredRef() [2/6]

template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef ( ConstRefMan< Mon > &  ref,
const Mon *  newptr,
CallBacker only_for 
)
inline

replaces a ref to a MonitoredObject with a new one.

If you hold a RefMan to a monitorable that you monitor, then you can replace the ref with another one and make sure you start monitoring the new one, and no longer the old one. Like in:

MonitoredObject::ChangeType ct = replaceMonitoredRef( sequence_, newseq, this );

Returns whether any change is made to your ref. It checks whether the new object is different from the old one.

If you have suscribers to an object that you own (and that others monitor through your ref) then you'll probably not want to pass 'this'. In that way all notifications are transferred to the new object. Note that this is a dangerous thing to do - some managing objects may depend on having notifiers on all objects they monitor.

◆ replaceMonitoredRef() [3/6]

template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef ( ConstRefMan< Mon > &  ref,
ConstRefMan< Mon > &  newref,
CallBacker only_for 
)
inline

◆ replaceMonitoredRef() [4/6]

template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef ( RefMan< Mon > &  ref,
Mon &  newref,
CallBacker only_for 
)
inline

◆ replaceMonitoredRef() [5/6]

template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef ( RefMan< Mon > &  ref,
Mon *  newptr,
CallBacker only_for 
)
inline

◆ replaceMonitoredRef() [6/6]

template<class Mon >
MonitoredObject::ChangeType replaceMonitoredRef ( RefMan< Mon > &  ref,
RefMan< Mon > &  newref,
CallBacker only_for 
)
inline
mGetMonitoredChgDataWithCaller
#define mGetMonitoredChgDataWithCaller(cb, chgdata, caller)
Definition: monitoredobject.h:232
mCBCapsuleUnpack
#define mCBCapsuleUnpack(PayLoadType, var, cb)
Definition: callback.h:294
MonitoredObject::ChangeData
Definition: monitoredobject.h:115
mGetMonitoredChgData
#define mGetMonitoredChgData(cb, chgdata)
Definition: monitoredobject.h:225

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021