OpendTect  6.6
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...

Inherited by ApplicationData, Attrib::DescSet, Bouncy::BouncyController, CBCapsule< T >, CmdDrive::Activator, CmdDrive::CmdComposer, CmdDrive::CmdDriver, CmdDrive::CmdRecorder, CmdDrive::uiCmdDriverMgr, ColTab::MapperSetup, ColTab::SeqMgr, Coords::CoordSystem [private], DataPackMgr, DataPointSetDisplayMgr, EM::EMManager, EM::Fault3DPainter, EM::FaultStickPainter, EM::FaultStickSetFlatViewEditor, EM::HorizonPainter2D, EM::HorizonPainter3D, EM::HorizonPreLoader, EM::HorizonZTransform, EM::SurfaceGeometry, ExplicitMarchingCubesSurface, ExternalAttrib::RandomManager, FileSystemWatcher, FlatView::AuxDataEditor, FlatView::Sower, FlatView::uiAuxDataDisplay, 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::Engine, MPE::HorizonFlatViewEditor, MPE::HorizonFlatViewEditor2D, MPE::HorizonFlatViewEditor3D, MPE::HorizonTrackerMgr, MPE::ObjectEditor, MarchingCubesSurface, MeasureToolMan, MenuItemHandler, MenuItemHolder, MonitoredObject, MouseCursorExchange, MouseEventHandler, MsgClass, NamedCallBacker, Network::RequestConnection, Network::RequestServer, Network::Server, Network::Socket, NotSavedPrompter, OD::PythonAccess, ODDLSite, ODGraphicsDynamicImageItem, ODNetworkReply, ObjDisposer, Pick::SetMgr::BulkChangeData, Pick::SetMgr::ChangeData, PickRetriever, Pos::WellProvider3D, PosImpExpPars, PosInfo::Survey2D, PreStack::EventManager, PreStack::ProcessManager, PreStackView::uiViewer3DMgr, RemCommHandler, RemoteJobExec, Seis::PreLoadDataManager, SeisRandomProvider, SeisRandomRepository, ServerProgTool, SignalHandling, Strat::LevelSet, Strat::LithologySet, Strat::UnitRef, TextTranslateMgr, Threads::WorkManager, Translator, Undo, UserAction, Vel::FunctionSource, Vel::Picks, Vel::PicksMgr, VolProc::Manager, Vw2DDataManager, Vw2DDataObject, WellStratUnitGen, WellT2DTransform, WellTie::EventStretch, WellTie::PickSetMgr, WellTie::Server, WellTie::WellDataMgr, WellTie::uiTieView, i_QPtrImpl, uiAction, uiApplPartServer, uiBaseMapObject, uiBitMapDisplay, uiBouncy::uiBouncyMgr, uiColorTable, uiCrossHairItem, uiEventFilter, uiFlatViewColTabEd, uiFont, uiFontList, uiGVFreehandAreaSelectionTool, uiGenInputInputFld, uiGraphicsItem, uiGraphicsSceneAxisMgr, uiIOObjInserter, uiIOObjManipGroupSubj, uiListBoxChoiceIO, uiMPEMan, uiMain, uiMouseEventBlockerByGestures, uiODApplMgr, uiODApplMgrAttrVisHandler, uiODApplMgrDispatcher, uiODFaultToolMan, uiODLangMenuMgr, uiODMenuMgr, uiODSceneMgr, uiODViewer2D, uiODViewer2DMgr, uiObjectItemViewAxisPainter, uiPickSetMgr, uiPluginInitMgr, uiSEGYTool, uiSettingsMgr, uiShortcutsMgr, uiSlicePos, uiStratDispToTree, uiStratRefTree, uiStratTreeToDisp, uiStratViewControl, uiSystemTrayIcon, uiTextFile, uiTreeFactorySet, uiTreeItem, uiTreeViewItem, uiTreeViewItemIterator, uiVarWizard, uiVisColTabEd, uiVisEMObject, uiWellDahDisplay::DahObjData, uiWellDisplayControl, uiWindowGrabber, visBase::DataManager, visBase::HorizonSectionTile [private], visBase::NodeState, 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. More...
 
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. More...
 
void stopReceivingNotifications () const
 

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.

◆ 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

Friends And Related Function 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-2022