MISTATUSMANAGER Class Reference

Base status manager. More...

#include <mi32/mistatus.h>

Inheritance diagram for MISTATUSMANAGER:
Inheritance graph
[legend]

List of all members.

Classes

class  CONTEXT_PRIV
 Base for private manager-specific info to store with context. More...
class  SAVERESTORE

Public Member Functions

 MISTATUSMANAGER ()
virtual ~MISTATUSMANAGER ()
MTIMERGetTimer ()
bool IsCancelled ()
bool ReportTimeElapsed ()
void ReportTimerValue (const MTIMER &timer)
void ResetCancelled ()
void RestartTimer ()
void SetAsActive ()
void SetCancelEnabled (bool enabled)

Static Public Member Functions

static MISTATUSMANAGERGetActiveManager ()
static MISTATUSMANAGERSetActiveManager (MISTATUSMANAGER *manager)
static void SetCreator (FastDelegate< MISTATUSMANAGER *()> DelegateCreateManager)

Protected Types

typedef MILIST< MISTATUSCONTEXT * > CONTEXTLIST

Protected Member Functions

void ClearContextList ()
const CONTEXTLISTGetContextList (MITHREAD::CRITICALSECTION::LOCK &Lock) const
MISYSTEM::THREAD_ID GetCreatorThreadID () const
bool IsCancelSet () const
void ReportMessage (MISTATUSCONTEXT &context, const MISTRING &msgstr)
void SetCancelled ()

Private Member Functions

Overridables



virtual CONTEXT_PRIVv_ContextPrivCreate (MISTATUSCONTEXT &Context)
virtual bool v_IsCancelled ()
virtual void v_ReportBegin (MISTATUSCONTEXT &context, const MISTRING &msgstr)
virtual void v_ReportEnd (MISTATUSCONTEXT &context, const MISTRING &msgstr, const MISTRING &timerstr)
virtual void v_ReportMessage (MISTATUSCONTEXT &context, const MISTRING &msgstr)
virtual void v_ReportProgress (MISTATUSCONTEXT &context, double pctdone)
virtual void v_ReportTimerValue (const MTIMER &timer)
virtual void v_ResetCancelled ()
virtual void v_SetCancelEnabled (bool enabled)
virtual void v_UpdateUI ()

Detailed Description

Base status manager.

Most methods should not be called directly as they are called by MISTATUSCONTEXT where needed.


Member Typedef Documentation


Constructor & Destructor Documentation

MISTATUSMANAGER::MISTATUSMANAGER (  ) 

Default constructor.

Will set newly constructed manager as active manager for current thread.

virtual MISTATUSMANAGER::~MISTATUSMANAGER (  )  [virtual]

Destructor.

If this instance is the active manager for the current thread, the active manager will be set to NULL.


Member Function Documentation

void MISTATUSMANAGER::ClearContextList (  )  [protected]

Clear current context list.

static MISTATUSMANAGER* MISTATUSMANAGER::GetActiveManager (  )  [static]

Get active status manager for current thread.

Typically only used if creating status context is conditional upon having enough steps in a task for reporting to be worthwhile.

const CONTEXTLIST& MISTATUSMANAGER::GetContextList ( MITHREAD::CRITICALSECTION::LOCK Lock  )  const [protected]

Get list of pointers to attached contexts.

Parameters:
Lock Must be a LOCK that is not assigned to a Critical section, This method will assign it.
MISYSTEM::THREAD_ID MISTATUSMANAGER::GetCreatorThreadID (  )  const [inline, protected]

Get ID of thread in which manager was created.

MTIMER& MISTATUSMANAGER::GetTimer (  )  [inline]

Get timer.

bool MISTATUSMANAGER::IsCancelled (  ) 

Check if operation has been cancelled.

When cancelled state is first detected, all attached contexts will be set as cancelled.

bool MISTATUSMANAGER::IsCancelSet (  )  const [inline, protected]

Determine if "cancelled" state has been set.

void MISTATUSMANAGER::ReportMessage ( MISTATUSCONTEXT context,
const MISTRING msgstr 
) [inline, protected]

Report message.

Used internally by STATUSCONTEXT, not usually called directly.

bool MISTATUSMANAGER::ReportTimeElapsed (  ) 

Report time elapsed.

Returns:
true if elapsed time different than last report, false if not
void MISTATUSMANAGER::ReportTimerValue ( const MTIMER timer  )  [inline]

Report timer value.

void MISTATUSMANAGER::ResetCancelled (  ) 

Reset cancelled state.

Does not reset cancelled state of already attached contexts.

void MISTATUSMANAGER::RestartTimer (  )  [inline]

Reset and start timer.

static MISTATUSMANAGER* MISTATUSMANAGER::SetActiveManager ( MISTATUSMANAGER manager  )  [static]

Set active status manager for current thread.

Returns:
Previous active status manager. Use care when retaining previous active status manager to restore later, generally it will only be safe to do so in the main application thread.
void MISTATUSMANAGER::SetAsActive (  )  [inline]

Set instance to be active status manager.

void MISTATUSMANAGER::SetCancelEnabled ( bool  enabled  ) 

Set whether cancel is enabled.

void MISTATUSMANAGER::SetCancelled (  )  [protected]

Set "cancelled" state.

When cancelled state is first set, all attached contexts will be set as cancelled.

static void MISTATUSMANAGER::SetCreator ( FastDelegate< MISTATUSMANAGER *()>  DelegateCreateManager  )  [static]

Set status manager creator for current thread.

For interactive applications this is usually only called for main application thread. The creator is used when no active manager is set and a STATUSCONTEXT is constructed.

virtual CONTEXT_PRIV* MISTATUSMANAGER::v_ContextPrivCreate ( MISTATUSCONTEXT Context  )  [private, virtual]

Create private manager-specific information for context.

Default implementation needs no private info and so returns NULL.

virtual bool MISTATUSMANAGER::v_IsCancelled (  )  [private, virtual]

Determine if cancel has been requested.

Default implementation always returns false.

virtual void MISTATUSMANAGER::v_ReportBegin ( MISTATUSCONTEXT context,
const MISTRING msgstr 
) [private, virtual]

Report task beginning.

Default implementation calls ReportMessage.

Reimplemented in MISTATUSLOGGER.

virtual void MISTATUSMANAGER::v_ReportEnd ( MISTATUSCONTEXT context,
const MISTRING msgstr,
const MISTRING timerstr 
) [private, virtual]

Report that task is ending.

Default implementation does nothing.

Reimplemented in MISTATUSLOGGER.

virtual void MISTATUSMANAGER::v_ReportMessage ( MISTATUSCONTEXT context,
const MISTRING msgstr 
) [private, virtual]

Report message.

Default implementation does nothing.

Reimplemented in MISTATUSLOGGER.

virtual void MISTATUSMANAGER::v_ReportProgress ( MISTATUSCONTEXT context,
double  pctdone 
) [private, virtual]

Report progress.

Default implementation does nothing.

virtual void MISTATUSMANAGER::v_ReportTimerValue ( const MTIMER timer  )  [private, virtual]

Report timer value.

Default implementation does nothing.

virtual void MISTATUSMANAGER::v_ResetCancelled (  )  [private, virtual]

Reset cancelled state.

Default implementation does nothing.

virtual void MISTATUSMANAGER::v_SetCancelEnabled ( bool  enabled  )  [private, virtual]

Set whether cancel is enabled.

Only needs to be implemented to update user interface, as state is retained by STATUSMANAGER itself.

virtual void MISTATUSMANAGER::v_UpdateUI (  )  [private, virtual]

Update user interface display.

Default implementation does nothing.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:39 2012 for TNTsdk 2012 by  doxygen 1.6.1