SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SourceXtractor::ProgressWidget Class Reference

Set of progress bars/information entries. More...

Inheritance diagram for SourceXtractor::ProgressWidget:
Inheritance graph
[legend]
Collaboration diagram for SourceXtractor::ProgressWidget:
Collaboration graph
[legend]

Public Member Functions

 ProgressWidget (int height, int width, int y, int x, short done_color, short progress_color)
 
 ~ProgressWidget ()
 
void move (int y, int x)
 
void resize (int height, int width)
 
unsigned getHeight () const
 
void update (const std::list< ProgressInfo > &info)
 

Private Member Functions

void drawElapsed (size_t value_position, const std::chrono::steady_clock::duration &elapsed, int line) const
 
void drawProgressLine (int value_position, int bar_width, int line, const std::string &label, int total, int done) const
 

Private Attributes

WINDOWm_window
 
std::chrono::steady_clock::time_point m_started = std::chrono::steady_clock::now()
 
short m_done_color
 
short m_progress_color
 

Detailed Description

Set of progress bars/information entries.

Definition at line 502 of file ProgressNCurses.cpp.

Constructor & Destructor Documentation

◆ ProgressWidget()

SourceXtractor::ProgressWidget::ProgressWidget ( int height,
int width,
int y,
int x,
short done_color,
short progress_color )
inline

Constructor

Parameters
heightHeight in lines
widthWidth in columns
yStart line
xStart column
done_colorColor for the done part
progress_colorColor for the progress bar

Definition at line 519 of file ProgressNCurses.cpp.

◆ ~ProgressWidget()

SourceXtractor::ProgressWidget::~ProgressWidget ( )
inline

Destructor

Definition at line 525 of file ProgressNCurses.cpp.

References m_window.

Member Function Documentation

◆ drawElapsed()

void SourceXtractor::ProgressWidget::drawElapsed ( size_t value_position,
const std::chrono::steady_clock::duration & elapsed,
int line ) const
inlineprivate

Draw the elapsed counter

Definition at line 602 of file ProgressNCurses.cpp.

References m_window, and std::setw().

Referenced by update().

Here is the call graph for this function:

◆ drawProgressLine()

void SourceXtractor::ProgressWidget::drawProgressLine ( int value_position,
int bar_width,
int line,
const std::string & label,
int total,
int done ) const
inlineprivate

Draw the set of progress bar/report on the bottom of the screen

Definition at line 623 of file ProgressNCurses.cpp.

References std::fixed(), m_done_color, m_progress_color, m_window, and std::setprecision().

Referenced by update().

Here is the call graph for this function:

◆ getHeight()

unsigned SourceXtractor::ProgressWidget::getHeight ( ) const
inline
Returns
The height of the progress widget

Definition at line 556 of file ProgressNCurses.cpp.

References m_window.

◆ move()

void SourceXtractor::ProgressWidget::move ( int y,
int x )
inline

Move the progress widget

Parameters
yLine
xColumn

Definition at line 536 of file ProgressNCurses.cpp.

References m_window, x, and y.

◆ resize()

void SourceXtractor::ProgressWidget::resize ( int height,
int width )
inline

Resize the progress widget

Parameters
heightThe height in lines
widthThe width in columns

Definition at line 548 of file ProgressNCurses.cpp.

References m_window.

◆ update()

void SourceXtractor::ProgressWidget::update ( const std::list< ProgressInfo > & info)
inline

Update and redraw the progress information

Definition at line 563 of file ProgressNCurses.cpp.

References drawElapsed(), drawProgressLine(), m_started, m_window, and std::chrono::steady_clock::now().

Here is the call graph for this function:

Member Data Documentation

◆ m_done_color

short SourceXtractor::ProgressWidget::m_done_color
private

Definition at line 674 of file ProgressNCurses.cpp.

Referenced by drawProgressLine().

◆ m_progress_color

short SourceXtractor::ProgressWidget::m_progress_color
private

Definition at line 675 of file ProgressNCurses.cpp.

Referenced by drawProgressLine().

◆ m_started

std::chrono::steady_clock::time_point SourceXtractor::ProgressWidget::m_started = std::chrono::steady_clock::now()
private

Definition at line 673 of file ProgressNCurses.cpp.

Referenced by update().

◆ m_window

WINDOW* SourceXtractor::ProgressWidget::m_window
private

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