OpendTect  6.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NotifyStopper Class Reference

Temporarily disables a Notifier. More...

Public Member Functions

 NotifyStopper (NotifierAccess &, const CallBacker *only_for=nullptr)
 
 ~NotifyStopper ()
 
void disable ()
 
void disableNotification ()
 
void enable ()
 
void enableNotification ()
 
void restore ()
 

Protected Member Functions

void setDisabled (bool)
 

Protected Attributes

bool isdisabled_
 
const CallBackeronlyfor_
 
NotifierAccessthenotif_
 

Detailed Description

Temporarily disables a Notifier.

Notifiers can be disabled. To do that temporarily, use NotifyStopper. If the Stopper goes out of scope, the callback is re-enabled. like:

void xxx:doSomething()
{
NotifyStopper stopper( a_notifier );
// Doing things that would otherwise trigger Notifier.
// On exit, Notifier gets re-enabled automatically.
}
Temporarily disables a Notifier.
Definition: notify.h:229

To stop notifications only to a certain object (usually 'this'), pass the object as 2nd argument to the constructor.

<>

Constructor & Destructor Documentation

◆ NotifyStopper()

NotifyStopper::NotifyStopper ( NotifierAccess ,
const CallBacker only_for = nullptr 
)

◆ ~NotifyStopper()

NotifyStopper::~NotifyStopper ( )

Member Function Documentation

◆ disable()

void NotifyStopper::disable ( )
inline

◆ disableNotification()

void NotifyStopper::disableNotification ( )

◆ enable()

void NotifyStopper::enable ( )
inline

◆ enableNotification()

void NotifyStopper::enableNotification ( )

◆ restore()

void NotifyStopper::restore ( )
inline

◆ setDisabled()

void NotifyStopper::setDisabled ( bool  )
protected

Member Data Documentation

◆ isdisabled_

bool NotifyStopper::isdisabled_
protected

◆ onlyfor_

const CallBacker* NotifyStopper::onlyfor_
protected

◆ thenotif_

NotifierAccess& NotifyStopper::thenotif_
protected

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