casacore
Loading...
Searching...
No Matches
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: 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_MCPOSITION_H
27#define MEASURES_MCPOSITION_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/MPosition.h>
37
38namespace casacore { //# NAMESPACE CASACORE - BEGIN
39
40//# Forward Declarations
41class MCPosition;
42class String;
43
44//# Typedefs
45
46// <summary> MPosition 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 Position
61// </etymology>
62//
63// <synopsis>
64// Contains state machinery and caching for actual conversions
65// </synopsis>
66//
67// <example>
68// See <linkto class=Measure>Measure</linkto> for conversion example.
69// </example>
70//
71// <motivation>
72// </motivation>
73//
74// <todo asof="1996/02/21">
75// <li>
76// </todo>
77
78class MCPosition : public MCBase {
79
80public:
81
82 //# Friends
83 // Conversion of data
84 friend class MeasConvert<MPosition>;
85
86 //# Constructors
87 // Default constructor
89
90 //# Destructor
92
93 //# Member functions
94 // Show the state of the conversion engine (mainly for debugging purposes)
95 static String showState();
96
97private:
98 //# Enumerations
99 // The list of actual routines provided.
100 // <note role=warning> Each <src>AA_BB</src> in the list points to routine
101 // that can be used in the FromTo list in the getConvert routine.
102 // In addition the type to which each is converted should be in the
103 // ToRef array, again in the proper order. </note>
108
109 //# Typedefs
110
111 //# Operators
112
113 //# General Member Functions
114
115 //# Enumerations
116
117 //# Cached Data
119
120 //# State machine data
121 // Transition list
123 // Transition matrix
125 // Object to ensure safe multi-threaded lazy single initialization
126 static std::once_flag theirInitOnceFlag;
127
128 //# Constructors
129 // Copy constructor (not implemented)
130 MCPosition(const MCPosition &other);
131 // Assignment (not implemented)
133
134 //# Member functions
135
136 // Create conversion function pointer
137 virtual void getConvert(MConvertBase &mc,
138 const MRBase &inref,
139 const MRBase &outref);
140
141 // Create help structures for Measure conversion routines
142 virtual void initConvert(uInt which, MConvertBase &mc);
143
144 // Delete the pointers used in the MeasConvert help structure cache
145 virtual void clearConvert();
146
147 // Routine to do actual conversion
148 virtual void doConvert(MeasValue &in,
149 MRBase &inref,
150 MRBase &outref,
151 const MConvertBase &mc);
152 // Conversion routine to cater for inheritance question
154 MRBase &inref,
155 MRBase &outref,
156 const MConvertBase &mc);
157
158private:
159 // Fill the global state. Called using theirInitOnce.
160 static void doFillState();
161};
162
163
164} //# NAMESPACE CASACORE - END
165
166#endif
void doConvert(MVPosition &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
Vector< Double > * DVEC1
Definition MCPosition.h:118
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routine to do actual conversion.
MCPosition()
Default constructor.
static void doFillState()
Fill the global state.
Routes
The list of actual routines provided.
Definition MCPosition.h:104
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
MCPosition(const MCPosition &other)
Copy constructor (not implemented)
MCPosition & operator=(const MCPosition &other)
Assignment (not implemented)
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition MCPosition.h:122
static uInt FromTo_p[MPosition::N_Types][MPosition::N_Types]
Transition matrix.
Definition MCPosition.h:124
static std::once_flag theirInitOnceFlag
Object to ensure safe multi-threaded lazy single initialization.
Definition MCPosition.h:126
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
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