SourceXtractorPlusPlus  0.13
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:
[legend]
Collaboration diagram for SourceXtractor::ProgressWidget:
[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

WINDOW * m_window
 
std::chrono::steady_clock::time_point m_started
 
short m_done_color
 
short m_progress_color
 

Detailed Description

Set of progress bars/information entries.

Definition at line 486 of file ProgressNCurses.cpp.

Constructor & Destructor Documentation

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 503 of file ProgressNCurses.cpp.

SourceXtractor::ProgressWidget::~ProgressWidget ( )
inline

Destructor

Definition at line 511 of file ProgressNCurses.cpp.

References m_window.

Member Function Documentation

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 588 of file ProgressNCurses.cpp.

References std::chrono::duration_cast(), std::ostringstream::fill(), m, m_window, s, and std::setw().

Referenced by update().

Here is the call graph for this function:

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 609 of file ProgressNCurses.cpp.

References bar, std::string::c_str(), std::fixed(), m_done_color, m_progress_color, m_window, std::setprecision(), and std::ostringstream::str().

Referenced by update().

Here is the call graph for this function:

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

Definition at line 542 of file ProgressNCurses.cpp.

References m_window.

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

Move the progress widget

Parameters
yLine
xColumn

Definition at line 522 of file ProgressNCurses.cpp.

References m_window.

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 534 of file ProgressNCurses.cpp.

References m_window.

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

Update and redraw the progress information

Definition at line 549 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

short SourceXtractor::ProgressWidget::m_done_color
private

Definition at line 660 of file ProgressNCurses.cpp.

Referenced by drawProgressLine().

short SourceXtractor::ProgressWidget::m_progress_color
private

Definition at line 660 of file ProgressNCurses.cpp.

Referenced by drawProgressLine().

std::chrono::steady_clock::time_point SourceXtractor::ProgressWidget::m_started
private

Definition at line 659 of file ProgressNCurses.cpp.

Referenced by update().

WINDOW* SourceXtractor::ProgressWidget::m_window
private

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