vg
tools for working with variation graphs
Public Member Functions | Public Attributes | Private Attributes | List of all members
vg::Progressive Class Reference

#include <progressive.hpp>

Inheritance diagram for vg::Progressive:
vg::Constructor vg::HaplotypeIndexer vg::MSAConverter vg::RareVariantSimplifier vg::SmallSnarlSimplifier vg::StreamSorter< Message > vg::VariantAdder vg::VG

Public Member Functions

void preload_progress (const string &message)
 
void create_progress (const string &message, long count)
 
void create_progress (long count)
 
void update_progress (long i)
 
void increment_progress ()
 
void destroy_progress (void)
 

Public Attributes

bool show_progress = false
 

Private Attributes

string progress_message = "progress"
 
long progress_count
 
long last_progress
 
long progress_seen
 
ProgressBar * progress = nullptr
 

Detailed Description

Inherit form this class to give your class create_progress(), update_progress(), and destroy_progress() methods, and a public show_progress field that can be toggled on and off.

Must not be destroyed while a progress bar is active.

Member Function Documentation

◆ create_progress() [1/2]

void vg::Progressive::create_progress ( const string &  message,
long  count 
)

Create a progress bar showing the given message, with the given number of items to process. Does nothing if show_progress is false. Replaces any existing progress bar.

◆ create_progress() [2/2]

void vg::Progressive::create_progress ( long  count)

Create a progress bar with the given number of items to process, using either a default message, or the message passed to the last preload_progress call since a progress bar was destroyed. Does nothing if show_progress is false. Replaces any existing progress bar.

◆ destroy_progress()

void vg::Progressive::destroy_progress ( void  )

Destroy the current progress bar, if it exists.

◆ increment_progress()

void vg::Progressive::increment_progress ( )

Update the progress bar, noting that one additional item has been processed. Does nothing if no progress bar is displayed.

◆ preload_progress()

void vg::Progressive::preload_progress ( const string &  message)

If no progress bar is currently displayed, set the message to use for the next progress bar to be created. Does nothing if show_progress is false or when a progress bar is displayed.

Public so that users of a class can provide descriptive messages for generic progress operations (like VG's for_each_kmer_parallel).

◆ update_progress()

void vg::Progressive::update_progress ( long  i)

Update the progress bar, noting that the given number of items have been processed. Does nothing if no progress bar is displayed.

Member Data Documentation

◆ last_progress

long vg::Progressive::last_progress
private

◆ progress

ProgressBar* vg::Progressive::progress = nullptr
private

◆ progress_count

long vg::Progressive::progress_count
private

◆ progress_message

string vg::Progressive::progress_message = "progress"
private

◆ progress_seen

long vg::Progressive::progress_seen
private

◆ show_progress

bool vg::Progressive::show_progress = false

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