libcrn  3.9.5
A document image processing library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
crn::Progress Class Referenceabstract

Base class for a progress display. More...

#include <CRNProgress.h>

+ Inheritance diagram for crn::Progress:
+ Collaboration diagram for crn::Progress:

Public Types

enum  Type { Type::PERCENT = 0, Type::ABSOLUTE = 1 }
 

Public Member Functions

 Progress (const String &nam, size_t maxcount=100)
 Constructor. More...
 
 Progress (const Progress &)=delete
 
 Progress (Progress &&)=default
 
Progressoperator= (const Progress &)=delete
 
Progressoperator= (Progress &&)=default
 
virtual ~Progress ()
 Destructor. More...
 
void Advance ()
 Progresses of one step. More...
 
void SetMaxCount (size_t maxcount, bool reset=true)
 Sets the total number of steps. More...
 
void Reset ()
 Resets the progress to 0. More...
 
void SetType (Type typ) noexcept
 Sets the type of progress bar. More...
 
void SetName (const crn::String &nam)
 

Protected Member Functions

virtual void display (const String &msg)=0
 Displays the progress. More...
 

Protected Attributes

String name
 
size_t current
 
size_t end
 
String disp
 
Type type
 

Detailed Description

Base class for a progress display.

Progress display base class

Author
Yann LEYDIER
Date
August 2009
Version
0.1

Definition at line 39 of file CRNProgress.h.

Member Enumeration Documentation

enum crn::Progress::Type
strong
Enumerator
PERCENT 
ABSOLUTE 

Definition at line 42 of file CRNProgress.h.

Constructor & Destructor Documentation

crn::Progress::Progress ( const String nam,
size_t  maxcount = 100 
)
inline

Constructor.

Definition at line 44 of file CRNProgress.h.

crn::Progress::Progress ( const Progress )
delete
crn::Progress::Progress ( Progress &&  )
default
Progress::~Progress ( )
virtual

Destructor.

Reimplemented in GtkCRN::Progress.

Definition at line 59 of file CRNProgress.cpp.

Member Function Documentation

void Progress::Advance ( )

Progresses of one step.

Progress of one unit

Definition at line 34 of file CRNProgress.cpp.

virtual void crn::Progress::display ( const String msg)
protectedpure virtual

Displays the progress.

Implemented in crn::ConsoleProgress, and GtkCRN::Progress.

Progress& crn::Progress::operator= ( const Progress )
delete
Progress& crn::Progress::operator= ( Progress &&  )
default
void Progress::Reset ( )

Resets the progress to 0.

Definition at line 53 of file CRNProgress.cpp.

void crn::Progress::SetMaxCount ( size_t  maxcount,
bool  reset = true 
)
inline

Sets the total number of steps.

Definition at line 56 of file CRNProgress.h.

void crn::Progress::SetName ( const crn::String nam)
inline

Definition at line 63 of file CRNProgress.h.

void crn::Progress::SetType ( Type  typ)
inlinenoexcept

Sets the type of progress bar.

Definition at line 61 of file CRNProgress.h.

Member Data Documentation

size_t crn::Progress::current
protected

The current step

Definition at line 70 of file CRNProgress.h.

String crn::Progress::disp
protected

The text displayed

Definition at line 72 of file CRNProgress.h.

size_t crn::Progress::end
protected

The last step

Definition at line 71 of file CRNProgress.h.

String crn::Progress::name
protected

Definition at line 69 of file CRNProgress.h.

Type crn::Progress::type
protected

The type of progress bar (Progress::PERCENT or Progress::ABSOLUTE

Definition at line 73 of file CRNProgress.h.


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