casacore
Loading...
Searching...
No Matches
MCEpoch.h
Go to the documentation of this file.
1// # MCEpoch.h: MEpoch 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: 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_MCEPOCH_H
27#define MEASURES_MCEPOCH_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/measures/Measures/MeasBase.h>
32#include <casacore/measures/Measures/MeasRef.h>
33#include <casacore/measures/Measures/MCBase.h>
34#include <casacore/measures/Measures/MConvertBase.h>
35#include <casacore/measures/Measures/MEpoch.h>
36
37namespace casacore { // # NAMESPACE CASACORE - BEGIN
38
39// # Forward Declarations
40class MCEpoch;
41class Nutation;
42class String;
43
44// # Typedefs
45
46// <summary> MEpoch conversion routines </summary>
47
48// <use visibility=local>
49
50// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
51// </reviewed>
52
53// <prerequisite>
54// <li> <linkto class=Measure>Measure</linkto> class
55// <li> <linkto class=MCBase>MCBase</linkto> base class
56// <li> <linkto class=MConvertBase>overall conversion</linkto> class
57// </prerequisite>
58//
59// <etymology>
60// Measure, Convert and Epoch
61// </etymology>
62//
63// <synopsis>
64// Contains state machinery and caching for actual conversions
65// </synopsis>
66//
67// <example>
68// Convert (with all steps explicit) a UTC to an IAT time.
69// <srcblock>
70// #include <casacore/measures/Measures.h>
71// #include <casacore/measures/Measures/MEpoch.h>
72// #include <casacore/measures/Measures/MCEpoch.h>
73// cout << "TAI for UTC = MJD(50237.29): " <<
74// MEpoch::Convert(MEpoch(MVEpoch(Quantity(50237.29, "d")),
75// MEpoch::Ref(MEpoch::UTC)),
76// MEpoch::Ref(MEpoch::TAI))() <<
77// endl;
78// </srcblock>
79// </example>
80//
81// <motivation>
82// </motivation>
83//
84// <todo asof="1998/09/21">
85// <li> Nothing I know
86// </todo>
87
88class MCEpoch : public MCBase {
89 public:
90 // # Friends
91 friend class MeasConvert<MEpoch>;
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)
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>
137
138 // # Typedefs
139
140 // # Operators
141
142 // # General Member Functions
143
144 // # Enumerations
145
146 // # Cached Data
149
150 // # State machine data
151 // Transition list
153 // Transition matrix
155 // Object to ensure safe multi-threaded lazy single initialization
156 static std::once_flag theirInitOnceFlag;
157
158 // # Constructors
159 // Copy constructor (not implemented)
160 MCEpoch(const MCEpoch &other);
161 // Assignment (not implemented)
162 MCEpoch &operator=(const MCEpoch &other);
163
164 // # Member functions
165
166 // Create conversion function pointer
167 virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref);
168
169 // Create help structures for Measure conversion routines
170 virtual void initConvert(uInt which, MConvertBase &mc);
171
172 // Delete the pointers used in the MeasConvert help structure cache
173 virtual void clearConvert();
174
175 // Routine to convert time from one reference frame to another
176 virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc);
177 // Conversion routine to cater for inheritance question
178 void doConvert(MVEpoch &in, MRBase &inref, MRBase &outref, const MConvertBase &mc);
179
180 private:
181 // Fill the global state. Called using theirInitOnce.
182 static void doFillState();
183};
184
185} // namespace casacore
186
187#endif
MCEpoch & operator=(const MCEpoch &other)
Assignment (not implemented).
static uInt FromTo_p[MEpoch::N_Types][MEpoch::N_Types]
Transition matrix.
Definition MCEpoch.h:154
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routine to convert time from one reference frame to another.
static String showState()
Show the state of the conversion engine (mainly for debugging purposes).
void doConvert(MVEpoch &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
static std::once_flag theirInitOnceFlag
Object to ensure safe multi-threaded lazy single initialization.
Definition MCEpoch.h:156
MCEpoch(const MCEpoch &other)
Copy constructor (not implemented).
Nutation * NUTATFROM
Definition MCEpoch.h:147
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
Routes
The list of actual routines provided.
Definition MCEpoch.h:111
static void doFillState()
Fill the global state.
Nutation * NUTATTO
Definition MCEpoch.h:148
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition MCEpoch.h:152
MCEpoch()
Default constructor.
@ N_Types
Number of types.
Definition MEpoch.h:134
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49