nuklei::ProgressIndicator Class Reference

Public Member Functions

 ProgressIndicator ()
 Constructs a PI to go from spanStartDef to spanEndDef.
 
 ProgressIndicator (const int spanEnd, const std::string &message=messageDef, const unsigned minLogLevel=0)
 Constructs a PI which will scale [spanStartDef spanEnd] to [0 100].
 
 ProgressIndicator (const int spanStart, const int spanEnd, const std::string &message=messageDef, const unsigned minLogLevel=0)
 Constructs a PI which will scale [spanStart spanEnd] to [0 100].
 
void initialize (const int spanStart, const int spanEnd, const std::string &message, const unsigned minLogLevel)
 
void setMinLogLevel (const unsigned l)
 
unsigned getMinLogLevel () const
 
void setValue (const int value)
 
void setBackspace (const bool backspace)
 
void inc (const int value=1)
 
void mtInc (const int value=1)
 
const std::string & getMessage () const
 
void setMessage (const std::string &message)
 
void rewind ()
 
void forceEnd ()
 

Static Public Member Functions

static int main (int argc, char **argv)
 

Static Public Attributes

static const int spanStartDef = 0
 
static const int spanEndDef = 100
 
static const std::string messageDef = "Progress: "
 
static const std::string backspaceSequence = "\033[A"
 

Detailed Description

Definition at line 15 of file ProgressIndicator.h.

Member Function Documentation

◆ forceEnd()

void nuklei::ProgressIndicator::forceEnd ( )

Forces the display of 100% and a new line.

Definition at line 227 of file ProgressIndicator.cpp.

References setValue().

◆ inc()

void nuklei::ProgressIndicator::inc ( const int  value = 1)

Use inside the loop.

Parameters
valuethe progress value between spanStart and spanEnd.

Definition at line 188 of file ProgressIndicator.cpp.

References setValue().

◆ mtInc()

void nuklei::ProgressIndicator::mtInc ( const int  value = 1)

Use inside the loop.

Parameters
valuethe progress value between spanStart and spanEnd.

Definition at line 198 of file ProgressIndicator.cpp.

References setValue().

◆ rewind()

void nuklei::ProgressIndicator::rewind ( )

Gets the PI ready to be used again. This is not a reset, since spanStart, spanEnd etc. are not reset.

Definition at line 219 of file ProgressIndicator.cpp.

◆ setValue()

void nuklei::ProgressIndicator::setValue ( const int  value)

Use inside the loop.

Parameters
valuethe progress value between spanStart and spanEnd.

Definition at line 131 of file ProgressIndicator.cpp.

Referenced by forceEnd(), inc(), and mtInc().


The documentation for this class was generated from the following files:
© Copyright 2007-2013 Renaud Detry.
Distributed under the terms of the GNU General Public License (GPL).
(See accompanying file LICENSE.txt or copy at http://www.gnu.org/copyleft/gpl.html.)
Revised Sun Sep 13 2020 19:10:12.