autoppl  v0.8
A C++ template library for probabilistic programming
ppl::util::ProgressLogger Struct Reference

#include <logging.hpp>

Public Member Functions

 ProgressLogger (size_t max, const std::string &name, std::ostream &os=std::cout)
 
 ~ProgressLogger ()
 
void printProgress (size_t step)
 

Detailed Description

ProgressLogger prints a visual progress bar counting towards 100% completion of an algorithm or task (really, any for loop).

This prints directly to the output stream provided in the constructor, and no print statements should be made in the period between calls to printProgress.

Constructor & Destructor Documentation

◆ ProgressLogger()

ppl::util::ProgressLogger::ProgressLogger ( size_t  max,
const std::string &  name,
std::ostream &  os = std::cout 
)
inline

Constructs a ProgressLogger object.

Parameters
maxthe value being counted towards,
e.g. the upper-bound of the for-loop
namestring to print alongside the progress bar

◆ ~ProgressLogger()

ppl::util::ProgressLogger::~ProgressLogger ( )
inline

When the logger goes out of scope, append a new line

Member Function Documentation

◆ printProgress()

void ppl::util::ProgressLogger::printProgress ( size_t  step)
inline

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