TPIE

11a2c2d
tpie::pipelining::bits::proxy_progress_indicator Class Reference

Inherits tpie::progress_indicator_base.

Public Member Functions

 proxy_progress_indicator (node &s)
 
void refresh () override
 Display the indicator. More...
 
void step (stream_size_type step=1)
 Record an increment to the indicator and advance the indicator. More...
 
void raw_step (stream_size_type step)
 Internal method used in fractional progress. More...
 
virtual void init (stream_size_type range=0)
 Initialize progress indicator. More...
 
virtual void done ()
 Advance the indicator to the end. More...
 
virtual void set_range (stream_size_type range)
 Set the upper bound of the counting range. More...
 
stream_size_type get_current ()
 Get the current value of the step counter. More...
 
stream_size_type get_range ()
 Get the maximum value of the current range. More...
 
execution_time_predictorget_time_predictor ()
 
void set_time_predictor (execution_time_predictor *p)
 
std::string estimated_remaining_time ()
 
virtual void push_breadcrumb (const char *, description_importance)
 
virtual void pop_breadcrumb ()
 

Protected Attributes

stream_size_type m_range
 The upper bound of the counting range. More...
 
stream_size_type m_current
 The current progress count [m_minRange...m_maxRange]. More...
 

Detailed Description

Definition at line 40 of file node.h.

Member Function Documentation

◆ done()

virtual void tpie::progress_indicator_base::done ( )
inlinevirtualinherited

◆ get_current()

stream_size_type tpie::progress_indicator_base::get_current ( )
inlineinherited

Get the current value of the step counter.

Definition at line 152 of file progress_indicator_base.h.

152 { return m_current; }

◆ get_range()

stream_size_type tpie::progress_indicator_base::get_range ( )
inlineinherited

Get the maximum value of the current range.

Definition at line 157 of file progress_indicator_base.h.

157 { return m_range; }

◆ init()

virtual void tpie::progress_indicator_base::init ( stream_size_type  range = 0)
inlinevirtualinherited

Initialize progress indicator.

Parameters
rangeThe number of times step() is going to be called.

Reimplemented in tpie::fractional_subindicator, tpie::progress_indicator_subindicator, and tpie::progress_indicator_null.

Definition at line 121 of file progress_indicator_base.h.

121  {
122  if (range != 0) set_range(range);
123  m_current = 0;
124  call_refresh();
125  }

Referenced by tpie::merge_sorter< T, UseProgress, pred_t, store_t >::calc(), and tpie::parallel_sort().

◆ raw_step()

void tpie::progress_indicator_base::raw_step ( stream_size_type  step)
inlineinherited

Internal method used in fractional progress.

In a hierarchy of fractional progress subindicators, only the lowest level of indicators should determine how many steps should pass until the next call to refresh(). When this happens, the subindicator calls raw_step() on its parent indicator rather than step(), which will short-circuit the logic and call the virtual method refresh() directly. You should probably not use this method; use step() instead.

Definition at line 111 of file progress_indicator_base.h.

111  {
112  m_current += step;
113  // Don't call call_refresh(); call refresh() directly instead.
114  refresh();
115  }

◆ refresh()

void tpie::pipelining::bits::proxy_progress_indicator::refresh ( )
overridevirtual

Display the indicator.

Implements tpie::progress_indicator_base.

◆ set_range()

virtual void tpie::progress_indicator_base::set_range ( stream_size_type  range)
inlinevirtualinherited

Set the upper bound of the counting range.

This method also implies a reset of the counter. In order to be able to set the uper bound independent of setting the lower bound, no range checking is done.

Parameters
rangeThe new upper bound.

Reimplemented in tpie::progress_indicator_null.

Definition at line 140 of file progress_indicator_base.h.

140  {
141  m_range = range;
142  }

◆ step()

void tpie::progress_indicator_base::step ( stream_size_type  step = 1)
inlineinherited

Record an increment to the indicator and advance the indicator.

Definition at line 91 of file progress_indicator_base.h.

91  {
92  m_current += step;
93 
94  if (step >= m_remainingSteps) {
95  call_refresh();
96  } else {
97  m_remainingSteps -= step;
98  }
99  }

Referenced by tpie::merge_sorter< T, UseProgress, pred_t, store_t >::calc(), and tpie::ami::Internal_Sorter_Obj< T, Compare >::sort().

Member Data Documentation

◆ m_current

stream_size_type tpie::progress_indicator_base::m_current
protectedinherited

◆ m_range

stream_size_type tpie::progress_indicator_base::m_range
protectedinherited

The documentation for this class was generated from the following file:
tpie::progress_indicator_base::refresh
virtual void refresh()=0
Display the indicator.
tpie::progress_indicator_base::set_range
virtual void set_range(stream_size_type range)
Set the upper bound of the counting range.
Definition: progress_indicator_base.h:140
tpie::progress_indicator_base::m_current
stream_size_type m_current
The current progress count [m_minRange...m_maxRange].
Definition: progress_indicator_base.h:174
tpie::progress_indicator_base::step
void step(stream_size_type step=1)
Record an increment to the indicator and advance the indicator.
Definition: progress_indicator_base.h:91
tpie::progress_indicator_base::m_range
stream_size_type m_range
The upper bound of the counting range.
Definition: progress_indicator_base.h:171