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