casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::PlotOperation Class Reference

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 &currentStatus)
 
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...
 

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 casacore::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
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).

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 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.

Member Data Documentation

bool casa::PlotOperation::m_cancelRequested
private

Cancel requested flag.

Definition at line 129 of file PlotOperation.h.

unsigned int casa::PlotOperation::m_currentProgress
private

Current progress (0 - 100)%.

Definition at line 123 of file PlotOperation.h.

casacore::String casa::PlotOperation::m_currentStatus
private

Current status message.

Definition at line 126 of file PlotOperation.h.

bool casa::PlotOperation::m_inProgress
private

Flags.

Definition at line 120 of file PlotOperation.h.

bool casa::PlotOperation::m_isFinished
private

Definition at line 120 of file PlotOperation.h.

PlotMutexPtr casa::PlotOperation::m_mutex
private

Synchronization mutex.

Definition at line 132 of file PlotOperation.h.

casacore::String casa::PlotOperation::m_name
private

Name.

Definition at line 117 of file PlotOperation.h.

std::vector<PlotOperationWatcher*> casa::PlotOperation::m_watchers
private

Watchers.

Definition at line 135 of file PlotOperation.h.


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