PCL
pcl::StatusCallback Class Referenceabstract

Provides status monitoring callback functions. More...

#include <StatusMonitor.h>

+ Inheritance diagram for pcl::StatusCallback:

Public Member Functions

 StatusCallback ()=default
 
 StatusCallback (const StatusCallback &)=default
 
 StatusCallback (StatusCallback &&)=default
 
virtual ~StatusCallback ()
 
virtual int Completed (const StatusMonitor &monitor) const =0
 
virtual void InfoUpdated (const StatusMonitor &monitor) const =0
 
virtual int Initialized (const StatusMonitor &monitor) const =0
 
StatusCallbackoperator= (const StatusCallback &)=default
 
StatusCallbackoperator= (StatusCallback &&)=default
 
virtual int Updated (const StatusMonitor &monitor) const =0
 

Detailed Description

StatusCallback is an abstract base class providing a set of pure virtual functions that must be reimplemented in derived classes. These virtual functions must provide feedback to the user as part of the status monitoring of a process.

Status monitoring consists of a set of PCL classes and functions to provide feedback and progress information about ongoing processes. Each instance of a StatusCallback subclass is directly managed by a status monitor object. A status monitor object is an instance of the StatusMonitor class.

Status monitors provide a generalized mechanism to generate progress information while a process is running. A StatusCallback subclass receives that progress information and provides feedback to the user, controlling the information provided, its format and its appearance.

The best example of StatusCallback subclass is the StandardStatus class. StandardStatus reimplements StatusCallback's pure virtual functions to show processing progress information on the processing console of the current processing thread.

See also
StatusMonitor, StandardStatus, SpinStatus, ProgressBarStatus, MuteStatus, Console, Thread

Definition at line 97 of file StatusMonitor.h.

Constructor & Destructor Documentation

◆ StatusCallback() [1/3]

pcl::StatusCallback::StatusCallback ( )
default

Constructs a default StatusCallback object.

◆ StatusCallback() [2/3]

pcl::StatusCallback::StatusCallback ( const StatusCallback )
default

Copy constructor.

◆ StatusCallback() [3/3]

pcl::StatusCallback::StatusCallback ( StatusCallback &&  )
default

Move constructor.

◆ ~StatusCallback()

virtual pcl::StatusCallback::~StatusCallback ( )
inlinevirtual

Virtual destructor.

Definition at line 119 of file StatusMonitor.h.

Member Function Documentation

◆ Completed()

virtual int pcl::StatusCallback::Completed ( const StatusMonitor monitor) const
pure virtual

Function called by a status monitor object to signal that the current process has finished.

When this function is invoked by the status monitor, its progress count has already reached its total count.

This function must return zero if the process can continue. If this function returns a nonzero value, the current process is aborted by throwing a ProcessAborted exception.

Note
This function allows aborting a process even when it has finished. This makes sense, since after a process has finished, the PixInsight core application still has some important work to do: update the target view's processing history, organize temporary swap files, send notifications, update masking relations, etc.

Implemented in pcl::StandardStatus, pcl::MuteStatus, pcl::RealTimeProgressStatus, pcl::ProgressBarStatus, and pcl::SpinStatus.

◆ InfoUpdated()

virtual void pcl::StatusCallback::InfoUpdated ( const StatusMonitor monitor) const
pure virtual

Function called by a status monitor object when the progress information for the current process has been changed.

The progress information is a string that can be obtained by calling StatusMonitor::Info() for the passed monitor object.

Implemented in pcl::StandardStatus, pcl::MuteStatus, pcl::RealTimeProgressStatus, pcl::ProgressBarStatus, and pcl::SpinStatus.

◆ Initialized()

virtual int pcl::StatusCallback::Initialized ( const StatusMonitor monitor) const
pure virtual

This function is called by a status monitor object when a new monitored process is about to start.

The progress total count can be obtained by calling StatusMonitor::Total() for the passed monitor object. Similarly, the progress information string is given by StatusMonitor::Info().

This function must return zero if the process can continue. If this function returns a nonzero value, the new process is aborted by throwing a ProcessAborted exception.

Implemented in pcl::StandardStatus, pcl::MuteStatus, pcl::RealTimeProgressStatus, pcl::ProgressBarStatus, and pcl::SpinStatus.

◆ operator=() [1/2]

StatusCallback& pcl::StatusCallback::operator= ( const StatusCallback )
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

StatusCallback& pcl::StatusCallback::operator= ( StatusCallback &&  )
default

Move assignment operator. Returns a reference to this object.

◆ Updated()

virtual int pcl::StatusCallback::Updated ( const StatusMonitor monitor) const
pure virtual

Function called by a status monitor object to signal an update of the progress count for the current process.

The progress count can be obtained by calling StatusMonitor::Count() for the passed monitor object. Similarly, the total count is given by StatusMonitor::Total().

This function is called repeatedly at regular time intervals until the progress count reaches the total count, or until the process is aborted.

This function must return zero if the process can continue. If this function returns a nonzero value, the current process is aborted by throwing a ProcessAborted exception.

Implemented in pcl::StandardStatus, pcl::MuteStatus, pcl::RealTimeProgressStatus, pcl::ProgressBarStatus, and pcl::SpinStatus.


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