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