#include <opennurbs_progress_reporter.h>

Public Member Functions

 ON_ProgressStepCounter ()=default
 This class makes it easy for functions to use a progress reporter. More...
 
 ON_ProgressStepCounter (const ON_ProgressStepCounter &)=default
 
 ~ON_ProgressStepCounter ()=default
 
void Finished ()
 Call Finished() after you complete the process. More...
 
void IncrementStep ()
 Call IncrementStep() after you complete each step. More...
 
ON_ProgressStepCounteroperator= (const ON_ProgressStepCounter &)=default
 
double Progress () const
 
unsigned int Step () const
 
unsigned int StepCount () const
 

Static Public Member Functions

static ON_ProgressStepCounter Create (ON_ProgressReporter *progress_reporter, unsigned int step_count)
 When you have a process that needs to call a ON_ProgressReporter::ReportProgress() a reasonable number of times and you can calculate the number of steps your process takes, then ON_ProgressStepCounter will handle all the details. More...
 
static ON_ProgressStepCounter Create (ON_ProgressReporter *progress_reporter, unsigned int step_count, double progress_interval_start, double progress_interval_finish, unsigned int maximum_progress_reports)
 When you have a process that needs to call a ON_ProgressReporter::ReportProgress() a reasonable number of times and you can calculate the number of steps your process takes, then ON_ProgressStepCounter will handle all the details. More...
 

Static Public Attributes

static const ON_ProgressStepCounter Empty
 

Constructor & Destructor Documentation

◆ ON_ProgressStepCounter() [1/2]

ON_ProgressStepCounter::ON_ProgressStepCounter ( )
default

This class makes it easy for functions to use a progress reporter.

◆ ~ON_ProgressStepCounter()

ON_ProgressStepCounter::~ON_ProgressStepCounter ( )
default

◆ ON_ProgressStepCounter() [2/2]

ON_ProgressStepCounter::ON_ProgressStepCounter ( const ON_ProgressStepCounter )
default

Member Function Documentation

◆ Create() [1/2]

static ON_ProgressStepCounter ON_ProgressStepCounter::Create ( ON_ProgressReporter progress_reporter,
unsigned int  step_count 
)
static

When you have a process that needs to call a ON_ProgressReporter::ReportProgress() a reasonable number of times and you can calculate the number of steps your process takes, then ON_ProgressStepCounter will handle all the details.

Parameters
progress_reporter[in] Parameter passed to ON_ProgressReporter::ReportProgress().
step_count[in] Number of steps.

This will create a ON_ProgressStepCounter that will call ON_ProgressReporter::ReportProgress(progress_reporter) at most 101 times. The first call reports progress 0.0. The last call reports progress 1.0.

◆ Create() [2/2]

static ON_ProgressStepCounter ON_ProgressStepCounter::Create ( ON_ProgressReporter progress_reporter,
unsigned int  step_count,
double  progress_interval_start,
double  progress_interval_finish,
unsigned int  maximum_progress_reports 
)
static

When you have a process that needs to call a ON_ProgressReporter::ReportProgress() a reasonable number of times and you can calculate the number of steps your process takes, then ON_ProgressStepCounter will handle all the details.

Parameters
progress_reporter[in] Parameter passed to ON_ProgressReporter::ReportProgress().
step_count[in] Number of steps.
progress_interval_start[in]
progress_interval_finish[in] 0.0 <= progress_interval_start < progress_interval_finish <= 1.0
maximum_progress_reports[in] Maximum number of times to call ON_ProgressReporter::ReportProgress() after the initial call reporting progress of progress_interval_start. 10 to 100 are good values.

◆ Finished()

void ON_ProgressStepCounter::Finished ( )

Call Finished() after you complete the process.

◆ IncrementStep()

void ON_ProgressStepCounter::IncrementStep ( )

Call IncrementStep() after you complete each step.

◆ operator=()

ON_ProgressStepCounter& ON_ProgressStepCounter::operator= ( const ON_ProgressStepCounter )
default

◆ Progress()

double ON_ProgressStepCounter::Progress ( ) const

◆ Step()

unsigned int ON_ProgressStepCounter::Step ( ) const

◆ StepCount()

unsigned int ON_ProgressStepCounter::StepCount ( ) const

Member Data Documentation

◆ Empty

const ON_ProgressStepCounter ON_ProgressStepCounter::Empty
static