Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProgressDisplay.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
26 #ifndef _APPBASE_PROGRESSDISPLAY_H
27 #define _APPBASE_PROGRESSDISPLAY_H
28 
29 #include <iostream>
30 #include <string>
31 
32 #include <hugin_shared.h>
33 #include <hugin_utils/utils.h>
34 
35 
36 namespace AppBase {
37 
42 {
43 protected:
45  explicit ProgressDisplay(int maximum=0) : m_canceled(false), m_maximum(maximum), m_progress(0) {};
46 public:
47  /* virtual destructor */
48  virtual ~ProgressDisplay() {};
50  void setMessage(const std::string& message, const std::string& filename="");
52  void taskFinished();
54  bool updateDisplay();
55  bool updateDisplay(const std::string& message);
56  bool updateDisplayValue();
58  void setMaximum(int newMaximum);
61  bool wasCancelled();
62 
63 protected:
67  virtual void updateProgressDisplay() = 0;
68 
69 protected:
70  bool m_canceled;
71  std::string m_message;
72  std::string m_filename;
73  int m_maximum;
75 };
76 
77 
81 {
82 protected:
84  virtual void updateProgressDisplay() {};
85 };
86 
90 {
91  public:
93  explicit StreamProgressDisplay(std::ostream & o) : ProgressDisplay(), m_stream(o) {};
95  virtual void updateProgressDisplay();
96  protected:
97  std::ostream & m_stream;
98 };
99 
100 }; //namespace
101 
102 #endif // _H
Dummy progress display, without output.
ProgressDisplay(int maximum=0)
constructor
virtual void updateProgressDisplay()
update the display, does output nothing
#define IMPEX
Definition: hugin_shared.h:39
StreamProgressDisplay(std::ostream &o)
constructor, connect with given outputstream
a progress display to print progress reports to a stream