casacore
Loading...
Searching...
No Matches
TableMeasType.h
Go to the documentation of this file.
1// # TableMeasType.h: Encapsulates the Measures type in the TableMeasDesc.
2// # Copyright (C) 1999,2000
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_TABLEMEASTYPE_H
27#define MEASURES_TABLEMEASTYPE_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/measures/Measures/MeasureHolder.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36class String;
37class Table;
38class RecordInterface;
39
40// <summary>
41// Definition of a Measure column in a Table.
42// </summary>
43
44// <use visibility=local>
45
46// <reviewed reviewer="Bob Garwood" date="1999/12/23" tests="tTableMeasures.cc">
47// </reviewed>
48
49// <prerequisite>
50// # Classes you should understand before using this one.
51// <li> <linkto module=Measures>Measures</linkto>
52// <li> <linkto module=Tables>Tables</linkto>
53// </prerequisite>
54
55// <synopsis>
56// This class is a helper class for
57// <linkto class=TableMeasDescBase>TableMeasDescBase</linkto>
58// to know the type of measure it is dealing with.
59// <br>It eases the process of converting reference codes to their strings
60// and vice-versa. It also writes the measure type to a record to assist
61// in making table measure definitions persistent.
62// </synopsis>
63
64// <example>
65// Create the object for an epoch measure.
66// TableMeasType mtype (MEpoch());
67// // Get the code for the given string.
68// uInt code = mtype.refCode ("UTC");
69// </example>
70
71// <motivation>
72// Creating the required keyword for the definition of a Measure
73// in a Table is somewhat complicated. This class assists in that
74// process.
75// </motivation>
76//
77// # <todo asof="$DATE:$">
78// # A List of bugs, limitations, extensions or planned refinements.
79// # </todo>
80
82 public:
84
85 // Construct from the given type of measure.
86 explicit TableMeasType(const Measure&);
87
88 // Copy constructor (copy semantics).
90
92
93 // Assignment operator (copy semantics)
95
96 // Returns the descriptor's measure type as a String.
97 const String& type() const;
98
99 // Translates the refCode for the descriptors measure type.
100 const String& refType(uInt refCode) const;
101
102 // Returns the reference code for this object given a string. Throws
103 // an exception if the refString is invalid for this object.
104 uInt refCode(const String& refString) const;
105
106 // Creates a record from the MeasureHolder.
108
109 private:
110 Int itsNtypes; // # number of refcodes/strings
111 const String* itsStypes; // # refcode strings
112 const uInt* itsTyps; // # refcodes
113 MeasureHolder itsMeasHolder; // # Holds the measure
114};
115
116} // namespace casacore
117
118#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
TableMeasType(const Measure &)
Construct from the given type of measure.
MeasureHolder itsMeasHolder
const String & type() const
Returns the descriptor's measure type as a String.
void toRecord(RecordInterface &rec)
Creates a record from the MeasureHolder.
uInt refCode(const String &refString) const
Returns the reference code for this object given a string.
TableMeasType & operator=(const TableMeasType &that)
Assignment operator (copy semantics).
TableMeasType(const TableMeasType &that)
Copy constructor (copy semantics).
const String & refType(uInt refCode) const
Translates the refCode for the descriptors measure type.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
RecordInterface()
The default constructor creates an empty record with a variable structure.
int Int
Definition aipstype.h:48