00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRS_PROGRESS_H
00019 #define VRS_PROGRESS_H
00020
00021 #include <vrs/config.h>
00022
00023 namespace VRS {
00024
00027 class VRS_CORE_API Progress {
00028
00029 public:
00030 Progress(
00031 const std::string& description,
00032 double totalValue,
00033 bool forceShow = false,
00034 bool allowChildProgress = true
00035 );
00050 ~Progress();
00051
00052 std::string description() const;
00056 double totalValue() const;
00060 double currentValue() const;
00065 double percent() const;
00070 bool isCanceled() const;
00075 double timeElapsed() const;
00080 std::string timeElapsedString() const;
00085 double timeRemaining() const;
00090 std::string timeRemainingString() const;
00095 bool update(double complete, const std::string& newDescription = std::string());
00105 bool finish();
00111 void cancel();
00115 private:
00116
00117 static void* operator new(size_t);
00118 static void operator delete(void*);
00119
00120 std::string description_;
00121 double totalValue_;
00122 double currentValue_;
00123 double timeStarted_;
00124 bool allowChildProgress_;
00125 bool isActive_;
00126 bool isFinished_;
00127 bool isCanceled_;
00128 };
00129
00130 }
00131
00132 #endif // VRS_PROGRESS_H