TPIE

2362a60
dummy_progress.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 #ifndef __TPIE_DUMMY_PROGRESS__
20 #define __TPIE_DUMMY_PROGRESS__
21 
23 
31 
32 namespace tpie {
33 
34 struct dummy_progress_indicator;
35 
40 
46  // Do nothing.
47  }
48 
53  // Do nothing.
54  }
55 
58  return *this;
59  }
60 
61  template <typename T>
62  inline dummy_fraction_progress & operator << (const T &) {
63  return *this;
64  }
65 
68  inline void init(stream_size_type range = 0) {
69  unused(range);
70  }
71 
74  inline void done() {
75  }
76 };
77 
82 
84  inline dummy_progress_indicator() {
85  // Do nothing.
86  }
87 
88  // fractional_subindicator style constructor
90  const char * /*id*/, const char * /*file*/, const char * /*function*/,
91  stream_size_type /*n*/, const char *crumb=0,
92  bool importance=true, bool enabled=true) {
93  unused(crumb);
94  unused(importance);
95  unused(enabled);
96  }
97 
101  inline void init(stream_size_type range = 0) {
102  unused(range);
103  }
104 
108  inline void step(stream_size_type) { }
109 
113  inline void step() { }
114 
118  inline void done() { }
119 };
120 
126 template <bool use_progress>
129  typedef fractional_progress fp;
131 };
132 
133 template <>
134 struct progress_types<false> {
136  typedef dummy_fraction_progress fp;
138 };
139 
140 }
141 #endif //__TPIE_DUMMY_PROGRESS__
void init(stream_size_type range=0)
Initialize progress indicator.
void done()
Advance the indicator to the end.
The base class for indicating the progress of some task.
void unused(const T &x)
Declare that a variable is unused on purpose.
Definition: util.h:42
Fractional progress reporter.
dummy_fraction_progress & id()
Return this progress indicator's unique id.
void done()
Advance the indicator to the end.
A progress indicator that is conceptually compatible with tpie::progress_indicator_base and tpie::fra...
dummy_fraction_progress(dummy_progress_indicator *)
Dummy constructor that does nothing.
Fractional progress reporting.
void init(stream_size_type range=0)
Initialize progress indicator.
void step(stream_size_type)
Record an increment to the indicator and advance the indicator.
void step()
Record an increment to the indicator and advance the indicator.
dummy_fraction_progress(tpie::progress_indicator_base *)
Dummy constructor that does nothing.
For applications where you wish to disable progress indicators via a template parameter, refer to progress_types members names sub, fp and base.
A fractional progress indicator that is conceptually compatible with tpie::fractional_progress.
Subindicator for fractional progress reporting.