Open CASCADE Technology  7.4.0
Public Member Functions

Message_ProgressSentry Class Reference

This class is a tool allowing to manage opening/closing scopes in the ProgressIndicator in convenient and safe way. More...

#include <Message_ProgressSentry.hxx>

Public Member Functions

 Message_ProgressSentry (const Handle< Message_ProgressIndicator > &PI, const Standard_CString name, const Standard_Real min, const Standard_Real max, const Standard_Real step, const Standard_Boolean isInf=Standard_False, const Standard_Real newScopeSpan=0.0)
 
 Message_ProgressSentry (const Handle< Message_ProgressIndicator > &PI, const Handle< TCollection_HAsciiString > &name, const Standard_Real min, const Standard_Real max, const Standard_Real step, const Standard_Boolean isInf=Standard_False, const Standard_Real newScopeSpan=0.0)
 Creates an instance of ProgressSentry attaching it to the specified ProgressIndicator, selects parameters of the current scale, and opens a new scope with specified span (equal to step by default) More...
 
void Relieve ()
 Moves progress indicator to the end of the current scale and relieves sentry from its duty. Methods other than Show() will do nothing after this one is called. More...
 
 ~Message_ProgressSentry ()
 
void Next (const Standard_CString name=0) const
 
void Next (const Standard_Real span, const Standard_CString name=0) const
 
void Next (const Standard_Real span, const Handle< TCollection_HAsciiString > &name) const
 Closes current scope and opens next one with either specified or default span. More...
 
Standard_Boolean More () const
 Returns False if ProgressIndicator signals UserBreak. More...
 
void Show () const
 Forces update of progress indicator display. More...
 

Detailed Description

This class is a tool allowing to manage opening/closing scopes in the ProgressIndicator in convenient and safe way.

Its main features are:

Example of usage in nested process:

Handle(Draw_ProgressIndicator) aProgress = ...;
// Outer cycle
Message_ProgressSentry anOuter (aProgress, "Outer", 0, nbOuter, 1);
for (int i = 0; i < nbOuter && anOuter.More(); i++, anOuter.Next())
{
// Inner cycle
Message_ProgressSentry anInner (aProgress, "Inner", 0, nbInner, 1);
for (int j = 0; j < nbInner && anInner.More(); j++, anInner.Next())
{
// Cycle body
}
}

Constructor & Destructor Documentation

◆ Message_ProgressSentry() [1/2]

Message_ProgressSentry::Message_ProgressSentry ( const Handle< Message_ProgressIndicator > &  PI,
const Standard_CString  name,
const Standard_Real  min,
const Standard_Real  max,
const Standard_Real  step,
const Standard_Boolean  isInf = Standard_False,
const Standard_Real  newScopeSpan = 0.0 
)

◆ Message_ProgressSentry() [2/2]

Message_ProgressSentry::Message_ProgressSentry ( const Handle< Message_ProgressIndicator > &  PI,
const Handle< TCollection_HAsciiString > &  name,
const Standard_Real  min,
const Standard_Real  max,
const Standard_Real  step,
const Standard_Boolean  isInf = Standard_False,
const Standard_Real  newScopeSpan = 0.0 
)

Creates an instance of ProgressSentry attaching it to the specified ProgressIndicator, selects parameters of the current scale, and opens a new scope with specified span (equal to step by default)

◆ ~Message_ProgressSentry()

Message_ProgressSentry::~Message_ProgressSentry ( )
inline

Member Function Documentation

◆ More()

Standard_Boolean Message_ProgressSentry::More ( ) const

Returns False if ProgressIndicator signals UserBreak.

◆ Next() [1/3]

void Message_ProgressSentry::Next ( const Standard_CString  name = 0) const

◆ Next() [2/3]

void Message_ProgressSentry::Next ( const Standard_Real  span,
const Standard_CString  name = 0 
) const

◆ Next() [3/3]

void Message_ProgressSentry::Next ( const Standard_Real  span,
const Handle< TCollection_HAsciiString > &  name 
) const

Closes current scope and opens next one with either specified or default span.

◆ Relieve()

void Message_ProgressSentry::Relieve ( )

Moves progress indicator to the end of the current scale and relieves sentry from its duty. Methods other than Show() will do nothing after this one is called.

◆ Show()

void Message_ProgressSentry::Show ( ) const

Forces update of progress indicator display.


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