casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::PlotOperation Class Reference

Simple object to synchronize operation progress information across threads. More...

#include <PlotOperation.h>

List of all members.

Public Member Functions

 PlotOperation (const String &name, PlotMutexPtr mutex)
 Constructor which takes the operation name and a synchronization mutex.
 ~PlotOperation ()
 Destructor.
String name () const
 Accessors (synchronized).
bool inProgress () const
bool isFinished () const
unsigned int currentProgress () const
String currentStatus () const
bool cancelRequested () const
void setInProgress (bool inProgress)
 Mutators (synchronized).
void setIsFinished (bool isFinished)
void setCurrentProgress (unsigned int currentProgress)
void setCurrentStatus (const String &currentStatus)
void setCancelRequested (bool cancel)
void setMutex (PlotMutexPtr mutex)
 Sets the operation's mutex to the given.
void addWatcher (PlotOperationWatcher *watcher)
 Adds the given watcher for this object.
void removeWatcher (PlotOperationWatcher *watcher)
 Removes the given watcher for this object.
void reset ()
 Resets the in progress, is finished, current progress, and current status members.
void finish ()
 Updates in progress, is finished, current progress, and current status members to reflect a "finished" state.

Private Member Functions

void notifyWatchers () const
 Notifies any registered watchers that the operation has changed.

Private Attributes

String m_name
 Name.
bool m_inProgress
 Flags.
bool m_isFinished
unsigned int m_currentProgress
 Current progress (0 - 100)%.
String m_currentStatus
 Current status message.
bool m_cancelRequested
 Cancel requested flag.
PlotMutexPtr m_mutex
 Synchronization mutex.
vector< PlotOperationWatcher * > m_watchers
 Watchers.

Detailed Description

Simple object to synchronize operation progress information across threads.

Definition at line 71 of file PlotOperation.h.


Constructor & Destructor Documentation

Constructor which takes the operation name and a synchronization mutex.

Destructor.


Member Function Documentation

Adds the given watcher for this object.

unsigned int casa::PlotOperation::currentProgress ( ) const

Updates in progress, is finished, current progress, and current status members to reflect a "finished" state.

Will notify registered watchers of a change.

Accessors (synchronized).

void casa::PlotOperation::notifyWatchers ( ) const [private]

Notifies any registered watchers that the operation has changed.

Removes the given watcher for this object.

Resets the in progress, is finished, current progress, and current status members.

Will notify registered watchers of a change.

void casa::PlotOperation::setCurrentProgress ( unsigned int  currentProgress)
void casa::PlotOperation::setCurrentStatus ( const String currentStatus)
void casa::PlotOperation::setInProgress ( bool  inProgress)

Mutators (synchronized).

Any mutator will notify registered watchers of a change.

void casa::PlotOperation::setIsFinished ( bool  isFinished)

Sets the operation's mutex to the given.


Member Data Documentation

Cancel requested flag.

Definition at line 132 of file PlotOperation.h.

Current progress (0 - 100)%.

Definition at line 126 of file PlotOperation.h.

Current status message.

Definition at line 129 of file PlotOperation.h.

Flags.

Definition at line 123 of file PlotOperation.h.

Definition at line 123 of file PlotOperation.h.

Synchronization mutex.

Definition at line 135 of file PlotOperation.h.

Name.

Definition at line 120 of file PlotOperation.h.

Watchers.

Definition at line 138 of file PlotOperation.h.


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