Helper class for progress logging during time consuming processes. More...

#include <logutils.hpp>

Public Member Functions

 LoggerHelper (int max_, int chunks, int minsize)
 Default constructor. More...
 
std::pair< int, int > group (int group)
 Returns the start and end offsets of a chunk group. More...
 
void log (int it, const std::string &prefix)
 Log to the terminal. More...
 

Protected Attributes

std::vector< int > groups
 Group start/end offsets. More...
 
int per_chunk
 Will log for each per_chunk processed. More...
 
int max
 Total number of its. More...
 

Detailed Description

Helper class for progress logging during time consuming processes.

Constructor & Destructor Documentation

LoggerHelper::LoggerHelper ( int  max_,
int  chunks,
int  minsize 
)
inline

Default constructor.

Parameters
[in]max_The total number of tasks
[in]chunksThe number of chunks to divide tasks into
[in]minsizeThe minimum amount of tasks to enable logging

References groups, max, and per_chunk.

Member Function Documentation

std::pair<int, int> LoggerHelper::group ( int  group)
inline

Returns the start and end offsets of a chunk group.

Parameters
[in]groupThe requested chunk

References groups.

void LoggerHelper::log ( int  it,
const std::string &  prefix 
)
inline

Log to the terminal.

Parameters
[in]itCurrent chunk
[in]prefixThe prefix for the logging

References max, and per_chunk.

Member Data Documentation

std::vector<int> LoggerHelper::groups
protected

Group start/end offsets.

Referenced by group(), and LoggerHelper().

int LoggerHelper::max
protected

Total number of its.

Referenced by log(), and LoggerHelper().

int LoggerHelper::per_chunk
protected

Will log for each per_chunk processed.

Referenced by log(), and LoggerHelper().


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