Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013 #ifndef _FBXSDK_FILEIO_PROGRESS_H_
00014 #define _FBXSDK_FILEIO_PROGRESS_H_
00015
00016 #include <fbxsdk/fbxsdk_def.h>
00017
00018 #include <fbxsdk/core/base/fbxstring.h>
00019
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021
00022 typedef bool (*FbxProgressCallback)(void* pArgs, float pPercentage, const char* pStatus);
00023
00024 #ifndef FBXSDK_ENV_WINRT
00025 class FbxSpinLock;
00026 #endif
00027
00031 class FBXSDK_DLL FbxProgress
00032 {
00033 public:
00037 void SetProgressCallback(FbxProgressCallback pCallback, void* pArgs=NULL);
00038
00042 void SetTotal(float pTotal);
00043
00047 void SetThreshold(float pThreshold);
00048
00053 void Update(float pDelta, const char* pStatus=NULL);
00054
00056 void Reset();
00057
00061 float GetProgress(FbxString* pStatus=NULL);
00062
00065 void Complete(const char* pStatus=NULL);
00066
00068 void Cancel();
00069
00071 inline bool IsCanceled() const { return mCanceled; }
00072
00073
00074
00075
00076 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00077 FbxProgress();
00078 ~FbxProgress();
00079
00080 private:
00081 void Acquire();
00082 void Release();
00083 float GetPercent() const;
00084 bool ExecuteCallback() const;
00085
00086 #ifndef FBXSDK_ENV_WINRT
00087 FbxSpinLock* mLock;
00088 #endif
00089 float mCurrent;
00090 float mPrevious;
00091 float mTotal;
00092 float mThreshold;
00093 FbxString mStatus;
00094 FbxProgressCallback mCallback;
00095 void* mCallbackArgs;
00096 bool mCanceled;
00097 #endif
00098 };
00099
00100 #include <fbxsdk/fbxsdk_nsend.h>
00101
00102 #endif