Public Member Functions | Protected Member Functions | Protected Attributes

lssr::ProgressCounter Class Reference

A progress counter class. More...

#include <Progress.hpp>

Collaboration diagram for lssr::ProgressCounter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ProgressCounter (int stepVal, string prefix="")
void operator++ ()

Protected Member Functions

void print_progress ()
 Prints the current state.

Protected Attributes

string m_prefix
 The prefix string.
size_t m_stepVal
 The step value for output generation.
size_t m_currentVal
 The current counter value.
boost::mutex m_mutex
 A mutex object for counter increment (for parallel executions).
stringstream m_stream
 A string stream for output generation.
string m_fillstring
 A fill string for correct output alignment.

Detailed Description

A progress counter class.

This class can be used of the number of performed operations is not known in advance (e.g. ASCII file reading). After m_stepVal} operations the current counter is printed.

Definition at line 89 of file Progress.hpp.


Constructor & Destructor Documentation

lssr::ProgressCounter::ProgressCounter ( int  stepVal,
string  prefix = "" 
)

Definition at line 49 of file Progress.cpp.


Member Function Documentation

void lssr::ProgressCounter::operator++ (  ) 

Definition at line 56 of file Progress.cpp.

Here is the call graph for this function:

void lssr::ProgressCounter::print_progress (  )  [protected]

Prints the current state.

Definition at line 66 of file Progress.cpp.

Here is the caller graph for this function:


Member Data Documentation

The current counter value.

Definition at line 118 of file Progress.hpp.

A fill string for correct output alignment.

Definition at line 127 of file Progress.hpp.

boost::mutex lssr::ProgressCounter::m_mutex [protected]

A mutex object for counter increment (for parallel executions).

Definition at line 121 of file Progress.hpp.

string lssr::ProgressCounter::m_prefix [protected]

The prefix string.

Definition at line 112 of file Progress.hpp.

The step value for output generation.

Definition at line 115 of file Progress.hpp.

stringstream lssr::ProgressCounter::m_stream [protected]

A string stream for output generation.

Definition at line 124 of file Progress.hpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Defines