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 public:
80 // # Friends
81 // Conversion of data
82 friend class MeasConvert<MPosition>;
83
84 // # Constructors
85 // Default constructor
87
88 // # Destructor
90
91 // # Member functions
92 // Show the state of the conversion engine (mainly for debugging purposes)
93 static String showState();
94
95 private:
96 // # Enumerations
97 // The list of actual routines provided.
98 // <note role=warning> Each <src>AA_BB</src> in the list points to routine
99 // that can be used in the FromTo list in the getConvert routine.
100 // In addition the type to which each is converted should be in the
101 // ToRef array, again in the proper order. </note>
103
104 // # Typedefs
105
106 // # Operators
107
108 // # General Member Functions
109
110 // # Enumerations
111
112 // # Cached Data
114
115 // # State machine data
116 // Transition list
118 // Transition matrix
120 // Object to ensure safe multi-threaded lazy single initialization
121 static std::once_flag theirInitOnceFlag;
122
123 // # Constructors
124 // Copy constructor (not implemented)
125 MCPosition(const MCPosition &other);
126 // Assignment (not implemented)
128
129 // # Member functions
130
131 // Create conversion function pointer
132 virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref);
133
134 // Create help structures for Measure conversion routines
135 virtual void initConvert(uInt which, MConvertBase &mc);
136
137 // Delete the pointers used in the MeasConvert help structure cache
138 virtual void clearConvert();
139
140 // Routine to do actual conversion
141 virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc);
142 // Conversion routine to cater for inheritance question
143 void doConvert(MVPosition &in, MRBase &inref, MRBase &outref, const MConvertBase &mc);
144
145 private:
146 // Fill the global state. Called using theirInitOnce.
147 static void doFillState();
148};
149
150} // namespace casacore
151
152#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:113
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:102
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:117
static uInt FromTo_p[MPosition::N_Types][MPosition::N_Types]
Transition matrix.
Definition MCPosition.h:119
static std::once_flag theirInitOnceFlag
Object to ensure safe multi-threaded lazy single initialization.
Definition MCPosition.h:121
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:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49