casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MCBaseline.h
Go to the documentation of this file.
1 //# MCBaseline.h: MBaseline conversion routines
2 //# Copyright (C) 1998-2000,2002,2004,2007
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_MCBASELINE_H
30 #define MEASURES_MCBASELINE_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
41 
42 #include <mutex>
43 
44 namespace casacore { //# NAMESPACE CASACORE - BEGIN
45 
46 //# Forward Declarations
47 class MCBaseline;
48 class String;
49 
50 //# Typedefs
51 
52 // <summary> MBaseline conversion routines </summary>
53 
54 // <use visibility=local>
55 
56 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMBaseline" demos="">
57 // </reviewed>
58 
59 // <prerequisite>
60 // <li> <linkto class=Measure>Measure</linkto> class
61 // <li> <linkto class=MCBase>MCBase</linkto> base class
62 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
63 // </prerequisite>
64 //
65 // <etymology>
66 // Measure, Convert and Baseline
67 // </etymology>
68 //
69 // <synopsis>
70 // Contains state machinery and caching for actual conversions
71 // </synopsis>
72 //
73 // <example>
74 // See <linkto module=Measures>Measures</linkto> module description for
75 // conversion examples.
76 // </example>
77 //
78 // <motivation>
79 // </motivation>
80 //
81 // <todo asof="2000/09/12">
82 // <li> nothing I know
83 // </todo>
84 
85 class MCBaseline : public MCBase {
86 
87 public:
88 
89  //# Friends
90  // Conversion of data
91  friend class MeasConvert<MBaseline>;
92 
93  //# Constructors
94  // Default constructor
95  MCBaseline();
96 
97  //# Destructor
98  ~MCBaseline();
99 
100  //# Member functions
101  // Show the state of the conversion engine (mainly for debugging purposes)
102  static String showState();
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>
111  enum Routes {
161  };
162 
163  //# Typedefs
164 
165  //# Operators
166 
167  //# General Member Functions
168 
169  //# Enumerations
170 
171  //# Cached Data
173 
174  //# State machine data
175  // Transition list
176  static uInt ToRef_p[N_Routes][3];
177  // Transition matrix
179  // Object to ensure safe multi-threaded lazy single initialization
180  static std::once_flag theirInitOnceFlag;
181 
182  //# Constructors
183  // Copy constructor (not implemented)
184  MCBaseline(const MCBaseline &other);
185  // Assignment (not implemented)
186  MCBaseline &operator=(const MCBaseline &other);
187 
188  //# Member functions
189 
190  // Create conversion function pointer
191  virtual void getConvert(MConvertBase &mc,
192  const MRBase &inref,
193  const MRBase &outref);
194 
195  // Create help structures for Measure conversion routines
196  virtual void initConvert(uInt which, MConvertBase &mc);
197 
198  // Delete the pointers used in the MeasConvert help structure cache
199  virtual void clearConvert();
200 
201  // Routines to convert Baselines from one reference frame to another
202  virtual void doConvert(MeasValue &in,
203  MRBase &inref,
204  MRBase &outref,
205  const MConvertBase &mc);
206  // Conversion routine to cater for inheritance question
207  void doConvert(MVBaseline &in,
208  MRBase &inref,
209  MRBase &outref,
210  const MConvertBase &mc);
211 
212 private:
213  // Fill the global state. Called using theirInitOnce.
214  static void doFillState();
215 };
216 
217 
218 } //# NAMESPACE CASACORE - END
219 
220 #endif
221 
static std::once_flag theirInitOnceFlag
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCBaseline.h:180
Conversion of Measures.
Definition: MBaseline.h:44
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134
Base for Reference frame for physical measures.
Definition: MRBase.h:103
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
Base for specific measure conversions.
Definition: MCBase.h:119
MCBaseline()
Default constructor.
Measure conversion aid routines.
Definition: MeasMath.h:96
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
A 3D vector on Earth.
Definition: MVBaseline.h:108
MBaseline conversion routines.
Definition: MCBaseline.h:85
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routines to convert Baselines from one reference frame to another.
Base class for values in a Measure.
Definition: MeasValue.h:107
static void doFillState()
Fill the global state.
MCBaseline & operator=(const MCBaseline &other)
Assignment (not implemented)
static uInt FromTo_p[MBaseline::N_Types][MBaseline::N_Types]
Transition matrix.
Definition: MCBaseline.h:178
String: the storage and methods of handling collections of characters.
Definition: String.h:225
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCBaseline.h:176
unsigned int uInt
Definition: aipstype.h:51
A Measure: Baseline on Earth.
Definition: MBaseline.h:85
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
Conversion of Measures Base.
Definition: MConvertBase.h:147