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
90public:
91
92 //# Friends
93 friend class MeasConvert<MEpoch>;
94
95 //# Constructors
96 // Default constructor
98
99 //# Destructor
101
102 //# Member functions
103 // Show the state of the conversion engine (mainly for debugging purposes)
105
106private:
107 //# Enumerations
108 // The list of actual routines provided.
109 // <note role=warning> Each <src>AA_BB</src> in the list points to routine
110 // that can be used in the FromTo list in the getConvert routine.
111 // In addition the type to which each is converted should be in the
112 // ToRef array, again in the proper order. </note>
139
140 //# Typedefs
141
142 //# Operators
143
144 //# General Member Functions
145
146 //# Enumerations
147
148 //# Cached Data
151
152 //# State machine data
153 // Transition list
155 // Transition matrix
157 // Object to ensure safe multi-threaded lazy single initialization
158 static std::once_flag theirInitOnceFlag;
159
160 //# Constructors
161 // Copy constructor (not implemented)
162 MCEpoch(const MCEpoch &other);
163 // Assignment (not implemented)
164 MCEpoch &operator=(const MCEpoch &other);
165
166 //# Member functions
167
168 // Create conversion function pointer
169 virtual void getConvert(MConvertBase &mc,
170 const MRBase &inref,
171 const MRBase &outref);
172
173 // Create help structures for Measure conversion routines
174 virtual void initConvert(uInt which, MConvertBase &mc);
175
176 // Delete the pointers used in the MeasConvert help structure cache
177 virtual void clearConvert();
178
179 // Routine to convert time from one reference frame to another
180 virtual void doConvert(MeasValue &in,
181 MRBase &inref,
182 MRBase &outref,
183 const MConvertBase &mc);
184 // Conversion routine to cater for inheritance question
186 MRBase &inref,
187 MRBase &outref,
188 const MConvertBase &mc);
189
190private:
191 // Fill the global state. Called using theirInitOnce.
192 static void doFillState();
193};
194
195
196} //# NAMESPACE CASACORE - END
197
198#endif
MCEpoch & operator=(const MCEpoch &other)
Assignment (not implemented)
static uInt FromTo_p[MEpoch::N_Types][MEpoch::N_Types]
Transition matrix.
Definition MCEpoch.h:156
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:158
MCEpoch(const MCEpoch &other)
Copy constructor (not implemented)
Nutation * NUTATFROM
Definition MCEpoch.h:149
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:113
static void doFillState()
Fill the global state.
Nutation * NUTATTO
Definition MCEpoch.h:150
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:154
MCEpoch()
Default constructor.
@ N_Types
Number of types.
Definition MEpoch.h:132
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