Class PacmanProgressBar

Class Documentation

class PacmanProgressBar

Public Functions

PacmanProgressBar(size_t max_val, string prefix = "", size_t bar_length = 60)

Ctor.

Parameters:
  • max_val – The number of performed iterations

  • prefix – The prefix string for progress output

virtual ~PacmanProgressBar()
void operator++()

Increases the counter of performed iterations.

Public Static Functions

static void setProgressCallback(ProgressCallbackPtr)

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

Param :

static void setProgressTitleCallback(ProgressTitleCallbackPtr)

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

Param :

Protected Functions

void print_bar()

Prints the output.

Protected Attributes

string m_prefix

The prefix string.

size_t m_maxVal

The number of iterations.

size_t m_currentVal

The current counter.

boost::mutex m_mutex

A mutex object for counter increment (for parallel executions)

int m_percent

The current progress in percent.

int m_bar_length
stringstream m_stream

A string stream for output generation.

string m_fillstring

A fill string for correct output alignment.

Protected Static Attributes

static PacmanProgressCallbackPtr m_progressCallback
static PacmanProgressTitleCallbackPtr m_titleCallback