casacore
MCBaseline.h
Go to the documentation of this file.
1 //# MCBaseline.h: MBaseline conversion routines
2 //# Copyright (C) 1998-2000,2002,2004,2007
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: aips2-request@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 //#
27 //# $Id$
28 
29 #ifndef MEASURES_MCBASELINE_H
30 #define MEASURES_MCBASELINE_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/ArrayFwd.h>
35 #include <casacore/measures/Measures/MBaseline.h>
36 #include <casacore/measures/Measures/MeasBase.h>
37 #include <casacore/measures/Measures/MeasRef.h>
38 #include <casacore/measures/Measures/MCBase.h>
39 #include <casacore/measures/Measures/MConvertBase.h>
40 #include <casacore/measures/Measures/MeasMath.h>
41 #include <casacore/casa/OS/Mutex.h>
42 
43 namespace casacore { //# NAMESPACE CASACORE - BEGIN
44 
45 //# Forward Declarations
46 class MCBaseline;
47 class String;
48 
49 //# Typedefs
50 
51 // <summary> MBaseline conversion routines </summary>
52 
53 // <use visibility=local>
54 
55 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMBaseline" demos="">
56 // </reviewed>
57 
58 // <prerequisite>
59 // <li> <linkto class=Measure>Measure</linkto> class
60 // <li> <linkto class=MCBase>MCBase</linkto> base class
61 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
62 // </prerequisite>
63 //
64 // <etymology>
65 // Measure, Convert and Baseline
66 // </etymology>
67 //
68 // <synopsis>
69 // Contains state machinery and caching for actual conversions
70 // </synopsis>
71 //
72 // <example>
73 // See <linkto module=Measures>Measures</linkto> module description for
74 // conversion examples.
75 // </example>
76 //
77 // <motivation>
78 // </motivation>
79 //
80 // <todo asof="2000/09/12">
81 // <li> nothing I know
82 // </todo>
83 
84 class MCBaseline : public MCBase {
85 
86 public:
87 
88  //# Friends
89  // Conversion of data
90  friend class MeasConvert<MBaseline>;
91 
92  //# Constructors
93  // Default constructor
95 
96  //# Destructor
98 
99  //# Member functions
100  // Show the state of the conversion engine (mainly for debugging purposes)
101  static String showState();
102 
103 private:
104  //# Enumerations
105  // The list of actual routines provided.
106  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
107  // that can be used in the FromTo list in the getConvert routine.
108  // In addition the type to which each is converted should be in the
109  // ToRef array, again in the proper order. </note>
110  enum Routes {
159  N_Routes
160  };
161 
162  //# Typedefs
163 
164  //# Operators
165 
166  //# General Member Functions
167 
168  //# Enumerations
169 
170  //# Cached Data
172 
173  //# State machine data
174  // Transition list
175  static uInt ToRef_p[N_Routes][3];
176  // Transition matrix
178  // Object to ensure safe multi-threaded lazy single initialization
180 
181  //# Constructors
182  // Copy constructor (not implemented)
183  MCBaseline(const MCBaseline &other);
184  // Assignment (not implemented)
186 
187  //# Member functions
188 
189  // Create conversion function pointer
190  virtual void getConvert(MConvertBase &mc,
191  const MRBase &inref,
192  const MRBase &outref);
193 
194  // Create help structures for Measure conversion routines
195  virtual void initConvert(uInt which, MConvertBase &mc);
196 
197  // Delete the pointers used in the MeasConvert help structure cache
198  virtual void clearConvert();
199 
200  // Routines to convert Baselines from one reference frame to another
201  virtual void doConvert(MeasValue &in,
202  MRBase &inref,
203  MRBase &outref,
204  const MConvertBase &mc);
205  // Conversion routine to cater for inheritance question
207  MRBase &inref,
208  MRBase &outref,
209  const MConvertBase &mc);
210 
211 private:
212  // Fill the global state. Called using theirInitOnce.
213  static void doFillState();
214 };
215 
216 
217 } //# NAMESPACE CASACORE - END
218 
219 #endif
220 
Wrapper around std::call_once.
Definition: Mutex.h:215
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
MCBaseline & operator=(const MCBaseline &other)
Assignment (not implemented)
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routines to convert Baselines from one reference frame to another.
MCBaseline()
Default constructor.
void doConvert(MVBaseline &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCBaseline.h:175
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
static uInt FromTo_p[MBaseline::N_Types][MBaseline::N_Types]
Transition matrix.
Definition: MCBaseline.h:177
static CallOnce0 theirInitOnce
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCBaseline.h:179
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
MCBaseline(const MCBaseline &other)
Copy constructor (not implemented)
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
static void doFillState()
Fill the global state.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51