casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MCPosition.h
Go to the documentation of this file.
1 //# MCPosition.h: MPosition conversion routines
2 //# Copyright (C) 1995,1996,1997,1998,1999,2002
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_MCPOSITION_H
30 #define MEASURES_MCPOSITION_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
40 
41 namespace casacore { //# NAMESPACE CASACORE - BEGIN
42 
43 //# Forward Declarations
44 class MCPosition;
45 class String;
46 
47 //# Typedefs
48 
49 // <summary> MPosition conversion routines </summary>
50 
51 // <use visibility=local>
52 
53 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
54 // </reviewed>
55 
56 // <prerequisite>
57 // <li> <linkto class=Measure>Measure</linkto> class
58 // <li> <linkto class=MCBase>MCBase</linkto> base class
59 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
60 // </prerequisite>
61 //
62 // <etymology>
63 // Measure, Convert and Position
64 // </etymology>
65 //
66 // <synopsis>
67 // Contains state machinery and caching for actual conversions
68 // </synopsis>
69 //
70 // <example>
71 // See <linkto class=Measure>Measure</linkto> for conversion example.
72 // </example>
73 //
74 // <motivation>
75 // </motivation>
76 //
77 // <todo asof="1996/02/21">
78 // <li>
79 // </todo>
80 
81 class MCPosition : public MCBase {
82 
83 public:
84 
85  //# Friends
86  // Conversion of data
87  friend class MeasConvert<MPosition>;
88 
89  //# Constructors
90  // Default constructor
91  MCPosition();
92 
93  //# Destructor
94  ~MCPosition();
95 
96  //# Member functions
97  // Show the state of the conversion engine (mainly for debugging purposes)
98  static String showState();
99 
100 private:
101  //# Enumerations
102  // The list of actual routines provided.
103  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
104  // that can be used in the FromTo list in the getConvert routine.
105  // In addition the type to which each is converted should be in the
106  // ToRef array, again in the proper order. </note>
107  enum Routes {
111 
112  //# Typedefs
113 
114  //# Operators
115 
116  //# General Member Functions
117 
118  //# Enumerations
119 
120  //# Cached Data
122 
123  //# State machine data
124  // Transition list
125  static uInt ToRef_p[N_Routes][3];
126  // Transition matrix
128  // Object to ensure safe multi-threaded lazy single initialization
129  static std::once_flag theirInitOnceFlag;
130 
131  //# Constructors
132  // Copy constructor (not implemented)
133  MCPosition(const MCPosition &other);
134  // Assignment (not implemented)
135  MCPosition &operator=(const MCPosition &other);
136 
137  //# Member functions
138 
139  // Create conversion function pointer
140  virtual void getConvert(MConvertBase &mc,
141  const MRBase &inref,
142  const MRBase &outref);
143 
144  // Create help structures for Measure conversion routines
145  virtual void initConvert(uInt which, MConvertBase &mc);
146 
147  // Delete the pointers used in the MeasConvert help structure cache
148  virtual void clearConvert();
149 
150  // Routine to do actual conversion
151  virtual void doConvert(MeasValue &in,
152  MRBase &inref,
153  MRBase &outref,
154  const MConvertBase &mc);
155  // Conversion routine to cater for inheritance question
156  void doConvert(MVPosition &in,
157  MRBase &inref,
158  MRBase &outref,
159  const MConvertBase &mc);
160 
161 private:
162  // Fill the global state. Called using theirInitOnce.
163  static void doFillState();
164 };
165 
166 
167 } //# NAMESPACE CASACORE - END
168 
169 #endif
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routine to do actual conversion.
A Measure: position on Earth.
Definition: MPosition.h:79
Conversion of Measures.
Definition: MBaseline.h:44
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134
static std::once_flag theirInitOnceFlag
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCPosition.h:129
Base for Reference frame for physical measures.
Definition: MRBase.h:103
Base for specific measure conversions.
Definition: MCBase.h:119
MCPosition & operator=(const MCPosition &other)
Assignment (not implemented)
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCPosition.h:125
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
static uInt FromTo_p[MPosition::N_Types][MPosition::N_Types]
Transition matrix.
Definition: MCPosition.h:127
Vector< Double > * DVEC1
Definition: MCPosition.h:121
Base class for values in a Measure.
Definition: MeasValue.h:107
MCPosition()
Default constructor.
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
A 3D vector in space.
Definition: MVPosition.h:113
MPosition conversion routines.
Definition: MCPosition.h:81
static void doFillState()
Fill the global state.
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
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
unsigned int uInt
Definition: aipstype.h:51
Conversion of Measures Base.
Definition: MConvertBase.h:147