OpendTect 8.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public 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...

#include <callback.h>

Inherited by ActiveProcPrompter, ApplicationData, Attrib::DescSet, BatchProgramTracker, CBCapsule< T >, CmdDrive::Activator, CmdDrive::CmdComposer, CmdDrive::CmdDriver, CmdDrive::CmdRecorder, CmdDrive::uiCmdDriverMgr, ColTab::MapperSetup, ColTab::SeqMgr, DataPackMgr, DataPointSetDisplayMgr, EM::EMManager, EM::Fault3DPainter, EM::FaultStickPainter, EM::FaultStickSetFlatViewEditor, EM::HorizonPainter2D, EM::HorizonPainter3D, EM::HorizonPreLoader, EM::SurfaceGeometry, ExplicitMarchingCubesSurface, FileSystemWatcher, FlatView::AuxDataEditor, FlatView::Sower, FlatView::uiAuxDataDisplay, Geom2DInit, Geometry::Element, Geometry::ElementEditor, Geometry::ExplFaultStickSurface, Geometry::ExplPlaneIntersection, Geometry::ExplPolygonSurface, Geometry::ExplicitIndexedShape, Geometry::RandomLine::ChangeData, Geometry::RandomLineManager, GestureEventHandler, JobCommunic, JobIOMgr, KeyboardEventHandler, LogCubeCreator::WellData, MPE::EMSeedPicker, MPE::EMTracker, MPE::Engine, MPE::HorizonFlatViewEditor, MPE::HorizonFlatViewEditor2D, MPE::HorizonFlatViewEditor3D, MPE::HorizonTrackerMgr, MeasureToolMan, MenuItemHandler, MenuItemHolder, MnemonicSet, MonitoredObject, MouseCursorExchange, MouseEventHandler, MsgClass, NamedCallBacker, Network::HttpRequestManager, Network::RequestConnection, Network::RequestServer, Network::Server, Network::Socket, NotFinishedPrompter, NotSavedPrompter, OD::PythonAccess, ODDLSite, ODGraphicsDynamicImageItem, ObjDisposer, Pick::SetMgr::BulkChangeData, Pick::SetMgr::ChangeData, PluginManager, Pos::WellProvider3D, PosImpExpPars, PosInfo::Survey2D, PreStack::ProcessManager, PreStackView::uiViewer3DMgr, Property, RemCommHandler, RemoteJobExec, SEGY::FilePars, Seis::PreLoadDataManager, SeisRandomProvider, SignalHandling, Strat::LayerGenerator, Strat::LevelSetMgr, Strat::LithologySet, Strat::UnitRef, StratSynth::DataMgr, Survey::GeometryManager, TextTranslateMgr, Threads::WorkManager, Translator, Undo, UserAction, Vel::PicksMgr, View2D::DataManager, Well::LogSet, Well::Man, WellFileList, WellStratUnitGen, WellTie::EventStretch, WellTie::PickSetMgr, WellTie::Server, WellTie::WellDataMgr, WellTie::uiTieView, WellUpdateQueue, i_QPtrImpl, uiAction, uiApplMgr, uiApplPartServer, uiBasemapObject, uiBitMapDisplay, uiColorTable, uiCrossHairItem, uiEventFilter, uiFlatViewColTabEd, uiFont, uiFontList, uiGVFreehandAreaSelectionTool, uiGenInputInputFld, uiGraphicsItem, uiGraphicsSceneAxisMgr, uiIOObjInserter, uiIOObjManipGroupSubj, uiListBoxChoiceIO, uiMPEMan, uiMain, uiMouseEventBlockerByGestures, uiMultiMapperRangeEditWin::MapperData, uiODApplMgrAttrVisHandler, uiODApplMgrDispatcher, uiODFaultToolMan, uiODLangMenuMgr, uiODMenuMgr, uiODSceneMgr, uiODViewer2D, uiODViewer2DMgr, uiObjectItemViewAxisPainter, uiPickSetMgr, uiPluginInitMgr, uiSEGYTool, uiSettingsMgr, uiShortcutsMgr, uiSlicePos, uiStratDispToTree, uiStratLayerModelManager, uiStratRefTree, uiStratTreeToDisp, uiStratViewControl, uiSystemTrayIcon, uiTextFile, uiTreeFactorySet, uiTreeItem, uiTreeViewItem, uiTreeViewItemIterator, uiUserShowWait, uiVarWizard, uiVisColTabEd, uiVisEMObject, uiWellDahDisplay::DahObjData, uiWellDefMnemLogDlg::Tables, uiWellDisplayControl, uiWindowGrabber, visBase::DataManager, visBase::HorizonSectionTile [private], visBase::SelectionManager, and visSurvey::SceneTransformManager.

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 detachAllNotifiers () const
 Call from the destructor of your inherited object.
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use.
 
CallBackeroperator= (const CallBacker &)=delete
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 

Static Public Member Functions

static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Private Member Functions

bool notifyShutdown (const NotifierAccess *, bool wait) const
 

Private Attributes

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() [1/2]

CallBacker::CallBacker ( )

◆ CallBacker() [2/2]

CallBacker::CallBacker ( const CallBacker & )

◆ ~CallBacker()

virtual CallBacker::~CallBacker ( )
virtual

Member Function Documentation

◆ attachCB() [1/2]

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.

◆ attachCB() [2/2]

bool CallBacker::attachCB ( const NotifierAccess * notif,
const CallBack & cb,
bool onlyifnew = false ) const
Note
Attaches only if notif is not null.

◆ createReceiverForCurrentThread()

static void CallBacker::createReceiverForCurrentThread ( )
static

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

◆ detachAllNotifiers()

void CallBacker::detachAllNotifiers ( ) const

Call from the destructor of your inherited object.

◆ detachCB() [1/2]

void CallBacker::detachCB ( const NotifierAccess & ,
const CallBack &  ) const
Note
Normally not needed if you don't want this explicitly.

◆ detachCB() [2/2]

void CallBacker::detachCB ( const NotifierAccess * notif,
const CallBack & cb ) const
inline
Note
Detaches only if notif is not null.

◆ isCapsule()

virtual bool CallBacker::isCapsule ( ) const
inlinevirtual

Reimplemented in CBCapsule< T >.

◆ isNotifierAttached()

bool CallBacker::isNotifierAttached ( const NotifierAccess * ) const

Only for debugging purposes, don't use.

◆ notifyShutdown()

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

◆ operator=()

CallBacker & CallBacker::operator= ( const CallBacker & )
delete

◆ removeReceiverForCurrentThread()

static void CallBacker::removeReceiverForCurrentThread ( )
static

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

◆ stopReceivingNotifications()

void CallBacker::stopReceivingNotifications ( ) const
inline

◆ trueCaller()

virtual CallBacker * CallBacker::trueCaller ( )
inlinevirtual

Reimplemented in CBCapsule< T >.

Friends And Related Symbol Documentation

◆ NotifierAccess

friend class NotifierAccess
friend

Member Data Documentation

◆ attachednotifiers_

ObjectSet<NotifierAccess> CallBacker::attachednotifiers_
private

◆ attachednotifierslock_

Threads::Lock CallBacker::attachednotifierslock_
mutableprivate

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