casacore
Loading...
Searching...
No Matches
TableRecord.h
Go to the documentation of this file.
1//# TableRecord.h: A hierarchical collection of named fields of various types
2//# Copyright (C) 1996,1997,1998,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: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26
27#ifndef TABLES_TABLERECORD_H
28#define TABLES_TABLERECORD_H
29
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Containers/RecordInterface.h>
33#include <casacore/tables/Tables/TableRecordRep.h>
34#include <casacore/casa/Containers/RecordDesc.h>
35#include <casacore/casa/Utilities/COWPtr.h>
36#include <casacore/casa/Arrays/ArrayFwd.h>
37
38namespace casacore { //# NAMESPACE CASACORE - BEGIN
39
40//# Forward Declarations
41class IPosition;
42class AipsIO;
43class TableLock;
44
45
46// <summary>
47// A hierarchical collection of named fields of various types
48// </summary>
49
50// <use visibility=export>
51// <reviewed reviewer="Mark Wieringa" date="1996/04/15" tests="tTableRecord">
52// </reviewed>
53
54// <prerequisite>
55// <li> <linkto class="RecordDesc">RecordDesc</linkto>.
56// <li> <linkto class="RecordFieldPtr">RecordFieldPtr</linkto>.
57// </prerequisite>
58//
59// <etymology>
60// TableRecord is a Record to be used in the Table system.
61// </etymology>
62//
63// <synopsis>
64// Class <linkto class=RecordInterface>RecordInterface</linkto> describes
65// the fundamental properties of records.
66// <br>
67// The TableRecord class is a particular type of a record class.
68// <br> The TableRecord class structure is shown in this
69// <a href="TableRecord.drawio.svg.html">UML diagram</a>.
70// <br>
71// The fields in TableRecord may be of scalar type, array type, a Table
72// or a TableRecord.
73// The types are chosen to be compatible with the native
74// types of the Table system, viz: Bool, uChar, Short, Int, uInt, Int64, Float,
75// Double, Complex, DComplex, String.
76// Arrays of all these types are also available.
77// Note that a TableRecord is not a space-efficient way of storing
78// small objects.
79// <p>
80// The structure of a TableRecord is defined by the
81// <linkto class="RecordDesc">RecordDesc</linkto> class.
82// The structure of the TableRecord can be defined at
83// construction time. It can thereafter be restructured. This has the
84// effect, however, that any existing RecordFieldPtr objects become
85// invalid.
86// <br>
87// It is possible to add or remove fields once a TableRecord is constructed.
88// However, this is not possible when the TableRecord is constructed with a
89// fixed structure (i.e. with the fixedStructure flag set).
90// <p>
91// A TableRecord is an hierarchical structure, because it can have fields
92// containing TableRecord's (as layed out in the RecordDesc). A subrecord
93// has a variable structure, when its RecordDesc is empty (i.e. contains
94// no fields). It is fixed when its RecordDesc contains fields.
95// <p>
96// A TableRecord may be assigned to another only if they conform; that is if
97// their fields have the identical type in the identical order.
98// The field names do not need to be identical however, only the types.
99// That is, the structure needs to be identical, but
100// not the labels. Note that field order is significant,
101// <src>[ifield(type=Int),ffield(type=Float)]</src>
102// is not the same as <src>[ffield(type=Float),ifield(type=Int)]</src>
103// <br>
104// Conformance is checked recursively for fixed subrecords. That is, a
105// variable structured subrecord is not checked, because any record
106// can be assigned to it. A fixed structured subrecord has to
107// conform the corresponding subrecord in the source.
108// <br> A Table field is conforming when the name of the table
109// description of the source table matches the table description name
110// defined in the RecordDesc field. When that name is blank, every
111// table matches. In fact, defining a table description name is identical
112// to defining an array shape..
113// <p>
114// When a TableRecord is read back, possible Tables contained in fields
115// are only opended and read back when they are accessed for the first time.
116// In that way no needless table opens are done.
117// When a table has been opened, it is possible to close it. This
118// can be useful to save memory usage.
119// <p>
120// TableRecord uses copy-on-write semantics. This means that when a
121// TableRecord is copied, only the pointer to the underlying
122// TableRecordRep object is copied.
123// Only when the TableRecord gets changed (i.e. when a non-const
124// TableRecord member function is called), the TableRecordRep object is copied.
125// This results in a cheap copy behaviour.
126// </synopsis>
127//
128// <example>
129// <srcblock>
130// {
131// TableDesc td ("td", TableDesc::Scratch);
132// td.addColumn (ScalarColumnDesc<Int> ("col1"));
133// td.addColumn (ScalarColumnDesc<float> ("col2"));
134// SetupNewTable newtab ("tTableRecord_tmp.tab1", td1, Table::New);
135// Table tab (newtab, 10);
136// RecordDesc rd;
137// rd.addTable ("tab1", "td"); // with description name
138// rd.addField ("tab2", TpTable); // without description name
139// TableRecord rec (rd, RecordInterface::Variable);
140// // Both define's are possible.
141// // The first one because the table description name matches.
142// // The second one because that field has no table description name,
143// // thus every table description matches.
144// rec.defineTable (rec.fieldNumber("tab1"), tab1);
145// rec.defineTable (rec.fieldNumber("tab2"), tab1);
146// Table t1 = rec.asTable ("tab1");
147// AlwaysAssertExit (t1.nrow() == 10 && t1.tableDesc().ncolumn() == 2);
148// Table t2 = rec.asTable ("tab2");
149// AlwaysAssertExit (t2.nrow() == 10 && t2.tableDesc().ncolumn() == 2);
150// AipsIO aos ("file.name", ByteIO::New);
151// aos << rec;
152// }
153// // Note that he above is put in a separate scope to be sure that
154// // all objects are deleted and tables are written.
155// {
156// TableRecord rec;
157// AipsIO aos ("file.name");
158// aos >> rec;
159// // At this point the record is read back, but the tables are not opened.
160// // The next statement accesses the table resulting in its open.
161// Table t1 = rec.asTable ("tab1");
162// // The following statement closes it again.
163// rec.closeTable ("tab1");
164// </srcblock>
165// </example>
166//
167// <motivation>
168// In principle the class Record could also support data type Table.
169// However, this would have had the big disadvantage that all the
170// Table code would have be linked in when only a simple Record is needed.
171// It was decided that for that reason it was better to support tables
172// in a separate class.
173// </motivation>
174//
175// <todo asof="1995/08/22">
176// <li> A record reference class, which contains some fields from another
177// record, would likely be useful. This would be analagous to a
178// subarray sliced from an existing array.
179// </todo>
180
181
183{
184friend class TableRecordRep;
185
186public:
187 // Create a record with no fields.
188 // The record has a variable structure.
190
191 // Create a record with no fields.
192 // The type determines if the record has a fixed or variable structure.
193 // The callback function is called when a field is added to the Record.
194 // That function can check the name and of data type of the new field
195 // (for instance, the Table system uses it to ensure that table columns
196 // and keywords have different names).
199 const void* checkArgument = 0);
200
201 // Create a record with the given description. If it is not possible to
202 // create all fields (for example, if a field with an unsupported data
203 // type is requested), an exception is thrown.
204 // The type determines if the record has a fixed or variable structure.
205 // All fields are checked by the field checking function (if defined)
206 // (for instance, the Table system uses it to ensure that table columns
207 // and keywords have different names).
210 CheckFieldFunction* = 0,
211 const void* checkArgument = 0);
212
213 // Create a copy of other using copy semantics.
214 TableRecord (const TableRecord& other);
215
216 // Create a TableRecord from another type of record.
217 // It uses copy-on-write semantics if possible (i.e. if
218 // <src>other</src> is a TableRecord), otherwise each field is copied.
219 // Subrecords are also copied and converted to TableRecords if needed.
221
222 // Copy the data in the other record to this record.
223 // It can operate in 2 ways depending on the TableRecord structure flag.
224 // <ul>
225 // <li> For variable structured records the existing fields are
226 // thrown away and replaced by the new fields.
227 // This means that RecordFieldPtr's using this record get invalidated.
228 // Because copy-on-write semantics are used, this kind of
229 // assignment is a very efficient operation.
230 // <li> For fixed structured records the existing values are replaced
231 // by the new values. This means that RecordFieldPtr's using this
232 // record remain valid.
233 // The structure of the other record has to conform this record
234 // or this record has to be empty, otherwise an exception is thrown.
235 // This assignment is less efficient, because it has to check the
236 // conformance and because each value has to be copied.
237 // </ul>
238 // <note role=warning>
239 // Attributes like fixed structure flag and check function will not
240 // be copied.
241 // </note>
243
244 // Release resources associated with this object.
246
247 // Make a copy of this object.
248 virtual RecordInterface* clone() const;
249
250 // Assign that RecordInterface object to this one.
251 // If <src>that</src> is a TableRecord, copy-on-write is used.
252 // Otherwise each individual field is copied.
253 virtual void assign (const RecordInterface& that);
254
255 // Convert the TableRecord to a Record (recursively).
256 // A possible Table object is converted to a string containing
257 // the table name preceeded by 'Table: ' (as used by TableProxy).
259
260 // Fill the TableRecord from the given Record.
261 // The fields are appended to the TableRecord.
262 // It is the opposite of toRecord, so a String containing 'Table: '
263 // is handled as a Table (if it exists).
264 void fromRecord (const Record& rec);
265
266 // Get or define the value as a ValueHolder.
267 // This is useful to pass around a value of any supported type.
268 // <group>
271 const ValueHolder&);
272 // </group>
273
274 // Get the comment for this field.
275 virtual const String& comment (const RecordFieldId&) const;
276
277 // Set the comment for this field.
278 virtual void setComment (const RecordFieldId&, const String& comment);
279
280 // Describes the current structure of this TableRecord.
281 const RecordDesc& description() const;
282
283 // Change the structure of this TableRecord to contain the fields in
284 // newDescription. After calling restructure, <src>description() ==
285 // newDescription</src>. Any existing RecordFieldPtr objects are
286 // invalidated (their <src>isAttached()</src> members return False) after
287 // this call.
288 // <br>When the new description contains subrecords, those subrecords
289 // will be restructured if <src>recursive=True</src> is given.
290 // Otherwise the subrecord is a variable empty record.
291 // Subrecords will be variable if their description is empty (i.e. does
292 // not contain any field), otherwise they are fixed.
293 // <br>Restructuring is not possible and an exception is thrown
294 // if the Record has a fixed structure.
295 virtual void restructure (const RecordDesc& newDescription,
296 Bool recursive=True);
297
298 // Returns True if this and other have the same RecordDesc, other
299 // than different names for the fields. That is, the number, type and the
300 // order of the fields must be identical (recursively for fixed
301 // structured sub-Records in this).
302 // <note role=caution>
303 // <src>thisRecord.conform(thatRecord) == True</src> does not imply
304 // <br><src>thatRecord.conform(thisRecord) == True</src>, because
305 // a variable record in one conforms a fixed record in that, but
306 // not vice-versa.
307 // </note>
308 Bool conform (const TableRecord& other) const;
309
310 // How many fields does this structure have? A convenient synonym for
311 // <src>description().nfields()</src>.
312 virtual uInt nfields() const;
313
314 // Get the field number from the field name.
315 // -1 is returned if the field name is unknown.
316 virtual Int fieldNumber (const String& fieldName) const;
317
318 // Get the data type of this field.
319 virtual DataType type (Int whichField) const;
320
321 // Remove a field from the record.
322 // <note role=caution>
323 // Removing a field means that the field number of the fields following
324 // it will be decremented. Only the RecordFieldPtr's
325 // pointing to the removed field will be invalidated.
326 // </note>
328
329 // Rename the given field.
330 void renameField (const String& newName, const RecordFieldId&);
331
332 // Define a value for the given field.
333 // When the field is unknown, it will be added to the record.
334 // The second version is meant for any type of record (e.g. Record,
335 // TableRecord, GlishRecord). It is converted to a TableRecord using the
336 // TableRecord constructor taking a RecordInterface object.
337 // <group>
340 virtual void defineRecord (const RecordFieldId&,
341 const RecordInterface& value,
343 void defineTable (const RecordFieldId&, const Table& value,
345 // </group>
346
347 // Get the subrecord or table from the given field.
348 // <note>
349 // The non-const version has a different name to prevent that the
350 // copy-on-write mechanism makes a copy when not necessary.
351 // </note>
352 // <group>
353 const TableRecord& subRecord (const RecordFieldId&) const;
355 virtual const RecordInterface& asRecord (const RecordFieldId&) const;
357 // </group>
358
359 // Get the table from the given field.
360 // By default the read/write option and lock options are inherited
361 // from the parent table.
362 // If openWritable=True, the table is still opened as readonly if the file
363 // permissions do not permit write access.
364 // <group>
366 Table asTable (const RecordFieldId&, const TableLock& lockOptions) const;
367 // </group>
368
369 // Get the attributes of a table field.
371
372 // Merge a field from another record into this record.
373 // The DuplicatesFlag (as described in
374 // <linkto class=RecordInterface>RecordInterface</linkto>) determines
375 // what will be done in case the field name already exists.
376 void mergeField (const TableRecord& other, const RecordFieldId&,
378
379 // Merge all fields from the other record into this record.
380 // The DuplicatesFlag (as described in
381 // <linkto class=RecordInterface>RecordInterface</linkto>) determines
382 // what will be done in case a field name already exists.
383 // An exception will be thrown if other is the same as this
384 // (i.e. if merging the record itself).
386
387 // Close the table in the given field.
388 // When accessed again, it will be opened automatically.
389 // This can be useful to save memory usage.
390 void closeTable (const RecordFieldId&) const;
391
392 // Close all open tables.
393 // When accessed again, it will be opened automatically.
394 // This can be useful to save memory usage.
395 void closeTables() const;
396
397 // Flush all open subtables.
398 void flushTables (Bool fsync=False) const;
399
400 // Rename the subtables with a path containing the old parent table name.
401 void renameTables (const String& newParentName,
402 const String& oldParentName);
403
404 // Are subtables used in other processes.
405 Bool areTablesMultiUsed() const;
406
407 // Write the TableRecord to an output stream.
408 friend AipsIO& operator<< (AipsIO& os, const TableRecord& rec);
409
410 // Read the TableRecord from an input stream.
412
413 // Put the data of a record.
414 // This is used to write a subrecord, whose description has
415 // not been written.
416 void putRecord (AipsIO& os, const TableAttr&) const;
417
418 // Read a record.
419 // This is used to read a subrecord, whose description has
420 // not been read.
421 void getRecord (AipsIO& os, const TableAttr&);
422
423 // Put the data of a record.
424 // This is used to write a subrecord, whose description has
425 // already been written.
426 void putData (AipsIO& os, const TableAttr&) const;
427
428 // Read the data of a record.
429 // This is used to read a subrecord, whose description has
430 // already been read.
431 void getData (AipsIO& os, uInt version, const TableAttr&);
432
433 // Print the contents of the record.
434 // Only the first <src>maxNrValues</src> of an array will be printed.
435 // A value < 0 means the entire array.
436 virtual void print (std::ostream&,
437 Int maxNrValues = 25,
438 const String& indent="") const;
439
440 // Reopen possible tables in keywords as read/write.
441 // Tables are not reopened if they are not writable.
442 void reopenRW();
443
444 // Recursively set the attributes of subtables to the ones in the other
445 // record for matching subtable field names. Otherwise set it to defaultAttr.
446 // The name attribute is not changed.
447 // It is primarily a helper function for PlainTable::syncTable
448 // and ColumnSet::syncColumns.
449 // <br>However, it can also be used to achieve that all subtables of a
450 // read/write table are opened as readonly. E.g.:
451 // <srcblock>
452 // TableAttr newAttr(String(), False, mainTable.lockOptions());
453 // mainTable.keywordSet().setTableAttr (TableRecord(), newAttr);
454 // </srcblock>
455 void setTableAttr (const TableRecord& other, const TableAttr& defaultAttr);
456
457 // Make a unique record representation
458 // (to do copy-on-write in RecordFieldPtr).
459 virtual void makeUnique();
460
461
462protected:
463 // Used by the RecordField classes to attach in a type-safe way to the
464 // correct field.
465 // <group>
466 virtual void* get_pointer (Int whichField, DataType type) const;
467 virtual void* get_pointer (Int whichField, DataType type,
468 const String& recordType) const;
469 // </group>
470
471 // Return a const reference to the underlying TableRecordRep.
472 const TableRecordRep& ref() const;
473
474 // Return a non-const reference to the underlying TableRecordRep.
475 // When needed, the TableRecordRep will be copied and all RecordField
476 // objects will be notified.
478
479 // Add a field to the record.
480 virtual void addDataField (const String& name, DataType type,
481 const IPosition& shape, Bool fixedShape,
482 const void* value);
483
484 // Define a value in the given field.
485 virtual void defineDataField (Int whichField, DataType type,
486 const void* value);
487
488private:
489 // Get the description of this record.
490 virtual RecordDesc getDescription() const;
491
492 // Create TableRecord as a subrecord.
493 // When the description is empty, the record has a variable structure.
494 // Otherwise it is fixed.
495 // <group>
498 // </group>
499
500 // Set the recordtype of this record and all its subrecords (recursively).
502
503 // The TableRecord representation.
505 // The parent TableRecord.
507};
508
509
510
511inline const TableRecordRep& TableRecord::ref() const
512{
513 return rep_p.ref();
514}
516{
517 return ref().description();
518}
519
520inline Bool TableRecord::conform (const TableRecord& other) const
521{
522 return ref().conform (other.ref());
523}
524
526 const TableAttr& parentAttr) const
527{
528 ref().putData (os, parentAttr);
529}
530
531inline void TableRecord::getData (AipsIO& os, uInt version,
532 const TableAttr& parentAttr)
533{
534 rwRef().getData (os, version, parentAttr);
535}
536
538{
539 rwRef().reopenRW();
540}
541
542inline void TableRecord::closeTables() const
543{
544 ref().closeTables();
545}
546
547inline void TableRecord::flushTables (Bool fsync) const
548{
549 ref().flushTables (fsync);
550}
551
552inline void TableRecord::renameTables (const String& newParentName,
553 const String& oldParentName)
554{
555 rwRef().renameTables (newParentName, oldParentName);
556}
557
559{
560 return ref().areTablesMultiUsed();
561}
562
563
564
565} //# NAMESPACE CASACORE - END
566
567#endif
RecordType & recordType()
Give access to the RecordType flag (write-access is needed when a record is read back).
String name(const RecordFieldId &) const
Get the name of this field.
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
RecordType
Define the flag telling if a Record has a fixed or variable structure.
@ Variable
Record has a variable structure; after Record creation fields can be added or removed at will.
@ Fixed
Record has a fixed structure; that is, no fields can be added or removed once the Record is created.
Bool CheckFieldFunction(const String &fieldName, DataType dataType, const void *extraArgument, String &message)
Define the signature of the add callback function.
DuplicatesFlag
Define the Duplicates flag for the function merge in the various record classes.
@ ThrowOnDuplicates
Throw an exception.
String: the storage and methods of handling collections of characters.
Definition String.h:223
void closeTables() const
Close all open tables.
const RecordDesc & description() const
Describes the current structure of this Record.
void reopenRW()
Reopen possible tables in keywords as read/write.
Bool areTablesMultiUsed() const
Are subtables used in other processes.
void getData(AipsIO &os, uInt version, const TableAttr &)
Read the data of a record.
void putData(AipsIO &os, const TableAttr &) const
Put the data of a record.
void renameTables(const String &newParentName, const String &oldParentName)
Rename the subtables with a path containing the old parent table name.
Bool conform(const TableRecordRep &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields.
void flushTables(Bool fsync) const
Flush all open subtables.
TableRecord()
Create a record with no fields.
Table asTable(const RecordFieldId &) const
Get the table from the given field.
virtual void restructure(const RecordDesc &newDescription, Bool recursive=True)
Change the structure of this TableRecord to contain the fields in newDescription.
virtual RecordInterface * clone() const
Make a copy of this object.
void defineRecord(const RecordFieldId &, const TableRecord &value, RecordType type=Variable)
Define a value for the given field.
void closeTables() const
Close all open tables.
TableRecord & operator=(const TableRecord &other)
Copy the data in the other record to this record.
TableRecord & rwSubRecord(const RecordFieldId &)
void getData(AipsIO &os, uInt version, const TableAttr &)
Read the data of a record.
TableRecordRep & rwRef()
Return a non-const reference to the underlying TableRecordRep.
Record toRecord() const
Convert the TableRecord to a Record (recursively).
virtual void assign(const RecordInterface &that)
Assign that RecordInterface object to this one.
virtual Int fieldNumber(const String &fieldName) const
Get the field number from the field name.
virtual void makeUnique()
Make a unique record representation (to do copy-on-write in RecordFieldPtr).
void putData(AipsIO &os, const TableAttr &) const
Put the data of a record.
virtual const String & comment(const RecordFieldId &) const
Get the comment for this field.
Bool areTablesMultiUsed() const
Are subtables used in other processes.
virtual RecordInterface & asrwRecord(const RecordFieldId &)
void removeField(const RecordFieldId &)
Remove a field from the record.
void mergeField(const TableRecord &other, const RecordFieldId &, DuplicatesFlag=ThrowOnDuplicates)
Merge a field from another record into this record.
virtual void print(std::ostream &, Int maxNrValues=25, const String &indent="") const
Print the contents of the record.
Table asTable(const RecordFieldId &, const TableLock &lockOptions) const
void setRecordType(RecordType type)
Set the recordtype of this record and all its subrecords (recursively).
void closeTable(const RecordFieldId &) const
Close the table in the given field.
void defineTable(const RecordFieldId &, const Table &value, RecordType type=Variable)
friend AipsIO & operator<<(AipsIO &os, const TableRecord &rec)
Write the TableRecord to an output stream.
virtual void addDataField(const String &name, DataType type, const IPosition &shape, Bool fixedShape, const void *value)
Add a field to the record.
Bool conform(const TableRecord &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields.
TableRecord(RecordType type, CheckFieldFunction *=0, const void *checkArgument=0)
Create a record with no fields.
virtual void defineRecord(const RecordFieldId &, const RecordInterface &value, RecordType=Variable)
virtual DataType type(Int whichField) const
Get the data type of this field.
~TableRecord()
Release resources associated with this object.
void setTableAttr(const TableRecord &other, const TableAttr &defaultAttr)
Recursively set the attributes of subtables to the ones in the other record for matching subtable fie...
void renameTables(const String &newParentName, const String &oldParentName)
Rename the subtables with a path containing the old parent table name.
friend AipsIO & operator>>(AipsIO &os, TableRecord &rec)
Read the TableRecord from an input stream.
virtual void defineDataField(Int whichField, DataType type, const void *value)
Define a value in the given field.
const TableRecordRep & ref() const
Return a const reference to the underlying TableRecordRep.
virtual void * get_pointer(Int whichField, DataType type, const String &recordType) const
virtual uInt nfields() const
How many fields does this structure have? A convenient synonym for description().nfields().
const TableRecord & subRecord(const RecordFieldId &) const
Get the subrecord or table from the given field.
TableRecord(TableRecordRep *parent, RecordType type)
TableRecordRep * parent_p
The parent TableRecord.
virtual void setComment(const RecordFieldId &, const String &comment)
Set the comment for this field.
TableRecord(const TableRecord &other)
Create a copy of other using copy semantics.
void putRecord(AipsIO &os, const TableAttr &) const
Put the data of a record.
virtual void * get_pointer(Int whichField, DataType type) const
Used by the RecordField classes to attach in a type-safe way to the correct field.
virtual const RecordInterface & asRecord(const RecordFieldId &) const
TableRecord(const RecordInterface &other)
Create a TableRecord from another type of record.
void getRecord(AipsIO &os, const TableAttr &)
Read a record.
COWPtr< TableRecordRep > rep_p
The TableRecord representation.
void merge(const TableRecord &other, DuplicatesFlag=ThrowOnDuplicates)
Merge all fields from the other record into this record.
void renameField(const String &newName, const RecordFieldId &)
Rename the given field.
void reopenRW()
Reopen possible tables in keywords as read/write.
virtual RecordDesc getDescription() const
Get the description of this record.
virtual ValueHolder asValueHolder(const RecordFieldId &) const
Get or define the value as a ValueHolder.
const RecordDesc & description() const
Describes the current structure of this TableRecord.
void flushTables(Bool fsync=False) const
Flush all open subtables.
const TableAttr & tableAttributes(const RecordFieldId &) const
Get the attributes of a table field.
void fromRecord(const Record &rec)
Fill the TableRecord from the given Record.
TableRecord(TableRecordRep *parent, const RecordDesc &description)
Create TableRecord as a subrecord.
TableRecord(const RecordDesc &description, RecordType type=Fixed, CheckFieldFunction *=0, const void *checkArgument=0)
Create a record with the given description.
virtual void defineFromValueHolder(const RecordFieldId &, const ValueHolder &)
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
const Bool True
Definition aipstype.h:41