SourceXtractorPlusPlus  0.13
Please provide a description of the project.
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
SourceXtractor::ProgressNCurses Class Reference

#include <ProgressNCurses.h>

Inheritance diagram for SourceXtractor::ProgressNCurses:
[legend]
Collaboration diagram for SourceXtractor::ProgressNCurses:
[legend]

Classes

class  Dashboard
 

Public Member Functions

virtual ~ProgressNCurses ()
 
 ProgressNCurses ()
 
void handleMessage (const std::list< ProgressInfo > &info) override
 
void handleMessage (const bool &done) override
 
- Public Member Functions inherited from SourceXtractor::ProgressReporter
virtual ~ProgressReporter ()=default
 
 ProgressReporter ()=default
 
virtual void handleMessage (const T &message)=0
 
virtual void handleMessage (const T &message)=0
 
- Public Member Functions inherited from SourceXtractor::Observer< T >
virtual ~Observer ()=default
 
virtual void handleMessage (const T &message)=0
 

Static Public Member Functions

static bool isTerminalCapable ()
 

Protected Attributes

std::unique_ptr< Dashboardm_dashboard
 

Detailed Description

This concrete implementation of ProgressReporter uses a progress bar on the bottom of the terminal to report the progress. std::cerr is used, as std::cout could have been used for the output catalog. It uses a separate thread, and refreshes the content every second. It relies on raw ANSI escape codes, instead of ncurses, to avoid introducing an extra dependency.

See also
https://en.wikipedia.org/wiki/ANSI_escape_code

Definition at line 40 of file ProgressNCurses.h.

Constructor & Destructor Documentation

◆ ~ProgressNCurses()

SourceXtractor::ProgressNCurses::~ProgressNCurses ( )
virtual

Definition at line 873 of file ProgressNCurses.cpp.

◆ ProgressNCurses()

SourceXtractor::ProgressNCurses::ProgressNCurses ( )

Definition at line 869 of file ProgressNCurses.cpp.

References m_dashboard.

Member Function Documentation

◆ handleMessage() [1/2]

void SourceXtractor::ProgressNCurses::handleMessage ( const bool &  done)
override

Give the printing thread a chance to exit.

Definition at line 885 of file ProgressNCurses.cpp.

References m_dashboard.

◆ handleMessage() [2/2]

void SourceXtractor::ProgressNCurses::handleMessage ( const std::list< ProgressInfo > &  info)
override

This class intercepts the first call to update to decide on the size of the bottom block, and start the thread.

Definition at line 880 of file ProgressNCurses.cpp.

References m_dashboard.

◆ isTerminalCapable()

bool SourceXtractor::ProgressNCurses::isTerminalCapable ( )
static
Returns
true if the attached terminal has the required capabilities to render the progress bar

Definition at line 876 of file ProgressNCurses.cpp.

Referenced by SourceXtractor::ProgressReporterFactory::createProgressMediator().

Member Data Documentation

◆ m_dashboard

std::unique_ptr<Dashboard> SourceXtractor::ProgressNCurses::m_dashboard
protected

Definition at line 64 of file ProgressNCurses.h.

Referenced by handleMessage(), and ProgressNCurses().


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