xmscore  1.0
xms::Progress Class Reference

Stack based class to give notification of progress for a long task. Progress can be stacked by making multiple instances of Progress going down the call chain. More...

Public Member Functions

 Progress (const std::string &a_message)
 Constructor. More...
 
 ~Progress ()
 Destructor.
 
void UpdateMessage (const std::string &a_message)
 Update the current progress message. More...
 
void SetItemCount (long long a_count)
 Set the number of items to be processed. Used with CurrentItem. More...
 
void CurrentItem (long long a_item)
 Give notification for the number of items completed. Used with SetItemCount. More...
 
void ProgressStatus (double a_percentComplete)
 Give notification for the progress percent complete. More...
 

Private Attributes

int m_stackIndex
 instances index on stack of instances
 
long long m_itemCount
 number of items to process
 

Detailed Description

Stack based class to give notification of progress for a long task. Progress can be stacked by making multiple instances of Progress going down the call chain.

Definition at line 22 of file Progress.h.

Constructor & Destructor Documentation

◆ Progress()

xms::Progress::Progress ( const std::string &  a_message)

Constructor.

Parameters
[in]a_messagethe new message for an operation

Definition at line 59 of file Progress.cpp.

References xms::iListener(), and m_stackIndex.

Member Function Documentation

◆ CurrentItem()

void xms::Progress::CurrentItem ( long long  a_item)

Give notification for the number of items completed. Used with SetItemCount.

Parameters
[in]a_itemthe current item being processed

Definition at line 102 of file Progress.cpp.

References xms::iListener(), m_itemCount, m_stackIndex, and XM_ASSERT.

Referenced by ProgressUnitTests::testProgress().

◆ ProgressStatus()

void xms::Progress::ProgressStatus ( double  a_fractionComplete)

Give notification for the progress percent complete.

Parameters
[in]a_fractionCompleteamount complete from 0.0 to 1.0

Definition at line 116 of file Progress.cpp.

References xms::iListener(), m_itemCount, m_stackIndex, and XM_ASSERT.

Referenced by ProgressUnitTests::testProgress().

◆ SetItemCount()

void xms::Progress::SetItemCount ( long long  a_count)

Set the number of items to be processed. Used with CurrentItem.

Parameters
[in]a_countthe number of items to be processed

Definition at line 93 of file Progress.cpp.

References m_itemCount.

Referenced by ProgressUnitTests::testProgress().

◆ UpdateMessage()

void xms::Progress::UpdateMessage ( const std::string &  a_message)

Update the current progress message.

Parameters
[in]a_messagethe new message for an operation

Definition at line 82 of file Progress.cpp.

References xms::iListener(), and m_stackIndex.

Referenced by ProgressUnitTests::testProgress().


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