MrSID Decode SDK for LiDAR Reference Manual  1.1.4.4709
ProgressDelegate.h
Go to the documentation of this file.
00001 /* //////////////////////////////////////////////////////////////////////////
00002 //                                                                         //
00003 // This code is Copyright (c) 2008-2010 LizardTech, Inc, 1008 Western      //
00004 // Avenue, Suite 200, Seattle, WA 98104.  Unauthorized use or distribution //
00005 // prohibited.  Access to and use of this code is permitted only under     //
00006 // license from LizardTech, Inc.  Portions of the code are protected by    //
00007 // US and foreign patents and other filings. All Rights Reserved.          //
00008 //                                                                         //
00010 /* PUBLIC */
00011 
00012 #ifndef __LIDAR_PROGRESS_DELEGATE_H__
00013 #define __LIDAR_PROGRESS_DELEGATE_H__
00014 
00015 #include "lidar/Base.h"
00016 
00017 LT_BEGIN_LIDAR_NAMESPACE
00018 
00029 class ProgressDelegate
00030 {
00031    DISABLE_COPY(ProgressDelegate);
00032 public:
00033    virtual ~ProgressDelegate(void);
00034 
00044    virtual void reportProgress(double progress, const char *message) = 0;
00053    virtual bool getCancelled(void) = 0;
00054 
00063    void setTotal(double total);
00072    void updateCompleted(double delta, const char *message);
00073 
00081    double getProgress(void) const;
00082 
00083 
00084    void warning(const char *format, ...);
00085    virtual void displayWarning(const char *message);
00086 
00087 protected:
00088    ProgressDelegate(void);
00089 
00090 private:
00091    double m_completed;
00092    double m_total;
00093 };
00094 
00095 class PercentProgressDelegate : public ProgressDelegate
00096 {
00097    DISABLE_COPY(PercentProgressDelegate);
00098 public:
00099    PercentProgressDelegate(void);
00100    ~PercentProgressDelegate(void);
00101 
00102    void reportProgress(double fractionDone, const char *message);
00103    bool getCancelled(void);
00104    void displayWarning(const char *message);
00105 
00106    void setCancelled(bool cancel);
00107 private:
00108    int m_lastUpdate;
00109    const char *m_lastMessage;
00110    bool m_cancelled;
00111 };
00112 
00113 LT_END_LIDAR_NAMESPACE
00114 #endif // __LIDAR_PROGRESS_DELEGATE_H__