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