NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CWorkspaceAutoSaver Class Reference

Search Toolkit Book for CWorkspaceAutoSaver

#include <gui/core/ws_auto_saver.hpp>

+ Inheritance diagram for CWorkspaceAutoSaver:
+ Collaboration diagram for CWorkspaceAutoSaver:

Public Types

enum  ERestoreMode { eAskUser , eRestore , eIgnore }
- Public Types inherited from CEventHandler
enum  EDispatch { eDispatch_SelfOnly , eDispatch_AllHandlers , eDispatch_FirstHandler , eDispatch_Default = eDispatch_AllHandlers }
 enum controlling dispatching strategies More...
enum  EPoolName {
  ePool_Default = 0 , ePool_Parent , ePool_Child , ePool_Sibling ,
 Identifiers for standard pools. More...
typedef vector< CEventHandler * > TListeners
typedef map< int, TListenersTPools
typedef list< AutoPtr< SPostRequest > > TPostRequests
typedef std::map< CEventHandler *, intTHandlerToCount
typedef void(* FOnPostCallback) ()

Public Member Functions

 CWorkspaceAutoSaver (IServiceLocator &serviceLocator, size_t interval)
size_t GetInterval () const
void SetInterval (size_t interval)
void PostSave ()
bool CheckCrash (ERestoreMode mode)
- Public Member Functions inherited from CEventHandler
 CEventHandler ()
 CEventHandler. More...
virtual ~CEventHandler ()
virtual void AddListener (CEventHandler *listener, int pool_name=ePool_Default)
 Add a listener. More...
virtual void RemoveListener (CEventHandler *listener)
 Remove a listener. More...
virtual void RemoveAllListeners (void)
virtual bool HasListener (CEventHandler *listener, int pool_name=ePool_Default) const
 returns "true" if the given listener belongs to the specified pool More...
virtual const TListenersGetListeners (int pool_name=ePool_Default) const
 returns a set of listeners fro the specified pool More...
virtual bool OnEvent (CEvent *evt)
 Processes en event. Returns "true" if event has been processed. More...
virtual bool Dispatch (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
 Dispatches an event to the listeners (but does not handle it). More...
virtual bool Send (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
 Sends an event synchronously. More...
virtual bool Send (CEvent *evt, int pool_name)
void Post (CRef< CEvent > evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
 Handles an event asynchronously (process and/or dispatch). More...

Static Public Member Functions

static bool CleanUp ()
- Static Public Member Functions inherited from CEventHandler
static bool HandlePostRequest ()
static void ClearPostQueue ()
 erases all events from the queue More...
static void DestroyPostQueue ()

Private Types

typedef void(CWorkspaceAutoSaver::* TExecFunc) (ICanceled &)

Private Member Functions

virtual void Notify ()
void x_OnSave (CEvent *)
void x_SaveWorkspace (ICanceled &canceled)
void x_RestoreWorkspace (ICanceled &canceled)

Private Attributes

size_t m_Interval
string m_Err

Additional Inherited Members

- Protected Member Functions inherited from CEventHandler
virtual const SEvtMapGetEventMap () const
void x_DeclareDead ()
 Removes itself unavailable for async event delivery. More...
void x_AddListenerToPool (CEventHandler *listener, int pool_name)
- Protected Attributes inherited from CEventHandler
TPools m_Pools
- Static Protected Attributes inherited from CEventHandler
static const SEvtMap sm_EvtMap

Detailed Description

Definition at line 65 of file ws_auto_saver.hpp.

Member Typedef Documentation

◆ TExecFunc

typedef void(CWorkspaceAutoSaver::* CWorkspaceAutoSaver::TExecFunc) (ICanceled &)

Definition at line 86 of file ws_auto_saver.hpp.

Member Enumeration Documentation

◆ ERestoreMode


Definition at line 70 of file ws_auto_saver.hpp.

Constructor & Destructor Documentation

◆ CWorkspaceAutoSaver()

CWorkspaceAutoSaver::CWorkspaceAutoSaver ( IServiceLocator serviceLocator,
size_t  interval 

Definition at line 68 of file ws_auto_saver.hpp.

Member Function Documentation

◆ CheckCrash()

bool CWorkspaceAutoSaver::CheckCrash ( ERestoreMode  mode)

◆ CleanUp()

bool CWorkspaceAutoSaver::CleanUp ( )


CWorkspaceAutoSaver::DECLARE_EVENT_MAP ( )

◆ GetInterval()

size_t CWorkspaceAutoSaver::GetInterval ( ) const

Definition at line 76 of file ws_auto_saver.hpp.

References m_Interval.

◆ Notify()

void CWorkspaceAutoSaver::Notify ( )

Definition at line 332 of file ws_auto_saver.cpp.

References CEventHandler::Post().

◆ PostSave()

void CWorkspaceAutoSaver::PostSave ( )

Definition at line 81 of file ws_auto_saver.cpp.

References m_Interval.

Referenced by x_OnSave().

◆ SetInterval()

void CWorkspaceAutoSaver::SetInterval ( size_t  interval)

Definition at line 74 of file ws_auto_saver.cpp.

◆ x_OnSave()

void CWorkspaceAutoSaver::x_OnSave ( CEvent )

◆ x_RestoreWorkspace()

void CWorkspaceAutoSaver::x_RestoreWorkspace ( ICanceled canceled)

◆ x_SaveWorkspace()

void CWorkspaceAutoSaver::x_SaveWorkspace ( ICanceled canceled)

Member Data Documentation

◆ m_Err

string CWorkspaceAutoSaver::m_Err

Definition at line 97 of file ws_auto_saver.hpp.

Referenced by CheckCrash(), and x_RestoreWorkspace().

◆ m_Interval

size_t CWorkspaceAutoSaver::m_Interval

Definition at line 95 of file ws_auto_saver.hpp.

Referenced by GetInterval(), and PostSave().

◆ m_ServiceLocator

IServiceLocator& CWorkspaceAutoSaver::m_ServiceLocator

The documentation for this class was generated from the following files:
Modified on Sat Mar 02 10:54:53 2024 by rev. 669887