casa
5.7.0-16
|
Simple object to synchronize operation progress information across threads. More...
#include <PlotOperation.h>
Public Member Functions | |
PlotOperation (const casacore::String &name, PlotMutexPtr mutex) | |
Constructor which takes the operation name and a synchronization mutex. More... | |
~PlotOperation () | |
Destructor. More... | |
casacore::String | name () const |
Accessors (synchronized). More... | |
bool | inProgress () const |
bool | isFinished () const |
unsigned int | currentProgress () const |
casacore::String | currentStatus () const |
bool | cancelRequested () const |
void | setInProgress (bool inProgress) |
Mutators (synchronized). More... | |
void | setIsFinished (bool isFinished) |
void | setCurrentProgress (unsigned int currentProgress) |
void | setCurrentStatus (const casacore::String ¤tStatus) |
void | setCancelRequested (bool cancel) |
void | setMutex (PlotMutexPtr mutex) |
Sets the operation's mutex to the given. More... | |
void | addWatcher (PlotOperationWatcher *watcher) |
Adds the given watcher for this object. More... | |
void | removeWatcher (PlotOperationWatcher *watcher) |
Removes the given watcher for this object. More... | |
void | reset () |
Resets the in progress, is finished, current progress, and current status members. More... | |
void | finish () |
Updates in progress, is finished, current progress, and current status members to reflect a "finished" state. More... | |
Private Member Functions | |
void | notifyWatchers () const |
Notifies any registered watchers that the operation has changed. More... | |
Private Attributes | |
casacore::String | m_name |
Name. More... | |
bool | m_inProgress |
Flags. More... | |
bool | m_isFinished |
unsigned int | m_currentProgress |
Current progress (0 - 100)%. More... | |
casacore::String | m_currentStatus |
Current status message. More... | |
bool | m_cancelRequested |
Cancel requested flag. More... | |
PlotMutexPtr | m_mutex |
Synchronization mutex. More... | |
std::vector < PlotOperationWatcher * > | m_watchers |
Watchers. More... | |
Simple object to synchronize operation progress information across threads.
Definition at line 68 of file PlotOperation.h.
casa::PlotOperation::PlotOperation | ( | const casacore::String & | name, |
PlotMutexPtr | mutex | ||
) |
Constructor which takes the operation name and a synchronization mutex.
casa::PlotOperation::~PlotOperation | ( | ) |
Destructor.
void casa::PlotOperation::addWatcher | ( | PlotOperationWatcher * | watcher | ) |
Adds the given watcher for this object.
bool casa::PlotOperation::cancelRequested | ( | ) | const |
unsigned int casa::PlotOperation::currentProgress | ( | ) | const |
casacore::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 |
casacore::String casa::PlotOperation::name | ( | ) | const |
Accessors (synchronized).
|
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 casacore::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.
|
private |
Cancel requested flag.
Definition at line 129 of file PlotOperation.h.
|
private |
Current progress (0 - 100)%.
Definition at line 123 of file PlotOperation.h.
|
private |
Current status message.
Definition at line 126 of file PlotOperation.h.
|
private |
Flags.
Definition at line 120 of file PlotOperation.h.
|
private |
Definition at line 120 of file PlotOperation.h.
|
private |
Synchronization mutex.
Definition at line 132 of file PlotOperation.h.
|
private |
Name.
Definition at line 117 of file PlotOperation.h.
|
private |
Watchers.
Definition at line 135 of file PlotOperation.h.