OpendTect  6.3
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=0)
 
 ~NotifyStopper ()
 
void enableNotification ()
 
void disableNotification ()
 

Protected Member Functions

void setDisabled (bool)
 

Protected Attributes

NotifierAccessthenotif_
 
bool isdisabled_
 
const CallBackeronlyfor_
 

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.
}

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

Constructor & Destructor Documentation

NotifyStopper::NotifyStopper ( NotifierAccess ,
const CallBacker only_for = 0 
)
NotifyStopper::~NotifyStopper ( )

Member Function Documentation

void NotifyStopper::disableNotification ( )
void NotifyStopper::enableNotification ( )
void NotifyStopper::setDisabled ( bool  )
protected

Member Data Documentation

bool NotifyStopper::isdisabled_
protected
const CallBacker* NotifyStopper::onlyfor_
protected
NotifierAccess& NotifyStopper::thenotif_
protected

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