Skip to content

Class astrea::utilities::ProgressBar

ClassList > astrea > utilities > ProgressBar

A simple console progress bar utility.

  • #include <ProgressBar.hpp>

Public Functions

Type Name
ProgressBar (const std::size_t & maxRecords, const std::string & title="Progress", const std::size_t & frequency=0, const std::size_t & barWidth=50)
Constructs a ProgressBar instance.
std::size_t get_progress () const
Increments the progress by one record.
void operator() ()
Updates the progress bar and prints it to the console.
void reset ()
Resets the progress bar to the initial state.
~ProgressBar () = default
Default destructor for ProgressBar .

Public Functions Documentation

function ProgressBar

Constructs a ProgressBar instance.

inline astrea::utilities::ProgressBar::ProgressBar (
    const std::size_t & maxRecords,
    const std::string & title="Progress",
    const std::size_t & frequency=0,
    const std::size_t & barWidth=50
) 

Parameters:

  • maxRecords The maximum number of records to process.
  • title The title of the progress bar.
  • frequency The frequency of updates (in terms of records processed).
  • barWidth The width of the progress bar in characters.

function get_progress

Increments the progress by one record.

inline std::size_t astrea::utilities::ProgressBar::get_progress () const


function operator()

Updates the progress bar and prints it to the console.

inline void astrea::utilities::ProgressBar::operator() () 

This method should be called periodically to update the progress bar.


function reset

Resets the progress bar to the initial state.

inline void astrea::utilities::ProgressBar::reset () 


function ~ProgressBar

Default destructor for ProgressBar .

astrea::utilities::ProgressBar::~ProgressBar () = default



The documentation for this class was generated from the following file astrea/utilities/utilities/ProgressBar.hpp