casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableDesc.h
Go to the documentation of this file.
1 //# TableDesc.h: specify structure of Casacore tables
2 //# Copyright (C) 1994,1995,1996,1997,1999,2000,2001,2002
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 TABLES_TABLEDESC_H
29 #define TABLES_TABLEDESC_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 #include <casacore/casa/iosfwd.h>
37 #include <map>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
41 //# Forward Declarations
42 class TableRecord;
43 class TableAttr;
44 class TabPath;
45 template<class T> class Vector;
46 
47 // <summary>
48 // Define the structure of a Casacore table
49 // </summary>
50 
51 // <use visibility=export>
52 
53 // <reviewed reviewer="Paul Shannon" date="1994/08/11" tests="none">
54 // </reviewed>
55 
56 // <prerequisite>
57 // <li> column description classes
58 // <li> TableRecord
59 // </prerequisite>
60 
61 // <synopsis>
62 // A TableDesc object contains the description, or structure, of a table.
63 // This description is required for the creation of a new table.
64 // Descriptions are subsequently associated with every table and
65 // embedded in them.
66 //
67 // A table description consists of the following items:
68 // <ul>
69 // <li> Name, which cannot be blank if the description is saved in a file.
70 // The file name will be this name followed by .tabdsc.
71 // <li> Version, which defaults to a blank string.
72 // It serves merely as information for the user.
73 // <li> Comment, which defaults to an empty string.
74 // This serves purely as an informational string for the user.
75 // <li> A set of column descriptions which has to be added to the
76 // table description. A column description can be created using
77 // the classes ScalarColumnDesc, etc..
78 // At table creation it is determined by the user if a column
79 // has to be stored using a storage manager or calculated
80 // on-the-fly using a so-called virtual column engine.
81 // <li> A keyword set, which is by default empty.
82 // When a table is created from the description, it gets
83 // a copy of this keyword set as its initial keyword set.
84 // </ul>
85 //
86 // A TableDesc object can be constructed with one of the following
87 // options:
88 // <ul>
89 // <li> Old
90 // Open an existing table description file as readonly.
91 // <li> Update
92 // Open an existing table description file as read/write
93 // The TableDesc destructor will rewrite the possibly changed
94 // description.
95 // <li> New
96 // Create a new table description file.
97 // The TableDesc destructor will write the table description into the file.
98 // <li> NewNoReplace
99 // As option New, but an exception will be thrown if the table
100 // description file already exists.
101 // <li> Scratch
102 // Create a temporary table description. The table description will
103 // be lost when the TableDesc object is destructed.
104 // This is useful to create a Table object without storing the
105 // description separately.
106 // Note that the Table object maintains its own description (i.e. it
107 // copies the description when being constructed).
108 // <li> Delete
109 // Delete the table description file. This gets done by the destructor.
110 // </ul>
111 //
112 // More information is provided in the Tables module documentation.
113 // </synopsis>
114 
115 // <example>
116 // <srcblock>
117 // // First build the new description of a subtable.
118 // // Define columns ra and dec (double).
119 // TableDesc subTableDesc("tTableDesc_sub", "1", TableDesc::New);
120 // subTableDesc.addColumn (ScalarColumnDesc<double>("ra"));
121 // subTableDesc.addColumn (ScalarColumnDesc<double>("dec"));
122 //
123 // // Now create a new table description
124 // // Define a comment for the table description.
125 // // Define a double keyword.
126 // ColumnDesc colDesc1, colDesc2;
127 // TableDesc td("tTableDesc", "1", TableDesc::New);
128 // td.comment() = "A test of class TableDesc";
129 // td.rwKeywordSet().define ("equinox", 1950.0);
130 //
131 // // Define an integer column ab using the TableDesc::addColumn
132 // // function which creates a scalar column description.
133 // td.addColumn (ScalarColumnDesc<Int>("ab", "Comment for column ab"));
134 //
135 // // Add a scalar integer column ac, define keywords for it
136 // // and define a default value 0.
137 // // Overwrite the value of keyword unit.
138 // ScalarColumnDesc<Int> acColumn("ac");
139 // acColumn.rwKeywordSet().define ("scale", Complex(0.0f));
140 // acColumn.rwKeywordSet().define ("unit", "");
141 // acColumn.setDefault (0);
142 // td.addColumn (acColumn);
143 // td["ac"].rwKeywordSet().define ("unit", "DEG");
144 //
145 // // Add a scalar string column ad and define its comment string.
146 // td.addColumn (ScalarColumnDesc<String>("ad","comment for ad"));
147 //
148 // // Now define array columns.
149 // // This one is indirect and has no dimensionality mentioned yet.
150 // td.addColumn (ArrayColumnDesc<Complex>("Arr1","comment for Arr1"));
151 // // This one is indirect and has 3-dim arrays.
152 // td.addColumn (ArrayColumnDesc<Int>("A2r1","comment for Arr1",3));
153 // // This one is direct and has 2-dim arrays with axes length 4 and 7.
154 // td.addColumn (ArrayColumnDesc<uInt>("Arr3","comment for Arr1",
155 // IPosition(2,4,7),
156 // ColumnDesc::Direct));
157 //
158 // // Add a columns containing tables.
159 // td.addColumn (SubTableDesc("sub1", "subtable by name",
160 // "tTableDesc_sub"));
161 //
162 // // Define hypercolumn "dataCube".
163 // td.addColumn (ArrayColumnDesc<Complex>("data",2));
164 // td.addColumn (ArrayColumnDesc<Int>("pol",1));
165 // td.addColumn (ArrayColumnDesc<float>("freq",1));
166 // td.addColumn (ScalarColumnDesc<float>("time"));
167 // td.addColumn (ScalarColumnDesc<float>("baseline"));
168 // td.defineHypercolumn ("dataCube", 4,
169 // stringToVector ("data"),
170 // stringToVector ("pol,freq,time,baseline"));
171 // }
172 // </srcblock>
173 // </example>
174 
175 // <motivation>
176 // A table description specifies the structure, but not the contents,
177 // of a Casacore table. Since many tables will have identical structure
178 // and different content, it makes good sense to separate structure
179 // ("description") from content.
180 // </motivation>
181 
182 //# <todo asof="$DATE:$">
183 //# A List of bugs, limitations, extensions or planned refinements.
184 //# </todo>
185 
186 
188 {
189 public:
190 
191  //# Enumerate the possible options for TableDesc.
193 
194  // The default constructor creates a table description with
195  // option = Scratch and a blank name.
196  TableDesc();
197 
198  // Create a table description object with the given name.
199  // This name can be seen as the table type in the same way as a
200  // class name is the data type of an object.
201  // The name can only be blank when option=Scratch.
202  // The default table description path is used for the description file.
203  TableDesc (const String& type, TDOption = Old);
204 
205  // Create a table description object with the given name (i.e. table type)
206  // and version.
207  // The name can only be blank when option=Scratch.
208  // The default table description path is used for the description file.
209  TableDesc (const String& type, const String& version, TDOption = Old);
210 
211  // Create a table description object.
212  // The given table description path is used for the description file.
213  // The name can only be blank with option=Scratch.
214  TableDesc (const String& type, const String& version,
215  const TabPath&, TDOption = Old);
216 
217  // Create a table description object with the given name (i.e. table type)
218  // and version by copying the input table description.
219  // If the given name or version is blank, it will be copied from
220  // the input table description.
221  // The default table description path is used for the description file.
222  // The only options allowed are New, NewNoReplace and Scratch.
223  TableDesc (const TableDesc&, const String& type, const String& version,
224  TDOption, Bool copyColumns=True);
225 
226  // Create a table description object with the given name (i.e. table type)
227  // and version by copying the input table description.
228  // If the given name or version is blank, it will be copied from
229  // the input table description.
230  // The given table description path is used for the description file.
231  // The only options allowed are New, NewNoReplace and Scratch.
232  TableDesc (const TableDesc&, const String& type, const String& version,
233  const TabPath&, TDOption, Bool copyColumns=True);
234 
235  // This copy constructor makes a copy of the table description
236  // maintaining its name and version. By default a Scratch copy is made.
237  // It serves as a shorthand for the constructor:
238  // <br><src> TableDesc (const TableDesc&, "", "", TDOption); </src>
239  TableDesc (const TableDesc&, TDOption = Scratch);
240 
241  // The destructor writes the table description if changed.
242  ~TableDesc();
243 
244  // Test if a description file exists (i.e. isReadable).
245  static Bool isReadable (const String& tableDescName);
246 
247  // Get access to the set of column descriptions.
248  // In this way const <linkto class=ColumnDescSet>ColumnDescSet</linkto>
249  // functions (e.g. isDisjoint) can be used.
250  const ColumnDescSet& columnDescSet() const;
251 
252  // Add another table description to this table description.
253  // It merges the column descriptions, the special keywordSet
254  // (containing hypercolumn definitions) and the user keywordSet
255  // (this last one is not added if the flag is False).
256  // The two table descriptions have to be disjoint, i.e. no column
257  // nor keyword should already exist. Otherwise an TableInvOper
258  // exception is thrown and nothing gets added.
259  void add (const TableDesc& other, Bool addKeywordSet = True);
260 
261  // Get access to the keyword set.
262  // <group>
264  const TableRecord& keywordSet() const;
265  // </group>
266 
267  // Get readonly access to the private set of keywords.
268  const TableRecord& privateKeywordSet() const;
269 
270  // Add a column to the table description.
271  // An exception is thrown if a keyword or column with this name
272  // already exists.
273  // Although this function has a <src>ColumnDesc</src> as argument,
274  // it is usually needed to construct a more specialized object like
275  // <src>ArrayColumnDesc<float></src>. A <src>ColumnDesc</src>
276  // constructor converts that automatically to a <src>ColumnDesc</src>
277  // object.
278  // <srcblock>
279  // tableDesc.addColumn (ArrayColumnDesc<float> ("NAME"));
280  // </srcblock>
281  // On the other hand this function can also be used to add a
282  // column description from another table as in:
283  // <srcblock>
284  // tableDesc.addColumn (otherTableDesc.columnDesc("NAME"));
285  // </srcblock>
286  ColumnDesc& addColumn (const ColumnDesc&);
287 
288  // Add a column to the table description and give it another name.
289  // This may be useful to use a description of another column.
290  ColumnDesc& addColumn (const ColumnDesc&, const String& newname);
291 
292  // Remove a column.
293  // An exception is thrown if the column does not exist.
294  void removeColumn (const String& name);
295 
296  // Rename a column.
297  // An exception is thrown if the old name does not exist or
298  // if the name already exists.
299  // <note role=caution>
300  // Renaming a column should be done with care, because other
301  // columns may be referring this column. Also a hypercolumn definition
302  // might be using the old name.
303  // </note>
304  void renameColumn (const String& newname, const String& oldname);
305 
306  // Get number of columns.
307  uInt ncolumn() const;
308 
309  // Test if a column with this name exists.
310  Bool isColumn (const String& name) const;
311 
312  // Get a vector containing all column names.
313  Vector<String> columnNames() const;
314 
315  // Get the column description by name or by index.
316  // An exception is thrown if the column does not exist.
317  // Function isColumn should be used to test if a column exists.
318  // <group>
319  const ColumnDesc& columnDesc (const String& name) const;
320  const ColumnDesc& operator[] (const String& name) const;
321  const ColumnDesc& columnDesc (uInt index) const;
322  const ColumnDesc& operator[] (uInt index) const;
324  ColumnDesc& rwColumnDesc (uInt index);
325  // </group>
326 
327  // Get comment string.
328  const String& comment() const;
329 
330  // Get comment string (allowing it to be changed).
331  String& comment();
332 
333  // Show the table description on cout.
334  void show() const;
335 
336  // Show the table description.
337  void show (ostream& os) const;
338 
339  // Get the table type (i.e. name of table description).
340  const String& getType() const;
341 
342  // Get the table description version.
343  const String& version() const;
344 
345  // Define a hypercolumn.
346  // A hypercolumn is a group of one or more data columns of which
347  // the data is treated as one or more (regular) hypercubes.
348  // The hypercolumn has coordinate axes (e.g. time, frequency)
349  // which are columns in the table.
350  // When the entire hypercolumn consists of multiple hypercubes,
351  // ID-columns can be defined, which uniquely determine the
352  // hypercube to be used.
353  // Note that only <linkto class=TiledDataStMan>TiledDataStMan</linkto>
354  // requires the use of ID-columns.
355  // A hypercolumn definition is needed to be able to use a Tiled
356  // Storage Manager.
357  //
358  // The following has to be specified:
359  // <dl>
360  // <dt> Hypercolumn name
361  // <dd> which is the name used to refer to the hypercolumn.
362  // <dt> ndim
363  // <dd> defining the dimensionality of the hypercolumn (and
364  // of its hypercube(s)).
365  // <dt> Data column names
366  // <dd> which are the columns containing the hypercube data.
367  // When multiple columns are used, the shapes of the data
368  // in their cells must be the same in the same row.
369  // All data columns must contain numeric or Bool scalars or arrays.
370  // <dl>
371  // <dt> array:
372  // <dd> Its dimensionality has to be less than or equal to the
373  // dimensionality of the hypercolumn. If equal, the
374  // array itself already forms the hypercube. That would
375  // mean that each row is a hypercube.
376  // If less, the arrays from multiple rows form a hypercube,
377  // adding one or more dimensions to the array dimensionality.
378  // <dt> scalar:
379  // <dd> The data from multiple rows form a hypercube.
380  // Not all tiled storage managers support scalars.
381  // </dl>
382  // <dt> Coordinate column names (optional)
383  // <dd> which are the columns containing the coordinates of the
384  // hypercubes. They must be (u)Int, float, double or (D)Complex.
385  // When given, the number of coordinate columns must match the
386  // dimensionality of the hypercolumn.
387  // <br>
388  // When the data column cells contain arrays, the first N coordinate
389  // columns must contain vector values, where N is the dimensionality
390  // of the data arrays.
391  // The remaining coordinate columns must contain scalar values.
392  // <dt> Id column names (optional)
393  // <dd> have to be given when a hypercolumn can consist of multiple
394  // hypercubes. They define the column(s) determining which
395  // hypercube has to be used for a data array.
396  // The id columns must contain scalar values ((u)Int, float,
397  // double, (D)Complex, String and/or Bool).
398  // </dl>
399  // It will be checked if the given columns exists and have
400  // an appropriate type.
401  // <br>
402  // The default data manager type of the columns involved will be set
403  // to TiledColumnStMan if all data columns have a fixed shape.
404  // Otherwise they are set to TiledShapeStMan.
405  // The storage manager group of all columns involved will be set to
406  // the hypercolumn name. In that way binding columns to storage managers
407  // during the table creation process is easier because a simple
408  // <code>bindGroup</code> can be used.
409  // <p>
410  // For example:<br>
411  // A table contains data matrices with axes pol and freq.
412  // Those axes are defined in columns pol and freq containing
413  // vectors with the same length as the corresponding axis.
414  // The table also contains scalar columns time and baseline, which
415  // superimpose dimensions upon the data. So the data will be stored
416  // in a 4-d hypercube with axes pol,freq,time,baseline.
417  // It would be defined as follows:
418  // <srcblock>
419  // tableDesc.defineHypercolumn ("dataCube", 4,
420  // stringToVector ("data"),
421  // stringToVector ("pol,freq,time,baseline"));
422  // </srcblock>
423  // Note that the function <linkto group="ArrayUtil.h#stringToVector">
424  // stringToVector</linkto> is very convenient for creating a vector
425  // of Strings.
426  // <group name=defineHypercolumn>
427  void defineHypercolumn (const String& hypercolumnName,
428  uInt ndim,
429  const Vector<String>& dataColumnNames);
430  void defineHypercolumn (const String& hypercolumnName,
431  uInt ndim,
432  const Vector<String>& dataColumnNames,
433  const Vector<String>& coordColumnNames);
434  void defineHypercolumn (const String& hypercolumnName,
435  uInt ndim,
436  const Vector<String>& dataColumnNames,
437  const Vector<String>& coordColumnNames,
438  const Vector<String>& idColumnNames);
439  // </group>
440 
441  // Test if the given hypercolumn exists.
442  Bool isHypercolumn (const String& hypercolumnName) const;
443 
444  // Get the names of all hypercolumns.
446 
447  // Get the columns involved in a hypercolumn.
448  // It returns the dimensionality of the hypercolumn.
449  // An exception is thrown if the hypercolumn does not exist.
450  uInt hypercolumnDesc (const String& hypercolumnName,
451  Vector<String>& dataColumnNames,
452  Vector<String>& coordColumnNames,
453  Vector<String>& idColumnNames) const;
454 
455  // Adjust the hypercolumn definitions (for a RefTable).
456  // It removes and/or renames columns as necessary.
457  // Column names which are not part of the map are removed if
458  // <src>keepUnknown==False</src>.
459  // If all data columns of a hypercolumn are removed, the entire
460  // hypercolumn is removed.
461  void adjustHypercolumns (const std::map<String,String>& old2new,
462  Bool keepUnknownData = False,
463  Bool keepUnknownCoord = False,
464  Bool keppUnknownId = False);
465 
466  // Remove ID-columns from the given hypercolumn definitions
467  // and set their default data manager type to IncrementalStMan
468  // and group to ISM_TSM.
469  void removeIDhypercolumns (const Vector<String>& hcNames);
470 
471  // Remove given hypercolumn definition.
472  // An exception is thrown if it is not a hypercolumn.
473  void removeHypercolumnDesc (const String& hypercolumnName);
474 
475  // Check recursively if the descriptions of all subtables are known.
476  void checkSubTableDesc() const;
477 
478  void renameHypercolumn (const String& newHypercolumnName,
479  const String& hypercolumnName);
480 
481 
482 private:
483  String name_p; //# name of table description
484  String vers_p; //# version of table description
485  String dir_p; //# directory
486  String comm_p; //# comment
487  //# Note: the TableRecords are done as pointer, otherwise TableRecord.h
488  //# needs to be included leading to a mutual include.
489  TableRecord* key_p; //# user set of keywords
490  TableRecord* privKey_p; //# Private set of keywords
491  ColumnDescSet col_p; //# set of column names + indices
492  Bool swwrite_p; //# True = description can be written
493  TDOption option_p; //# Table desc. open option
494  AipsIO iofil_p; //# File
495 
496  // Assignment is not supported, because it is impossible to define
497  // its semantics. Does the data need to be written into a file
498  // before being overwritten?
499  // Declaring it private, makes it unusable.
500  TableDesc& operator= (const TableDesc&);
501 
502  // Initialize the table description.
503  void init (const TabPath&);
504 
505  // Initialize and copy a table description.
506  void copy (const TableDesc&, const TabPath&, Bool copyColumns);
507 
508  // Throw an invalid hypercolumn exception.
509  void throwHypercolumn (const String& hyperColumnName,
510  const String& message);
511 
512 
513 public:
514  // Put the table description into the file.
515  // The name can be used to write the TableDesc from a Table and
516  // is used to set the names of subtables correctly.
517  void putFile (AipsIO&, const TableAttr&) const;
518 
519  // Get the table description from the file.
520  void getFile (AipsIO&, const TableAttr&);
521 };
522 
523 
524 //# Get number of columns.
525 inline uInt TableDesc::ncolumn () const
526  { return col_p.ncolumn(); }
527 
528 //# Test if column exists.
529 inline Bool TableDesc::isColumn (const String& name) const
530  { return col_p.isDefined(name); }
531 
532 //# Get a column description.
533 inline const ColumnDesc& TableDesc::columnDesc (const String& name) const
534  { return col_p[name]; }
535 inline const ColumnDesc& TableDesc::operator[] (const String& name) const
536  { return col_p[name]; }
537 inline const ColumnDesc& TableDesc::columnDesc (uInt index) const
538  { return col_p[index]; }
539 inline const ColumnDesc& TableDesc::operator[] (uInt index) const
540  { return col_p[index]; }
542  { return col_p[name]; }
544  { return col_p[index]; }
545 
546 
547 //# Return the name (ie. type) of the table description.
548 inline const String& TableDesc::getType () const
549  { return name_p; }
550 
551 //# Return the version of the table description.
552 inline const String& TableDesc::version () const
553  { return vers_p; }
554 
555 //# Get access to the sets of keywords.
557  { return *key_p; }
558 inline const TableRecord& TableDesc::keywordSet () const
559  { return *key_p; }
561  { return *privKey_p; }
562 
563 //# Get the set of columns.
565  { return col_p; }
566 
567 //# Add a column.
569  { return col_p.addColumn (column); }
570 
572  const String& newname)
573  { return col_p.addColumn (column, newname); }
574 
575 //# Remove a column.
576 inline void TableDesc::removeColumn (const String& name)
577  { col_p.remove (name); }
578 
579 //# Access the comment.
580 inline const String& TableDesc::comment () const
581  { return comm_p; }
582 
584  { return comm_p; }
585 
586 inline void TableDesc::checkSubTableDesc () const
587  { col_p.checkSubTableDesc(); }
588 
589 
590 
591 
592 } //# NAMESPACE CASACORE - END
593 
594 #endif
595 
A 1-D Specialization of the Array class.
std::vector< double > Vector
Definition: ds9context.h:24
Bool isColumn(const String &name) const
Test if a column with this name exists.
Definition: TableDesc.h:529
void checkSubTableDesc() const
Check recursively if the descriptions of all subtables are known.
Definition: TableDesc.h:586
void add(const TableDesc &other, Bool addKeywordSet=True)
Add another table description to this table description.
Search path for table files.
Definition: TabPath.h:62
void remove(const String &name)
Remove a column.
ColumnDesc & addColumn(const ColumnDesc &)
Add a column to the table description.
Definition: TableDesc.h:568
void init(const TabPath &)
Initialize the table description.
const ColumnDesc & columnDesc(const String &name) const
Get the column description by name or by index.
Definition: TableDesc.h:533
void removeColumn(const String &name)
Remove a column.
Definition: TableDesc.h:576
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
TableRecord & rwKeywordSet()
Get access to the keyword set.
Definition: TableDesc.h:556
uInt ncolumn() const
Get number of columns.
Definition: TableDesc.h:525
Envelope class for the description of a table column.
Definition: ColumnDesc.h:131
void removeIDhypercolumns(const Vector< String > &hcNames)
Remove ID-columns from the given hypercolumn definitions and set their default data manager type to I...
void renameHypercolumn(const String &newHypercolumnName, const String &hypercolumnName)
virtual casacore::String type() const
Implements RegionShape::type.
Definition: RegionShapes.h:548
const String & getType() const
Get the table type (i.e.
Definition: TableDesc.h:548
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void renameColumn(const String &newname, const String &oldname)
Rename a column.
uInt ncolumn() const
Get nr of columns in this set.
Definition: ColDescSet.h:110
static Bool isReadable(const String &tableDescName)
Test if a description file exists (i.e.
uInt hypercolumnDesc(const String &hypercolumnName, Vector< String > &dataColumnNames, Vector< String > &coordColumnNames, Vector< String > &idColumnNames) const
Get the columns involved in a hypercolumn.
Vector< String > columnNames() const
Get a vector containing all column names.
const String & version() const
Get the table description version.
Definition: TableDesc.h:552
~TableDesc()
The destructor writes the table description if changed.
const ColumnDesc & operator[](const String &name) const
Definition: TableDesc.h:535
void removeHypercolumnDesc(const String &hypercolumnName)
Remove given hypercolumn definition.
void adjustHypercolumns(const std::map< String, String > &old2new, Bool keepUnknownData=False, Bool keepUnknownCoord=False, Bool keppUnknownId=False)
Adjust the hypercolumn definitions (for a RefTable).
void putFile(AipsIO &, const TableAttr &) const
Put the table description into the file.
void getFile(AipsIO &, const TableAttr &)
Get the table description from the file.
Bool isHypercolumn(const String &hypercolumnName) const
Test if the given hypercolumn exists.
const String & comment() const
Get comment string.
Definition: TableDesc.h:580
Set of table column descriptions.
Definition: ColDescSet.h:78
LatticeExprNode ndim(const LatticeExprNode &expr)
1-argument function to get the dimensionality of a lattice.
Bool isDefined(const String &name) const
Test if a column is defined in this set.
Definition: ColDescSet.h:114
const TableRecord & keywordSet() const
Definition: TableDesc.h:558
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
TableDesc()
The default constructor creates a table description with option = Scratch and a blank name...
const Bool False
Definition: aipstype.h:44
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:182
TableRecord * key_p
Definition: TableDesc.h:489
const TableRecord & privateKeywordSet() const
Get readonly access to the private set of keywords.
Definition: TableDesc.h:560
TableRecord * privKey_p
Definition: TableDesc.h:490
ColumnDescSet col_p
Definition: TableDesc.h:491
void throwHypercolumn(const String &hyperColumnName, const String &message)
Throw an invalid hypercolumn exception.
void defineHypercolumn(const String &hypercolumnName, uInt ndim, const Vector< String > &dataColumnNames)
Define a hypercolumn.
const ColumnDescSet & columnDescSet() const
Get access to the set of column descriptions.
Definition: TableDesc.h:564
ColumnDesc & addColumn(const ColumnDesc &)
Add a column.
void checkSubTableDesc() const
Check recursevily if the descriptions of all subtables are known.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
TableDesc & operator=(const TableDesc &)
Assignment is not supported, because it is impossible to define its semantics.
Define the structure of a Casacore table.
Definition: TableDesc.h:187
ColumnDesc & rwColumnDesc(const String &name)
Definition: TableDesc.h:541
Some attributes of a table.
Definition: TableAttr.h:77
void show() const
Show the table description on cout.
void copy(const TableDesc &, const TabPath &, Bool copyColumns)
Initialize and copy a table description.
const Bool True
Definition: aipstype.h:43
Vector< String > hypercolumnNames() const
Get the names of all hypercolumns.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42