casa  5.7.0-16
 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>
40 #include <casacore/casa/OS/Mutex.h>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 //# Forward Declarations
45 class MCBaseline;
46 class String;
47 template <class T> class Vector;
48 
49 //# Typedefs
50 
51 // <summary> MBaseline conversion routines </summary>
52 
53 // <use visibility=local>
54 
55 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMBaseline" demos="">
56 // </reviewed>
57 
58 // <prerequisite>
59 // <li> <linkto class=Measure>Measure</linkto> class
60 // <li> <linkto class=MCBase>MCBase</linkto> base class
61 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
62 // </prerequisite>
63 //
64 // <etymology>
65 // Measure, Convert and Baseline
66 // </etymology>
67 //
68 // <synopsis>
69 // Contains state machinery and caching for actual conversions
70 // </synopsis>
71 //
72 // <example>
73 // See <linkto module=Measures>Measures</linkto> module description for
74 // conversion examples.
75 // </example>
76 //
77 // <motivation>
78 // </motivation>
79 //
80 // <todo asof="2000/09/12">
81 // <li> nothing I know
82 // </todo>
83 
84 class MCBaseline : public MCBase {
85 
86 public:
87 
88  //# Friends
89  // Conversion of data
90  friend class MeasConvert<MBaseline>;
91 
92  //# Constructors
93  // Default constructor
94  MCBaseline();
95 
96  //# Destructor
97  ~MCBaseline();
98 
99  //# Member functions
100  // Show the state of the conversion engine (mainly for debugging purposes)
101  static String showState();
102 
103 private:
104  //# Enumerations
105  // The list of actual routines provided.
106  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
107  // that can be used in the FromTo list in the getConvert routine.
108  // In addition the type to which each is converted should be in the
109  // ToRef array, again in the proper order. </note>
110  enum Routes {
160  };
161 
162  //# Typedefs
163 
164  //# Operators
165 
166  //# General Member Functions
167 
168  //# Enumerations
169 
170  //# Cached Data
172 
173  //# State machine data
174  // Transition list
175  static uInt ToRef_p[N_Routes][3];
176  // Transition matrix
178  // Object to ensure safe multi-threaded lazy single initialization
180 
181  //# Constructors
182  // Copy constructor (not implemented)
183  MCBaseline(const MCBaseline &other);
184  // Assignment (not implemented)
185  MCBaseline &operator=(const MCBaseline &other);
186 
187  //# Member functions
188 
189  // Create conversion function pointer
190  virtual void getConvert(MConvertBase &mc,
191  const MRBase &inref,
192  const MRBase &outref);
193 
194  // Create help structures for Measure conversion routines
195  virtual void initConvert(uInt which, MConvertBase &mc);
196 
197  // Delete the pointers used in the MeasConvert help structure cache
198  virtual void clearConvert();
199 
200  // Routines to convert Baselines from one reference frame to another
201  virtual void doConvert(MeasValue &in,
202  MRBase &inref,
203  MRBase &outref,
204  const MConvertBase &mc);
205  // Conversion routine to cater for inheritance question
206  void doConvert(MVBaseline &in,
207  MRBase &inref,
208  MRBase &outref,
209  const MConvertBase &mc);
210 
211 private:
212  // Fill the global state. Called using theirInitOnce.
213  static void doFillState();
214 };
215 
216 
217 } //# NAMESPACE CASACORE - END
218 
219 #endif
220 
Wrapper around std::call_once.
Definition: Mutex.h:214
Conversion of Measures.
Definition: MDirection.h:43
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134
std::vector< double > Vector
Definition: ds9context.h:24
static CallOnce0 theirInitOnce
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCBaseline.h:179
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:107
MBaseline conversion routines.
Definition: MCBaseline.h:84
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:177
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCBaseline.h:175
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
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42