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