27 #ifndef PLOTOPERATION_H_
28 #define PLOTOPERATION_H_
38 class PlotOperationWatcher;
55 virtual void lock() = 0;
PlotMutexPtr m_mutex
Synchronization mutex.
void setInProgress(bool inProgress)
Mutators (synchronized).
std::vector< PlotOperationWatcher * > m_watchers
Watchers.
void reset()
Resets the in progress, is finished, current progress, and current status members.
Simple object to synchronize operation progress information across threads.
unsigned int m_currentProgress
Current progress (0 - 100)%.
void setCancelRequested(bool cancel)
void setCurrentProgress(unsigned int currentProgress)
casacore::String m_name
Name.
virtual ~PlotOperationWatcher()
Destructor.
void setCurrentStatus(const casacore::String ¤tStatus)
void finish()
Updates in progress, is finished, current progress, and current status members to reflect a "finished...
casacore::String currentStatus() const
bool m_cancelRequested
Cancel requested flag.
casacore::String name() const
Accessors (synchronized).
casacore::String m_currentStatus
Current status message.
PlotOperation(const casacore::String &name, PlotMutexPtr mutex)
Constructor which takes the operation name and a synchronization mutex.
Abstract interface for any object that wants to watch a PlotOperation object for changes.
void notifyWatchers() const
Notifies any registered watchers that the operation has changed.
void setMutex(PlotMutexPtr mutex)
Sets the operation's mutex to the given.
void setIsFinished(bool isFinished)
PlotOperationWatcher()
Constructor.
void addWatcher(PlotOperationWatcher *watcher)
Adds the given watcher for this object.
void removeWatcher(PlotOperationWatcher *watcher)
Removes the given watcher for this object.
Abstract class, for a synchronization mutex specific to the threading library used by the plotting im...
virtual void unlock()=0
Unlocks the mutex.
virtual bool tryLock()=0
Tries to lock the mutex, and returns immediately with either true for success (mutex is now locked)...
virtual void operationChanged(const PlotOperation &operation)=0
This method is called to notify the watcher that the given PlotOperation object has changed...
~PlotOperation()
Destructor.
casacore::CountedPtr< PlotOperation > PlotOperationPtr
casacore::CountedPtr< PlotMutex > PlotMutexPtr
virtual ~PlotMutex()
Destructor.
unsigned int currentProgress() const
String: the storage and methods of handling collections of characters.
bool cancelRequested() const
virtual void lock()=0
ABSTRACT METHODS //.