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

Go to the source code of this file.

Classes

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

Macros

#define mGetMonitoredChgData(cb, chgdata)   mCBCapsuleUnpack( Monitorable::ChangeData, chgdata, cb )
 
#define mGetMonitoredChgDataWithAux(cb, chgdata, T, auxvar)
 
#define mGetMonitoredChgDataWithCaller(cb, chgdata, caller)   mCBCapsuleUnpackWithCaller( Monitorable::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 >
Monitorable::ChangeType replaceMonitoredRef (ConstRefMan< Mon > &ref, const Mon *newptr, CallBacker *only_for)
 replaces a ref to a Monitorable with a new one. More...
 
template<class Mon >
Monitorable::ChangeType replaceMonitoredRef (ConstRefMan< Mon > &ref, const Mon &newref, CallBacker *only_for)
 
template<class Mon >
Monitorable::ChangeType replaceMonitoredRef (ConstRefMan< Mon > &ref, ConstRefMan< Mon > &newref, CallBacker *only_for)
 
template<class Mon >
Monitorable::ChangeType replaceMonitoredRef (RefMan< Mon > &ref, Mon *newptr, CallBacker *only_for)
 
template<class Mon >
Monitorable::ChangeType replaceMonitoredRef (RefMan< Mon > &ref, Mon &newref, CallBacker *only_for)
 
template<class Mon >
Monitorable::ChangeType replaceMonitoredRef (RefMan< Mon > &ref, RefMan< Mon > &newref, CallBacker *only_for)
 

Macro Definition Documentation

#define mGetIDFromChgData (   typ,
  var,
  chgdata 
)    const typ var = typ::get( (typ::IDType)chgdata.ID() )
#define mGetMonitoredChgData (   cb,
  chgdata 
)    mCBCapsuleUnpack( Monitorable::ChangeData, chgdata, cb )
#define mGetMonitoredChgDataDoAll (   cb,
  chgdata,
  doallact 
)
Value:
mGetMonitoredChgData(chgdata,cb); \
if ( chgdata.changeType() == Monitored::cEntireObjectChange() ) \
{ doallact; }
#define mGetMonitoredChgData(cb, chgdata)
Definition: monitorable.h:203
#define mGetMonitoredChgDataWithAux (   cb,
  chgdata,
  T,
  auxvar 
)
Value:
T* auxvar = chgdata.auxDataAs<T>()
#define mCBCapsuleUnpack(PayLoadType, var, cb)
Definition: callback.h:300
Definition: monitorable.h:113
#define mGetMonitoredChgDataWithAuxAndCaller (   cb,
  chgdata,
  T,
  auxvar,
  caller 
)
Value:
mGetMonitoredChgDataWithCaller(cb,chgdata,caller); \
T* auxvar = chgdata.auxDataAs<T>()
#define mGetMonitoredChgDataWithCaller(cb, chgdata, caller)
Definition: monitorable.h:210
#define mGetMonitoredChgDataWithCaller (   cb,
  chgdata,
  caller 
)    mCBCapsuleUnpackWithCaller( Monitorable::ChangeData, chgdata, caller, cb )

Function Documentation

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

replaces a ref to a Monitorable 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:

Monitorable::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.

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

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