Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
lvr2::ProgressBar Class Reference

#include <Progress.hpp>

Public Member Functions

void operator++ ()
 Increases the counter of performed iterations. More...
 
void operator+= (size_t n)
 Increases the counter of performed by n. More...
 
 ProgressBar (size_t max_val, string prefix="")
 Ctor. More...
 
virtual ~ProgressBar ()
 

Static Public Member Functions

static void setProgressCallback (ProgressCallbackPtr)
 Registers a callback that is called with the new value when the percentage of the progress changed. More...
 
static void setProgressTitleCallback (ProgressTitleCallbackPtr)
 Registers a callback that is called when a new progress instance is created. More...
 

Protected Member Functions

void print_bar ()
 Prints the output. More...
 

Protected Attributes

size_t m_currentVal
 The current counter. More...
 
string m_fillstring
 A fill string for correct output alignment. More...
 
size_t m_maxVal
 The number of iterations. More...
 
boost::mutex m_mutex
 A mutex object for counter increment (for parallel executions) More...
 
int m_percent
 The current progress in percent. More...
 
string m_prefix
 The prefix string. More...
 
stringstream m_stream
 A string stream for output generation. More...
 

Static Protected Attributes

static ProgressCallbackPtr m_progressCallback = 0
 
static ProgressTitleCallbackPtr m_titleCallback = 0
 

Detailed Description

Definition at line 68 of file Progress.hpp.

Constructor & Destructor Documentation

◆ ProgressBar()

lvr2::ProgressBar::ProgressBar ( size_t  max_val,
string  prefix = "" 
)

Ctor.

Parameters
max_valThe number of performed iterations
prefixThe prefix string for progress output

Definition at line 52 of file Progress.cpp.

◆ ~ProgressBar()

lvr2::ProgressBar::~ProgressBar ( )
virtual

Definition at line 68 of file Progress.cpp.

Member Function Documentation

◆ operator++()

void lvr2::ProgressBar::operator++ ( )

Increases the counter of performed iterations.

Definition at line 83 of file Progress.cpp.

◆ operator+=()

void lvr2::ProgressBar::operator+= ( size_t  n)

Increases the counter of performed by n.

Definition at line 108 of file Progress.cpp.

◆ print_bar()

void lvr2::ProgressBar::print_bar ( )
protected

Prints the output.

Definition at line 133 of file Progress.cpp.

◆ setProgressCallback()

void lvr2::ProgressBar::setProgressCallback ( ProgressCallbackPtr  ptr)
static

Registers a callback that is called with the new value when the percentage of the progress changed.

Parameters

Definition at line 73 of file Progress.cpp.

◆ setProgressTitleCallback()

void lvr2::ProgressBar::setProgressTitleCallback ( ProgressTitleCallbackPtr  ptr)
static

Registers a callback that is called when a new progress instance is created.

Parameters

Definition at line 78 of file Progress.cpp.

Member Data Documentation

◆ m_currentVal

size_t lvr2::ProgressBar::m_currentVal
protected

The current counter.

Definition at line 121 of file Progress.hpp.

◆ m_fillstring

string lvr2::ProgressBar::m_fillstring
protected

A fill string for correct output alignment.

Definition at line 133 of file Progress.hpp.

◆ m_maxVal

size_t lvr2::ProgressBar::m_maxVal
protected

The number of iterations.

Definition at line 118 of file Progress.hpp.

◆ m_mutex

boost::mutex lvr2::ProgressBar::m_mutex
protected

A mutex object for counter increment (for parallel executions)

Definition at line 124 of file Progress.hpp.

◆ m_percent

int lvr2::ProgressBar::m_percent
protected

The current progress in percent.

Definition at line 127 of file Progress.hpp.

◆ m_prefix

string lvr2::ProgressBar::m_prefix
protected

The prefix string.

Definition at line 115 of file Progress.hpp.

◆ m_progressCallback

ProgressCallbackPtr lvr2::ProgressBar::m_progressCallback = 0
staticprotected

Definition at line 135 of file Progress.hpp.

◆ m_stream

stringstream lvr2::ProgressBar::m_stream
protected

A string stream for output generation.

Definition at line 130 of file Progress.hpp.

◆ m_titleCallback

ProgressTitleCallbackPtr lvr2::ProgressBar::m_titleCallback = 0
staticprotected

Definition at line 136 of file Progress.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:27