xmscore
1.0
|
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 | |
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.
xms::Progress::Progress | ( | const std::string & | a_message | ) |
Constructor.
[in] | a_message | the new message for an operation |
Definition at line 59 of file Progress.cpp.
References xms::iListener(), and m_stackIndex.
void xms::Progress::CurrentItem | ( | long long | a_item | ) |
Give notification for the number of items completed. Used with SetItemCount.
[in] | a_item | the 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().
void xms::Progress::ProgressStatus | ( | double | a_fractionComplete | ) |
Give notification for the progress percent complete.
[in] | a_fractionComplete | amount 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().
void xms::Progress::SetItemCount | ( | long long | a_count | ) |
Set the number of items to be processed. Used with CurrentItem.
[in] | a_count | the number of items to be processed |
Definition at line 93 of file Progress.cpp.
References m_itemCount.
Referenced by ProgressUnitTests::testProgress().
void xms::Progress::UpdateMessage | ( | const std::string & | a_message | ) |
Update the current progress message.
[in] | a_message | the new message for an operation |
Definition at line 82 of file Progress.cpp.
References xms::iListener(), and m_stackIndex.
Referenced by ProgressUnitTests::testProgress().