casacore
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>
34 #include <casacore/measures/Measures/MeasBase.h>
35 #include <casacore/measures/Measures/MeasRef.h>
36 #include <casacore/measures/Measures/MCBase.h>
37 #include <casacore/measures/Measures/MConvertBase.h>
38 #include <casacore/measures/Measures/MPosition.h>
39 #include <casacore/casa/OS/Mutex.h>
40 
41 namespace casacore { //# NAMESPACE CASACORE - BEGIN
42 
43 //# Forward Declarations
44 class MCPosition;
45 class String;
46 template <class T> class Vector;
47 
48 //# Typedefs
49 
50 // <summary> MPosition 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 Position
65 // </etymology>
66 //
67 // <synopsis>
68 // Contains state machinery and caching for actual conversions
69 // </synopsis>
70 //
71 // <example>
72 // See <linkto class=Measure>Measure</linkto> for conversion example.
73 // </example>
74 //
75 // <motivation>
76 // </motivation>
77 //
78 // <todo asof="1996/02/21">
79 // <li>
80 // </todo>
81 
82 class MCPosition : public MCBase {
83 
84 public:
85 
86  //# Friends
87  // Conversion of data
88  friend class MeasConvert<MPosition>;
89 
90  //# Constructors
91  // Default constructor
93 
94  //# Destructor
96 
97  //# Member functions
98  // Show the state of the conversion engine (mainly for debugging purposes)
99  static String showState();
100 
101 private:
102  //# Enumerations
103  // The list of actual routines provided.
104  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
105  // that can be used in the FromTo list in the getConvert routine.
106  // In addition the type to which each is converted should be in the
107  // ToRef array, again in the proper order. </note>
108  enum Routes {
112 
113  //# Typedefs
114 
115  //# Operators
116 
117  //# General Member Functions
118 
119  //# Enumerations
120 
121  //# Cached Data
123 
124  //# State machine data
125  // Transition list
126  static uInt ToRef_p[N_Routes][3];
127  // Transition matrix
129  // Object to ensure safe multi-threaded lazy single initialization
131 
132  //# Constructors
133  // Copy constructor (not implemented)
134  MCPosition(const MCPosition &other);
135  // Assignment (not implemented)
137 
138  //# Member functions
139 
140  // Create conversion function pointer
141  virtual void getConvert(MConvertBase &mc,
142  const MRBase &inref,
143  const MRBase &outref);
144 
145  // Create help structures for Measure conversion routines
146  virtual void initConvert(uInt which, MConvertBase &mc);
147 
148  // Delete the pointers used in the MeasConvert help structure cache
149  virtual void clearConvert();
150 
151  // Routine to do actual conversion
152  virtual void doConvert(MeasValue &in,
153  MRBase &inref,
154  MRBase &outref,
155  const MConvertBase &mc);
156  // Conversion routine to cater for inheritance question
158  MRBase &inref,
159  MRBase &outref,
160  const MConvertBase &mc);
161 
162 private:
163  // Fill the global state. Called using theirInitOnce.
164  static void doFillState();
165 };
166 
167 
168 } //# NAMESPACE CASACORE - END
169 
170 #endif
casacore::MCPosition::ToRef_p
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCPosition.h:126
casacore::MPosition
Definition: MPosition.h:79
casacore::MCPosition::MCPosition
MCPosition(const MCPosition &other)
Copy constructor (not implemented)
casacore::MCPosition::clearConvert
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
casacore::MCPosition::operator=
MCPosition & operator=(const MCPosition &other)
Assignment (not implemented)
casacore::MCPosition::theirInitOnce
static CallOnce0 theirInitOnce
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCPosition.h:130
casacore::MeasValue
Definition: MeasValue.h:107
casacore::MCBase
Definition: MCBase.h:119
casacore::MRBase
Definition: MRBase.h:103
casacore::MCPosition::showState
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
casacore::MCPosition::ITRF_WGS84
@ ITRF_WGS84
Definition: MCPosition.h:109
casacore::MCPosition::N_Routes
@ N_Routes
Definition: MCPosition.h:111
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MeasConvert
Definition: MeasConvert.h:143
casacore::MCPosition::MCPosition
MCPosition()
Default constructor.
casacore::MCPosition::DVEC1
Vector< Double > * DVEC1
Definition: MCPosition.h:122
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MCPosition::WGS84_ITRF
@ WGS84_ITRF
Definition: MCPosition.h:110
casacore::MCPosition::~MCPosition
~MCPosition()
casacore::MCPosition::initConvert
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
casacore::MCPosition::getConvert
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
casacore::MVPosition
Definition: MVPosition.h:113
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::MCPosition
Definition: MCPosition.h:82
casacore::MPosition::N_Types
@ N_Types
Definition: MPosition.h:97
casacore::Vector
Definition: Vector.h:89
casacore::MCPosition::FromTo_p
static uInt FromTo_p[MPosition::N_Types][MPosition::N_Types]
Transition matrix.
Definition: MCPosition.h:128
casacore::MCPosition::doConvert
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routine to do actual conversion.
casacore::MCPosition::doFillState
static void doFillState()
Fill the global state.
casacore::MCPosition::doConvert
void doConvert(MVPosition &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
casacore::CallOnce0
Wrapper around std::call_once.
Definition: Mutex.h:215
casacore::MConvertBase
Definition: MConvertBase.h:147
casacore::MCBase::Routes
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134