MAGE  v0.171.0
Matthias Advanced Game Engine
mage::ProgressReporter Class Reference

#include <progress_reporter.hpp>

Classes

class  Impl
 

Public Member Functions

 ProgressReporter (std::string_view title, U32 nb_work, char progress_char='+', FU16 bar_length=0u)
 
 ProgressReporter (const ProgressReporter &reporter)=delete
 
 ProgressReporter (ProgressReporter &&reporter) noexcept
 
 ~ProgressReporter ()
 
ProgressReporteroperator= (const ProgressReporter &reporter)=delete
 
ProgressReporteroperator= (ProgressReporter &&reporter)=delete
 
void Update (U32 nb_work=1u)
 
void Done ()
 

Private Attributes

UniquePtr< Implm_impl
 

Detailed Description

A class of progress reporters.

Constructor & Destructor Documentation

◆ ProgressReporter() [1/3]

mage::ProgressReporter::ProgressReporter ( std::string_view  title,
U32  nb_work,
char  progress_char = '+',
FU16  bar_length = 0u 
)
explicit

Constructs a progress reporter.

Parameters
[in]titleThe title.
[in]nb_workThe total number of work units.
[in]progress_charThe character representing the progress.
[in]bar_lengthThe length of the progress bar. If bar_length is equal to 0 the default length will be chosen.

◆ ProgressReporter() [2/3]

mage::ProgressReporter::ProgressReporter ( const ProgressReporter reporter)
delete

Constructs a progress reporter from the given progress reporter.

Parameters
[in]reporterA reference to the progress reporter to copy.

◆ ProgressReporter() [3/3]

mage::ProgressReporter::ProgressReporter ( ProgressReporter &&  reporter)
defaultnoexcept

Constructs a progress reporter by moving the given progress reporter.

Parameters
[in]reporterA reference to the progress reporter to move.

◆ ~ProgressReporter()

mage::ProgressReporter::~ProgressReporter ( )
default

Destructs this progress reporter.

Member Function Documentation

◆ Done()

void mage::ProgressReporter::Done ( )

Finishes this progress reporter.

◆ operator=() [1/2]

ProgressReporter& mage::ProgressReporter::operator= ( const ProgressReporter reporter)
delete

Copies the given progress reporter to this progress reporter.

Parameters
[in]reporterA reference to the progress reporter to copy.
Returns
A reference to the copy of the given progress reporter (i.e. this progress reporter).

◆ operator=() [2/2]

ProgressReporter& mage::ProgressReporter::operator= ( ProgressReporter &&  reporter)
delete

Copies the given progress reporter to this progress reporter.

Parameters
[in]reporterA reference to the progress reporter to move.
Returns
A reference to moved progress reporter (i.e. this progress reporter).

◆ Update()

void mage::ProgressReporter::Update ( U32  nb_work = 1u)

Updates this progress reporter.

Parameters
[in]nb_workThe number of work units that are done.

Member Data Documentation

◆ m_impl

UniquePtr< Impl > mage::ProgressReporter::m_impl
private

A pointer to the implementation of this progress reporter.