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