OpendTect  6.3
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CallBacker Class Reference

Inherit from this class to be able to send and/or receive CallBacks. More...

Inherited by Attrib::DescSet, CBCapsule< PLT >, CmdDrive::Activator, CmdDrive::CmdComposer, CmdDrive::CmdDriver, CmdDrive::CmdRecorder, CmdDrive::uiCmdDriverMgr, DataPackMgr, DataPointSetDisplayMgr, EM::EMManager, EM::EMObject, EM::Fault3DPainter, EM::FaultStickPainter, EM::FaultStickSetFlatViewEditor, EM::HorizonPainter2D, EM::HorizonPainter3D, EM::HorizonPreLoader, EM::HorizonZTransform, EM::SurfaceGeometry, ExplicitMarchingCubesSurface, File::Monitor, FlatView::AuxDataEditor, FlatView::DataDispPars::Common, FlatView::Sower, FlatView::uiAuxDataDisplay, Geometry::Element, Geometry::ElementEditor, Geometry::ExplFaultStickSurface, Geometry::ExplicitIndexedShape, Geometry::ExplPlaneIntersection, Geometry::ExplPolygonSurface, Geometry::RandomLine::ChangeData, Geometry::RandomLineManager, GestureEventHandler, HorizonTimer, i_QPtrImpl, JobCommunic, JobIOMgr, KeyboardEventHandler, MarchingCubesSurface, MeasureToolMan, MenuItemHandler, MenuItemHolder, Monitorable, MouseCursorExchange, MouseEventHandler, MPE::EMSeedPicker, MPE::Engine, MPE::HorizonFlatViewEditor, MPE::HorizonFlatViewEditor2D, MPE::HorizonFlatViewEditor3D, MPE::HorizonTrackerMgr, MPE::ObjectEditor, MsgClass, NamedCallBacker, Network::HttpRequestManager, Network::HttpRequestProcess, Network::RequestConnection, Network::RequestServer, NotSavedPrompter, ObjDisposer, OD::AutoSaveObj, OD::AutoSaver, OD::PresentationManagedViewer, OD::VwrTypePresentationMgr, ODDLSite, ODGraphicsDynamicImageItem, PickRetriever, Pos::WellProvider3D, PosImpExpPars, PosInfo::Survey2D, PreStack::EventManager, PreStack::ProcessManager, RemCommHandler, RemoteJobExec, SignalHandling, Strat::LithologySet, Strat::UnitRef, TextTranslateMgr, Threads::WorkManager, Translator, uiApplPartServer, uiBaseMapObject, uiBitMapDisplay, uiColSeqSelTool, uiCrossHairItem, uiEventFilter, uiFlatViewColTabEd, uiFont, uiFontList, uiGenInputInputFld, uiGraphicsSceneAxisMgr, uiGVFreehandAreaSelectionTool, uiIOObjInserter, uiIOObjManipGroupSubj, uiListBoxChoiceIO, uiMouseEventBlockerByGestures, uiMPEMan, uiMsg, uiObjectItemViewAxisPainter, uiODApplMgr, uiODApplMgrAttrVisHandler, uiODApplMgrDispatcher, uiODFaultToolMan, uiODMenuMgr, uiShortcutsMgr, uiSlicePos, uiStratDispToTree, uiStratLayerModelManager, uiStratRefTree, uiStratTreeToDisp, uiStratViewControl, uiSystemTrayIcon, uiTextFile, uiTreeFactorySet, uiTreeItem, uiTreeViewItem, uiVarWizard, uiVisColTabEd, uiVisEMObject, uiWellDisplayControl, uiWindowGrabber, Undo, UserAction, Vel::FunctionSource, Vel::Picks, Vel::PicksMgr, visBase::DataManager, visBase::DataObject, visBase::HorizonSectionTile [private], visBase::NodeState, visBase::SelectionManager, visSurvey::SceneTransformManager, Vw2DDataManager, Vw2DDataObject, WellStratUnitGen, WellT2DTransform, WellTie::EventStretch, WellTie::PickSetMgr, WellTie::Server, and WellTie::uiTieView.

Public Member Functions

 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
virtual bool isCapsule () const
 
void stopReceivingNotifications () const
 

Static Public Member Functions

static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Protected Member Functions

void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 

Private Member Functions

bool notifyShutdown (const NotifierAccess *, bool wait) const
 

Private Attributes

ObjectSet< QCallBackEventReceiver > receivers_
 
Threads::Lock receiverslock_
 
ObjectSet< NotifierAccessattachednotifiers_
 
Threads::Lock attachednotifierslock_
 

Friends

class NotifierAccess
 

Detailed Description

Inherit from this class to be able to send and/or receive CallBacks.

Constructor & Destructor Documentation

CallBacker::CallBacker ( )
CallBacker::CallBacker ( const CallBacker )
virtual CallBacker::~CallBacker ( )
virtual

Member Function Documentation

bool CallBacker::attachCB ( const NotifierAccess ,
const CallBack ,
bool  onlyifnew = false 
) const

Adds cb to notifier, and makes sure it is removed later when object is deleted.

Returns
if it was attached.
bool CallBacker::attachCB ( const NotifierAccess notif,
const CallBack cb,
bool  onlyifnew = false 
) const
Note
Attaches only if
Parameters
notifis not null.
static void CallBacker::createReceiverForCurrentThread ( )
static

Must be called if you wish to send callbacks to this thread.

void CallBacker::detachAllNotifiers ( ) const
protected

Call from the destructor of your inherited object.

void CallBacker::detachCB ( const NotifierAccess ,
const CallBack  
) const
Note
Normally not needed if you don't want this explicitly.
void CallBacker::detachCB ( const NotifierAccess notif,
const CallBack cb 
) const
inline
Note
Detaches only if
Parameters
notifis not null.
virtual bool CallBacker::isCapsule ( ) const
inlinevirtual

Reimplemented in CBCapsule< PLT >.

bool CallBacker::isNotifierAttached ( const NotifierAccess ) const

Only for debugging purposes, don't use.

bool CallBacker::notifyShutdown ( const NotifierAccess ,
bool  wait 
) const
private
Returns
false only if wait and no lock could be obtained.
static void CallBacker::removeReceiverForCurrentThread ( )
static

Call from your thread before it closes if you have called createReceiverForCurrentThread() in the thread.

void CallBacker::stopReceivingNotifications ( ) const
inline

Friends And Related Function Documentation

friend class NotifierAccess
friend

Member Data Documentation

ObjectSet<NotifierAccess> CallBacker::attachednotifiers_
private
Threads::Lock CallBacker::attachednotifierslock_
mutableprivate
ObjectSet<QCallBackEventReceiver> CallBacker::receivers_
private
Threads::Lock CallBacker::receiverslock_
private

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