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