TPIE

2362a60
progress_indicator_subindicator.h
Go to the documentation of this file.
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
2 // vi:set ts=4 sts=4 sw=4 noet :
3 // Copyright 2008, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
24 
25 #ifndef __TPIE_PROGRESS_INDICATOR_SUBINDICATOR_H__
26 #define __TPIE_PROGRESS_INDICATOR_SUBINDICATOR_H__
27 #include <tpie/portability.h>
28 #include <tpie/util.h>
30 
31 namespace tpie {
32 
34  enum type {
35  enabled,
36  disabled
37  };
38 };
39 
41 public:
42  void refresh();
43  virtual void push_breadcrumb(const char * crumb, description_importance importance);
44  virtual void pop_breadcrumb();
45  virtual void init(stream_size_type range);
46  virtual void done();
47 
48  void set_crumb(const std::string & c) {m_crumb = c;}
49 
50  void setup(progress_indicator_base * parent,
51  stream_size_type outerRange,
52  const char * crumb=0,
53  description_importance importance=IMPORTANCE_MAJOR,
54  log_group_mode::type logGroupMode=log_group_mode::enabled);
55 
59 
61  stream_size_type outerRange,
62  const char * crumb=0,
63  description_importance importance=IMPORTANCE_MAJOR,
64  log_group_mode::type logGroupMode=log_group_mode::enabled);
65 #ifndef TPIE_NDEBUG
67 #endif
68 protected:
69  progress_indicator_base * m_parent;
70  stream_size_type m_outerRange;
71  stream_size_type m_oldValue;
72  std::string m_crumb;
73  description_importance m_importance;
74  log_group_mode::type m_logGroupMode;
75 #ifndef TPIE_NDEBUG
76  bool m_init_called;
77  bool m_done_called;
78 #endif
79 };
80 
81 } //namespace tpie
82 #endif //__TPIE_PROGRESS_INDICATOR_SUBINDICATOR_H__
The base class for indicating the progress of some task.
virtual void done()
Advance the indicator to the end.
This file contains a few deprecated definitions for legacy code.
Progress indicator base.
Miscellaneous utility functions.
virtual void init(stream_size_type range)
Initialize progress indicator.
void refresh()
Display the indicator.