MrSID Decode SDK for LiDAR Reference Manual  1.1.4.4709
ProgressDelegate.h
Go to the documentation of this file.
1 /* //////////////////////////////////////////////////////////////////////////
2 // //
3 // This code is Copyright (c) 2008-2010 LizardTech, Inc, 1008 Western //
4 // Avenue, Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
5 // prohibited. Access to and use of this code is permitted only under //
6 // license from LizardTech, Inc. Portions of the code are protected by //
7 // US and foreign patents and other filings. All Rights Reserved. //
8 // //
10 /* PUBLIC */
11 
12 #ifndef __LIDAR_PROGRESS_DELEGATE_H__
13 #define __LIDAR_PROGRESS_DELEGATE_H__
14 
15 #include "lidar/Base.h"
16 
17 LT_BEGIN_LIDAR_NAMESPACE
18 
30 {
31  DISABLE_COPY(ProgressDelegate);
32 public:
33  virtual ~ProgressDelegate(void);
34 
44  virtual void reportProgress(double progress, const char *message) = 0;
53  virtual bool getCancelled(void) = 0;
54 
63  void setTotal(double total);
72  void updateCompleted(double delta, const char *message);
73 
81  double getProgress(void) const;
82 
83 
84  void warning(const char *format, ...);
85  virtual void displayWarning(const char *message);
86 
87 protected:
88  ProgressDelegate(void);
89 
90 private:
91  double m_completed;
92  double m_total;
93 };
94 
96 {
97  DISABLE_COPY(PercentProgressDelegate);
98 public:
101 
102  void reportProgress(double fractionDone, const char *message);
103  bool getCancelled(void);
104  void displayWarning(const char *message);
105 
106  void setCancelled(bool cancel);
107 private:
108  int m_lastUpdate;
109  const char *m_lastMessage;
110  bool m_cancelled;
111 };
112 
113 LT_END_LIDAR_NAMESPACE
114 #endif // __LIDAR_PROGRESS_DELEGATE_H__
virtual void displayWarning(const char *message)
virtual bool getCancelled(void)=0
Indicate weather the operation should be cancelled.
void updateCompleted(double delta, const char *message)
Update the amount of work that has been done.
void warning(const char *format,...)
double getProgress(void) const
Get the fraction the work completed.
virtual void reportProgress(double progress, const char *message)=0
Displays the progress of the operation.
ProgressDelegate is the base class for progress and interrupt reporting.
void setTotal(double total)
Set the total amount of work that must be done.
virtual ~ProgressDelegate(void)

LizardTech