casacore
Loading...
Searching...
No Matches
LatticeProgress.h
Go to the documentation of this file.
1// # LatticeProgress.h: Abstract base class to monitor progress in lattice operations
2// # Copyright (C) 1997
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef LATTICES_LATTICEPROGRESS_H
27#define LATTICES_LATTICEPROGRESS_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Arrays/ArrayFwd.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36class IPosition;
37
38// <summary>
39// Abstract base class to monitor progress in lattice operations
40// </summary>
41
42// <use visibility=export>
43
44// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
45// </reviewed>
46
47// <synopsis>
48// This is an abstract base class for classes to monitor the
49// progress of an operation on a Lattice. The default implementation
50// offered by this class does nothing.
51// However, a derived class could show the progress using for example
52// a <linkto class=ProgressMeter>ProgressMeter</linkto>. A derived
53// class should override the virtual functions from this class.
54//
55// The user of the LatticeProgress object should first call
56// function <src>init</src> with the total number of steps
57// that are to be done. Thereafter, after each step has been
58// executed, function <src>nstepsDone</src> should be called
59// after each step. Finally, function <src>done</src> should
60// be called.
61// </synopsis>
62
63// <example>
64// <srcblock>
65// </srcblock>
66// </example>
67
68// <motivation>
69// Since operations on Lattices can take a while, it can be useful
70// to show the progress. However, making module Lattices dependent on
71// the class ProgressMeter sounded bad. This abstract class serves
72// as a bridge between the Lattice module and the ProgressMeter class
73// (or any other class showing the progress).
74// </motivation>
75//
76// # <todo asof="1997/08/01">
77// # <li>
78// # </todo>
79
81 public:
83
85
86 // Initialize the process.
87 // It sets the expected number of steps and
88 // calls initDerived, so a derived class can initialize itself.
90
91 // Tell the number of steps done so far.
92 // The default implementation does nothing. A derived class
93 // should call the ProgressMeter function <src>update</src>
94 virtual void nstepsDone(uInt nsteps);
95
96 // The process has ended.
97 virtual void done();
98
99 // Recovers the expected number of total steps.
101
102 protected:
103 // Let a derived class initialize itself.
104 // This function is called by <src>init</src>.
105 // The derived class should create the <src>ProgressMeter</src>
106 // in here.
107 virtual void initDerived();
108
109 private:
111};
112
113} // namespace casacore
114
115#endif
virtual void done()
The process has ended.
void init(uInt expectedNsteps)
Initialize the process.
virtual void initDerived()
Let a derived class initialize itself.
virtual void nstepsDone(uInt nsteps)
Tell the number of steps done so far.
uInt expectedNsteps() const
Recovers the expected number of total steps.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49