casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TBField.h
Go to the documentation of this file.
1 //# TBField.h: Representation of a table field.
2 //# Copyright (C) 2005
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 #ifndef TBFIELD_H_
28 #define TBFIELD_H_
29 
30 #include <vector>
31 
32 #include <casa/BasicSL/String.h>
33 
34 namespace casa {
35 
36 //# Forward Declarations
37 class TBKeyword;
38 
39 // <summary>
40 // Representation of a table field.
41 // <summary>
42 //
43 // <synopsis>
44 // A TBField consists of a name, a type, a potentially empty list of keywords,
45 // and some other potentially empty properties.
46 // </synopsis>
47 
48 class TBField {
49 public:
50  // Constructor to take the name and type. Other properties must be added
51  // via method calls.
53 
54  ~TBField();
55 
56 
57  // Returns this field's name.
59 
60  // Returns this field's type.
62 
63  // Returns this field's keywords.
64  std::vector<TBKeyword*>* getKeywords();
65 
66  // Returns the keyword at index i, or NULL if there is none.
67  TBKeyword* keyword(int i);
68 
69  // Returns the keyword with name i, or NULL if there is none.
71 
72  // Returns the number of keywords this field has.
73  unsigned int numKeywords();
74 
75  // Returns the keyword at index i.
76  TBKeyword* keywordAt(unsigned int i);
77 
78  // Adds the given keyword to this field's keyword list.
79  void addKeyword(TBKeyword* keyword);
80 
81  // Sets this field's UCD property.
83 
84  // Returns this field's UCD property, or an empty casacore::String if it is not set.
86 
87  // Sets this field's ref property.
89 
90  // Returns this field's ref property, or an empty casacore::String if it is not set.
92 
93  // Sets this field's unit property.
95 
96  // Returns this field's unit property, or an empty casacore::String if it is not set.
98 
99  // Sets this field's precision property.
101 
102  // Returns this field's precision property, or an empty casacore::String if it is not
103  // set.
105 
106  // Sets this field's width property.
108 
109  // Returns this field's width property, or an empty casacore::String if it is not
110  // set.
112 
113 private:
114  // Field name.
116 
117  // Field type.
119 
120  // Field keywords.
121  std::vector<TBKeyword*> keywords;
122 
123  // Field UCD.
125 
126  // Field ref.
128 
129  // Field unit.
131 
132  // Field precision.
134 
135  // Field width.
137 };
138 
139 }
140 
141 #endif /* TBFIELD_H_ */
casacore::String getType()
Returns this field&#39;s type.
casacore::String getUCD()
Returns this field&#39;s UCD property, or an empty casacore::String if it is not set. ...
casacore::String ref
Field ref.
Definition: TBField.h:127
casacore::String precision
Field precision.
Definition: TBField.h:133
casacore::String getName()
Returns this field&#39;s name.
void setUnit(casacore::String unit)
Sets this field&#39;s unit property.
std::vector< TBKeyword * > keywords
Field keywords.
Definition: TBField.h:121
casacore::String type
Field type.
Definition: TBField.h:118
casacore::String getWidth()
Returns this field&#39;s width property, or an empty casacore::String if it is not set.
casacore::String name
Field name.
Definition: TBField.h:115
casacore::String ucd
Field UCD.
Definition: TBField.h:124
std::vector< TBKeyword * > * getKeywords()
Returns this field&#39;s keywords.
TBKeyword * keywordAt(unsigned int i)
Returns the keyword at index i.
void setWidth(casacore::String width)
Sets this field&#39;s width property.
casacore::String getUnit()
Returns this field&#39;s unit property, or an empty casacore::String if it is not set.
casacore::String unit
Field unit.
Definition: TBField.h:130
void setRef(casacore::String ref)
Sets this field&#39;s ref property.
casacore::String width
Field width.
Definition: TBField.h:136
Representation of a table field.
Definition: TBField.h:48
void setPrecision(casacore::String precision)
Sets this field&#39;s precision property.
casacore::String getRef()
Returns this field&#39;s ref property, or an empty casacore::String if it is not set. ...
String: the storage and methods of handling collections of characters.
Definition: String.h:223
TBField(casacore::String name, casacore::String type)
Constructor to take the name and type.
TBKeyword * keyword(int i)
Returns the keyword at index i, or NULL if there is none.
Representation of a keyword attached to a table or field.
Definition: TBKeyword.h:45
unsigned int numKeywords()
Returns the number of keywords this field has.
casacore::String getPrecision()
Returns this field&#39;s precision property, or an empty casacore::String if it is not set...
void addKeyword(TBKeyword *keyword)
Adds the given keyword to this field&#39;s keyword list.
void setUCD(casacore::String ucd)
Sets this field&#39;s UCD property.