Xmipp  v3.23.11-Nereus
Public Member Functions | List of all members
BaseListener Class Referenceabstract

#include <xmipp_funcs.h>

Inheritance diagram for BaseListener:
Inheritance graph
[legend]

Public Member Functions

 BaseListener ()
 
virtual ~BaseListener ()
 
virtual void OnInitOperation (unsigned long _est_it)=0
 
virtual void OnReportOperation (const std::string &_rsOp)=0
 
virtual void OnProgress (unsigned long _it)=0
 
virtual const unsigned & getVerbosity () const
 
virtual unsigned & setVerbosity ()
 
virtual const bool & OnUserCancel () const
 
virtual bool & setCancel ()
 

Detailed Description

BaseListener

This class implements the xmipp listener class for notification of progress status and other operations. It is an abstract class that contains base functions useful for implementation of customer-design notification classes.

This class is not ported to Python.

Definition at line 1022 of file xmipp_funcs.h.

Constructor & Destructor Documentation

◆ BaseListener()

BaseListener::BaseListener ( )
inline

Default constructor

Definition at line 1026 of file xmipp_funcs.h.

1026  : verbosity(0), cancel(false)
1027  {}

◆ ~BaseListener()

virtual BaseListener::~BaseListener ( )
inlinevirtual

Destructor

Definition at line 1030 of file xmipp_funcs.h.

1030 {}

Member Function Documentation

◆ getVerbosity()

virtual const unsigned& BaseListener::getVerbosity ( ) const
inlinevirtual

This method will get the verbosity level

Definition at line 1065 of file xmipp_funcs.h.

1066  {
1067  return verbosity;
1068  }

◆ OnInitOperation()

virtual void BaseListener::OnInitOperation ( unsigned long  _est_it)
pure virtual

Initialize progress bar.

_est_it: Defines the estimated number of iterations

This method will initialize the progress bar with the number of estimated iterations.

Implemented in TextualListener.

◆ OnProgress()

virtual void BaseListener::OnProgress ( unsigned long  _it)
pure virtual

Show a bar with the progress in time

When the input is negative then we are setting the progress bar, this will be the total of elements to process. Afterwards the call to this routine must be in ascending order, ie, 0, 1, 2, ... No. elements

Class inheriting from this base class can define their own progress bar here.

_it: iteration number

Implemented in TextualListener.

◆ OnReportOperation()

virtual void BaseListener::OnReportOperation ( const std::string &  _rsOp)
pure virtual

Shows a message indicating the operation in progress

Class inheriting from this abstract class can output this message in the way they want.

_rsop: string message

Implemented in TextualListener.

◆ OnUserCancel()

virtual const bool& BaseListener::OnUserCancel ( ) const
inlinevirtual

This method returns true if a cancel command was set

It can be used to check whether an external event is trying to cancel any operation. Inside an algorithm you can can this method to check if a cancel operation was requested.

Definition at line 1083 of file xmipp_funcs.h.

1084  {
1085  return cancel;
1086  }

◆ setCancel()

virtual bool& BaseListener::setCancel ( )
inlinevirtual

This method is used to send a cancel command

Definition at line 1090 of file xmipp_funcs.h.

1091  {
1092  return cancel;
1093  }

◆ setVerbosity()

virtual unsigned& BaseListener::setVerbosity ( )
inlinevirtual

This method will set the verbosity level to be used

Definition at line 1072 of file xmipp_funcs.h.

1073  {
1074  return verbosity;
1075  }

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