SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProgressReporter.h
Go to the documentation of this file.
1 #ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
2 /*
3  For more information, please see: http://software.sci.utah.edu
4 
5  The MIT License
6 
7  Copyright (c) 2009 Scientific Computing and Imaging Institute,
8  University of Utah.
9 
10 
11  Permission is hereby granted, free of charge, to any person obtaining a
12  copy of this software and associated documentation files (the "Software"),
13  to deal in the Software without restriction, including without limitation
14  the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  and/or sell copies of the Software, and to permit persons to whom the
16  Software is furnished to do so, subject to the following conditions:
17 
18  The above copyright notice and this permission notice shall be included
19  in all copies or substantial portions of the Software.
20 
21  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  DEALINGS IN THE SOFTWARE.
28 */
29 
30 
31 
32 ///
33 ///@file ProgressReporter.h:
34 ///
35 ///@author
36 /// Yarden Livnat
37 /// Department of Computer Science
38 /// University of Utah
39 ///@date July 2003
40 ///
41 
42 
43 #ifndef SCIRun_Core_Util_ProgressReporter_h
44 #define SCIRun_Core_Util_ProgressReporter_h
45 
46 
47 #include <string>
48 #include <iostream>
50 
52 
53 namespace SCIRun {
54 
55 class SCISHARE ProgressReporter
56 {
57  public:
58  ProgressReporter();
59  virtual ~ProgressReporter();
60 
61  virtual void report_start(const std::string& tag);
62  virtual void report_end();
63 
64  virtual void error(const std::string& msg);
65  virtual void warning(const std::string& msg);
66  virtual void remark(const std::string& msg);
67  virtual void status(const std::string& msg);
68 
69  virtual void add_raw_message(const std::string &msg);
70 
71  // This one isn't as thread safe as the other ProgressReporter functions.
72  // Use add_raw_message or one of the others instead if possible.
73  virtual std::ostream &msg_stream();
74  virtual void msg_stream_flush();
75 
76  // Execution time progress.
77  // Percent is number between 0.0-1.0
78  virtual void update_progress(double percent);
79  virtual void update_progress(int current, int max);
80 
81  protected:
82  AtomicCounter progress_current_;
83  int progress_max_;
84 };
85 
86 
87 } // Namespace SCIRun
88 
89 #endif
90 #endif
#define msg(m)
Definition: PiecewiseInterp.h:55
#define SCISHARE
Definition: share.h:39
Definition: ParallelLinearAlgebraTests.cc:358