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