OpendTect  6.3
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
OD::AutoSaver Class Reference

Auto-save manager. Singleton class. Works from its own thread. More...

Inheritance diagram for OD::AutoSaver:
[legend]

Public Member Functions

void setEmpty ()
 
Threads::Threadthread ()
 
- Public Member Functions inherited from CallBacker
 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 AutoSavergetInst ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Private Member Functions

mODTextTranslationClass(AutoSaver) public void setActive (bool yn=true)
 
bool useHiddenMode () const
 
void setUseHiddenMode (bool yn=true)
 
int nrSecondsBetweenSaves () const
 
void setNrSecondsBetweenSaves (int)
 
void add (const Saveable &)
 
bool restore (IOStream &, const char *newnm)
 
 AutoSaver ()
 
 ~AutoSaver ()
 
void remove (AutoSaveObj *)
 
void appExitCB (CallBacker *)
 
void svrDelCB (CallBacker *)
 
void survChgCB (CallBacker *)
 
void go ()
 
void handleSurvChg ()
 

Static Private Member Functions

static const char * sKeyAutosaved ()
 
static void goCB (CallBacker *)
 

Private Attributes

Notifier< AutoSaversaveDone
 
Notifier< AutoSaversaveFailed
 
Threads::Lock lock_
 
Threads::Threadthread_
 
ObjectSet< AutoSaveObjasobjs_
 
bool isactive_
 
bool usehiddenmode_
 
int curclockseconds_
 
int nrclocksecondsbetweensaves_
 
Threads::Atomic< bool > appexits_
 
Threads::Atomic< bool > surveychanges_
 

Friends

class AutoSaveObj
 

Additional Inherited Members

- Protected Member Functions inherited from CallBacker
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 

Detailed Description

Auto-save manager. Singleton class. Works from its own thread.

Auto-Save can work in 2 modes: Hidden or !Hidden (visible?). When visible, it will simply save as if user explicitly pressed a button or chose a menu item to save.

Hidden mode means it will make a hidden back-up that can be retrieved after an emergency (like power failure, server shutdown, maybe even an OpendTect crash (which never happens, but still :)) ).

The default is Hidden.

Constructor & Destructor Documentation

OD::AutoSaver::AutoSaver ( )
private
OD::AutoSaver::~AutoSaver ( )
private

Member Function Documentation

void OD::AutoSaver::add ( const Saveable )
private
void OD::AutoSaver::appExitCB ( CallBacker )
private
static AutoSaver& OD::AutoSaver::getInst ( )
static
void OD::AutoSaver::go ( )
private
static void OD::AutoSaver::goCB ( CallBacker )
inlinestaticprivate
void OD::AutoSaver::handleSurvChg ( )
private
int OD::AutoSaver::nrSecondsBetweenSaves ( ) const
private
void OD::AutoSaver::remove ( AutoSaveObj )
private
bool OD::AutoSaver::restore ( IOStream ,
const char *  newnm 
)
private
mODTextTranslationClass (AutoSaver) public void OD::AutoSaver::setActive ( bool  yn = true)
private
void OD::AutoSaver::setEmpty ( )
void OD::AutoSaver::setNrSecondsBetweenSaves ( int  )
private
void OD::AutoSaver::setUseHiddenMode ( bool  yn = true)
private
static const char* OD::AutoSaver::sKeyAutosaved ( )
staticprivate
void OD::AutoSaver::survChgCB ( CallBacker )
private
void OD::AutoSaver::svrDelCB ( CallBacker )
private
Threads::Thread& OD::AutoSaver::thread ( )
inline
bool OD::AutoSaver::useHiddenMode ( ) const
private

Friends And Related Function Documentation

friend class AutoSaveObj
friend

Member Data Documentation

Threads::Atomic<bool> OD::AutoSaver::appexits_
private
ObjectSet<AutoSaveObj> OD::AutoSaver::asobjs_
private
int OD::AutoSaver::curclockseconds_
private
bool OD::AutoSaver::isactive_
private
Threads::Lock OD::AutoSaver::lock_
mutableprivate
int OD::AutoSaver::nrclocksecondsbetweensaves_
private
Notifier<AutoSaver> OD::AutoSaver::saveDone
private
Notifier<AutoSaver> OD::AutoSaver::saveFailed
private
Threads::Atomic<bool> OD::AutoSaver::surveychanges_
private
Threads::Thread* OD::AutoSaver::thread_
private
bool OD::AutoSaver::usehiddenmode_
private

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