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.
std::vector
< PlotOperationWatcher * > 
m_watchers
 Watchers.

Detailed Description

Simple object to synchronize operation progress information across threads.

Definition at line 68 of file PlotOperation.h.


Constructor & Destructor Documentation

casa::PlotOperation::PlotOperation ( const String &  name,
PlotMutexPtr  mutex 
)

Constructor which takes the operation name and a synchronization mutex.

casa::PlotOperation::~PlotOperation (  ) 

Destructor.


Member Function Documentation

void casa::PlotOperation::addWatcher ( PlotOperationWatcher watcher  ) 

Adds the given watcher for this object.

bool casa::PlotOperation::cancelRequested (  )  const
unsigned int casa::PlotOperation::currentProgress (  )  const
String casa::PlotOperation::currentStatus (  )  const
void casa::PlotOperation::finish (  ) 

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

Will notify registered watchers of a change.

bool casa::PlotOperation::inProgress (  )  const
bool casa::PlotOperation::isFinished (  )  const
String casa::PlotOperation::name (  )  const

Accessors (synchronized).

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

Notifies any registered watchers that the operation has changed.

void casa::PlotOperation::removeWatcher ( PlotOperationWatcher watcher  ) 

Removes the given watcher for this object.

void casa::PlotOperation::reset (  ) 

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

Will notify registered watchers of a change.

void casa::PlotOperation::setCancelRequested ( bool  cancel  ) 
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  ) 
void casa::PlotOperation::setMutex ( PlotMutexPtr  mutex  ) 

Sets the operation's mutex to the given.


Member Data Documentation

Cancel requested flag.

Definition at line 129 of file PlotOperation.h.

Current progress (0 - 100)%.

Definition at line 123 of file PlotOperation.h.

Current status message.

Definition at line 126 of file PlotOperation.h.

Flags.

Definition at line 120 of file PlotOperation.h.

Definition at line 120 of file PlotOperation.h.

Synchronization mutex.

Definition at line 132 of file PlotOperation.h.

String casa::PlotOperation::m_name [private]

Name.

Definition at line 117 of file PlotOperation.h.

Watchers.

Definition at line 135 of file PlotOperation.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1