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
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Arrays/ArrayFwd.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36//# Forward Declarations
37class IPosition;
38
39// <summary>
40// Abstract base class to monitor progress in lattice operations
41// </summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46// </reviewed>
47
48// <synopsis>
49// This is an abstract base class for classes to monitor the
50// progress of an operation on a Lattice. The default implementation
51// offered by this class does nothing.
52// However, a derived class could show the progress using for example
53// a <linkto class=ProgressMeter>ProgressMeter</linkto>. A derived
54// class should override the virtual functions from this class.
55//
56// The user of the LatticeProgress object should first call
57// function <src>init</src> with the total number of steps
58// that are to be done. Thereafter, after each step has been
59// executed, function <src>nstepsDone</src> should be called
60// after each step. Finally, function <src>done</src> should
61// be called.
62// </synopsis>
63
64// <example>
65// <srcblock>
66// </srcblock>
67// </example>
68
69// <motivation>
70// Since operations on Lattices can take a while, it can be useful
71// to show the progress. However, making module Lattices dependent on
72// the class ProgressMeter sounded bad. This abstract class serves
73// as a bridge between the Lattice module and the ProgressMeter class
74// (or any other class showing the progress).
75// </motivation>
76//
77//# <todo asof="1997/08/01">
78//# <li>
79//# </todo>
80
81
83{
84public:
87
89
90// Initialize the process.
91// It sets the expected number of steps and
92// calls initDerived, so a derived class can initialize itself.
94
95// Tell the number of steps done so far.
96// The default implementation does nothing. A derived class
97// should call the ProgressMeter function <src>update</src>
98 virtual void nstepsDone (uInt nsteps);
99
100// The process has ended.
101 virtual void done();
102
103// Recovers the expected number of total steps.
105 { return itsExpectedNsteps; }
106
107protected:
108 // Let a derived class initialize itself.
109 // This function is called by <src>init</src>.
110 // The derived class should create the <src>ProgressMeter</src>
111 // in here.
112 virtual void initDerived();
113
114private:
116};
117
118
119
120} //# NAMESPACE CASACORE - END
121
122#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.
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49