casacore
MCDirection.h
Go to the documentation of this file.
1 //# MCDirection.h: MDirection conversion routines
2 //# Copyright (C) 1995-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_MCDIRECTION_H
30 #define MEASURES_MCDIRECTION_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/ArrayFwd.h>
35 #include <casacore/measures/Measures/MeasBase.h>
36 #include <casacore/measures/Measures/MeasRef.h>
37 #include <casacore/measures/Measures/MCBase.h>
38 #include <casacore/measures/Measures/MConvertBase.h>
39 #include <casacore/measures/Measures/MDirection.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 MCDirection;
47 class MVPosition;
48 class String;
49 
50 //# Typedefs
51 
52 // <summary> MDirection conversion routines </summary>
53 
54 // <use visibility=local>
55 
56 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
57 // </reviewed>
58 
59 // <prerequisite>
60 // <li> <linkto class=Measure>Measure</linkto> class
61 // <li> <linkto class=MCBase>MCBase</linkto> base class
62 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
63 // </prerequisite>
64 //
65 // <etymology>
66 // Measure, Convert and Direction
67 // </etymology>
68 //
69 // <synopsis>
70 // Contains state machinery and caching for actual conversions
71 // </synopsis>
72 //
73 // <example>
74 // See <linkto module=Measures>Measures</linkto> module description for
75 // conversion examples.
76 // </example>
77 //
78 // <motivation>
79 // </motivation>
80 //
81 // <todo asof="2000/09/12">
82 // <li> nothing I know
83 // </todo>
84 
85 class MCDirection : public MCBase {
86 
87 public:
88 
89  //# Friends
90  // Conversion of data
91  friend class MeasConvert<MDirection>;
92 
93  //# Constructors
94  // Default constructor
96 
97  //# Destructor
99 
100  //# Member functions
101  // Show the state of the conversion engine (mainly for debugging purposes)
102  static String showState();
103 
104 private:
105  //# Enumerations
106  // The list of actual routines provided.
107  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
108  // that can be used in the FromTo list in the getConvert routine.
109  // In addition the type to which each is converted should be in the
110  // ToRef array, again in the proper order. </note>
111  enum Routes {
161  // General for Planets
166  // Individual planets. Order should be the same as in MDirection.h
177 
178  //# Typedefs
179 
180  //# Operators
181 
182  //# General Member Functions
183 
184  //# Enumerations
185 
186  //# Cached Data
190 
191  //# State machine data
192  // Transition list
193  static uInt ToRef_p[N_Routes][3];
194  // Transition matrix
196  // Object to ensure safe multi-threaded lazy single initialization
198 
199  //# Constructors
200  // Copy constructor (not implemented)
201  MCDirection(const MCDirection &other);
202  // Assignment (not implemented)
204 
205  //# Member functions
206 
207  // Create conversion function pointer
208  virtual void getConvert(MConvertBase &mc,
209  const MRBase &inref,
210  const MRBase &outref);
211 
212  // Create help structures for Measure conversion routines
213  virtual void initConvert(uInt which, MConvertBase &mc);
214 
215  // Delete the pointers used in the MeasConvert help structure cache
216  virtual void clearConvert();
217 
218  // Routines to convert directions from one reference frame to another
219  virtual void doConvert(MeasValue &in,
220  MRBase &inref,
221  MRBase &outref,
222  const MConvertBase &mc);
223  // Conversion routine to cater for inheritance question
225  MRBase &inref,
226  MRBase &outref,
227  const MConvertBase &mc);
228 
229 private:
230  // Fill the global state. Called using theirInitOnce.
231  static void doFillState();
232 };
233 
234 
235 } //# NAMESPACE CASACORE - END
236 
237 #endif
238 
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
MCDirection & operator=(const MCDirection &other)
Assignment (not implemented)
Vector< Double > * VEC61
Definition: MCDirection.h:188
static void doFillState()
Fill the global state.
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
MCDirection(const MCDirection &other)
Copy constructor (not implemented)
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
MCDirection()
Default constructor.
MVPosition * MVPOS1
Definition: MCDirection.h:187
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
static uInt FromTo_p[MDirection::N_Types][MDirection::N_Types]
Transition matrix.
Definition: MCDirection.h:195
Vector< Double > * VEC62
Definition: MCDirection.h:188
@ R_PLANET0
General for Planets.
Definition: MCDirection.h:162
@ R_MERCURY
Individual planets.
Definition: MCDirection.h:167
Vector< Double > * VEC63
Definition: MCDirection.h:188
MVPosition * MVPOS3
Definition: MCDirection.h:187
MVPosition * MVPOS2
Definition: MCDirection.h:187
void doConvert(MVDirection &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routines to convert directions from one reference frame to another.
static CallOnce0 theirInitOnce
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCDirection.h:197
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCDirection.h:193
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