Triumvirate C++ API 0.5.0
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
trv::sys::ProgressBar Class Reference

Progress bar for tracking tasks. More...

#include <monitor.hpp>

+ Collaboration diagram for trv::sys::ProgressBar:

Public Member Functions

 ProgressBar (int task_count, std::string name="")
 Construct a progress bar.
 
void set_bar_width (int bar_width)
 Set progress bar width.
 
void set_nodes (std::vector< float > nodes)
 Set progress bar width.
 
void set_task_idx (int task_idx)
 Set current (or initial) task index.
 
void set_progress (float progress)
 Set current (or initial) progress value.
 
void update (int task_idx_now)
 Update the progress bar.
 
void update (float progress_now)
 Update the progress bar.
 

Public Attributes

std::string name
 progress bar name
 
int task_count = 1
 total task count
 
int task_idx = 0
 task index
 
float progress = 0.
 progress value in [0, 1] interval
 

Detailed Description

Progress bar for tracking tasks.

Definition at line 298 of file monitor.hpp.

Constructor & Destructor Documentation

◆ ProgressBar()

trv::sys::ProgressBar::ProgressBar ( int task_count,
std::string name = "" )
explicit

Construct a progress bar.

Parameters
task_countTotal task count (at least 1).
nameProgress bar name (default is an empty string).

Definition at line 291 of file monitor.cpp.

Member Function Documentation

◆ set_bar_width()

void trv::sys::ProgressBar::set_bar_width ( int bar_width)

Set progress bar width.

Parameters
bar_widthProgress bar width (at least 1).

Definition at line 304 of file monitor.cpp.

+ Here is the call graph for this function:

◆ set_nodes()

void trv::sys::ProgressBar::set_nodes ( std::vector< float > nodes)

Set progress bar width.

Parameters
nodesProgress values (strictly increasing in the interval [0, 1]) at which the bar is updated.

Definition at line 311 of file monitor.cpp.

◆ set_task_idx()

void trv::sys::ProgressBar::set_task_idx ( int task_idx)

Set current (or initial) task index.

Parameters
task_idxCurrent task index within the total task count.
Note
When the tas index is zero, it means no task has completed yet.

Definition at line 320 of file monitor.cpp.

+ Here is the call graph for this function:

◆ set_progress()

void trv::sys::ProgressBar::set_progress ( float progress)

Set current (or initial) progress value.

Parameters
progressCurrent progress value in the interval [0, 1].

Definition at line 333 of file monitor.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update() [1/2]

void trv::sys::ProgressBar::update ( int task_idx_now)

Update the progress bar.

Parameters
task_idx_nowLatest completed task index.
Note
When the tas index is zero, it means no task has completed yet.

Definition at line 347 of file monitor.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update() [2/2]

void trv::sys::ProgressBar::update ( float progress_now)

Update the progress bar.

Parameters
progress_nowLatest progress value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 353 of file monitor.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ name

std::string trv::sys::ProgressBar::name

progress bar name

Definition at line 300 of file monitor.hpp.

◆ task_count

int trv::sys::ProgressBar::task_count = 1

total task count

Definition at line 301 of file monitor.hpp.

◆ task_idx

int trv::sys::ProgressBar::task_idx = 0

task index

Definition at line 302 of file monitor.hpp.

◆ progress

float trv::sys::ProgressBar::progress = 0.

progress value in [0, 1] interval

Definition at line 303 of file monitor.hpp.


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