30 #ifndef TABLES_TABLERECORD_H
31 #define TABLES_TABLERECORD_H
202 const void* checkArgument = 0);
214 const void* checkArgument = 0);
322 virtual DataType
type (
Int whichField)
const;
405 const String& oldParentName);
439 virtual void print (std::ostream&,
440 Int maxNrValues = 25,
441 const String& indent=
"")
const;
556 const String& oldParentName)
const RecordDesc & description() const
Describes the current structure of this TableRecord.
A Vector of integers, for indexing into Array<T> objects.
Record toRecord() const
Convert the TableRecord to a Record (recursively).
void reopenRW()
Reopen possible tables in keywords as read/write.
RecordType
Define the flag telling if a Record has a fixed or variable structure.
virtual void print(std::ostream &, Int maxNrValues=25, const String &indent="") const
Print the contents of the record.
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
const TableRecord & subRecord(const RecordFieldId &) const
Get the subrecord or table from the given field.
void renameTables(const String &newParentName, const String &oldParentName)
Rename the subtables with a path containing the old parent table name.
void closeTable(const RecordFieldId &) const
Close the table in the given field.
void getData(AipsIO &os, uInt version, const TableAttr &)
Read the data of a record.
Main interface class to a read/write table.
const TableAttr & tableAttributes(const RecordFieldId &) const
Get the attributes of a table field.
Bool conform(const TableRecord &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields...
AipsIO is the object persistency mechanism of Casacore.
const RecordDesc & description() const
Describes the current structure of this Record.
virtual void defineFromValueHolder(const RecordFieldId &, const ValueHolder &)
Table asTable(const RecordFieldId &) const
Get the table from the given field.
void defineRecord(const RecordFieldId &, const TableRecord &value, RecordType type=Variable)
Define a value for the given field.
virtual void makeUnique()
Make a unique record representation (to do copy-on-write in RecordFieldPtr).
virtual Int fieldNumber(const String &fieldName) const
Get the field number from the field name.
void closeTables() const
Close all open tables.
const TableRecordRep & ref() const
Return a const reference to the underlying TableRecordRep.
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.
TableRecordRep & rwRef()
Return a non-const reference to the underlying TableRecordRep.
virtual RecordInterface * clone() const
Make a copy of this object.
~TableRecord()
Release resources associated with this object.
TableRecord & operator=(const TableRecord &other)
Copy the data in the other record to this record.
void defineTable(const RecordFieldId &, const Table &value, RecordType type=Variable)
void fromRecord(const Record &rec)
Fill the TableRecord from the given Record.
Record has a fixed structure; that is, no fields can be added or removed once the Record is created...
void getRecord(AipsIO &os, const TableAttr &)
Read a record.
virtual ValueHolder asValueHolder(const RecordFieldId &) const
Get or define the value as a ValueHolder.
The identification of a record field.
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...
virtual RecordDesc getDescription() const
Get the description of this record.
Description of the fields in a record object.
virtual RecordInterface & asrwRecord(const RecordFieldId &)
void merge(const TableRecord &other, DuplicatesFlag=ThrowOnDuplicates)
Merge all fields from the other record into this record.
void putData(AipsIO &os, const TableAttr &) const
Put the data of a record.
A holder for a value of any basic Casacore data type.
void flushTables(Bool fsync=False) const
Flush all open subtables.
Record has a variable structure; after Record creation fields can be added or removed at will...
Copy-On-Write-Pointer class - allows control of copy based on constness.
DuplicatesFlag
Define the Duplicates flag for the function merge in the various record classes.
virtual const String & comment(const RecordFieldId &) const
Get the comment for this field.
The representation of a TableRecord.
void renameField(const String &newName, const RecordFieldId &)
Rename the given field.
void putData(AipsIO &os, const TableAttr &) const
Put the data of a record.
A hierarchical collection of named fields of various types.
Bool areTablesMultiUsed() const
Are subtables used in other processes.
bool Bool
Define the standard types used by Casacore.
void putRecord(AipsIO &os, const TableAttr &) const
Put the data of a record.
virtual void setComment(const RecordFieldId &, const String &comment)
Set the comment for this field.
virtual void restructure(const RecordDesc &newDescription, Bool recursive=True)
Change the structure of this TableRecord to contain the fields in newDescription. ...
COWPtr< TableRecordRep > rep_p
The TableRecord representation.
Bool areTablesMultiUsed() const
Are subtables used in other processes.
Class to hold table lock options.
friend AipsIO & operator<<(AipsIO &os, const TableRecord &rec)
Write the TableRecord to an output stream.
A hierarchical collection of named fields of various types.
void removeField(const RecordFieldId &)
Remove a field from the record.
virtual uInt nfields() const
How many fields does this structure have? A convenient synonym for description().nfields().
void renameTables(const String &newParentName, const String &oldParentName)
Rename the subtables with a path containing the old parent table name.
virtual const RecordInterface & asRecord(const RecordFieldId &) const
void mergeField(const TableRecord &other, const RecordFieldId &, DuplicatesFlag=ThrowOnDuplicates)
Merge a field from another record into this record.
virtual void assign(const RecordInterface &that)
Assign that RecordInterface object to this one.
void closeTables() const
Close all open tables.
void flushTables(Bool fsync) const
Flush all open subtables.
TableRecordRep * parent_p
The parent TableRecord.
RecordType & recordType()
Give access to the RecordType flag (write-access is needed when a record is read back).
TableRecord & rwSubRecord(const RecordFieldId &)
virtual void addDataField(const String &name, DataType type, const IPosition &shape, Bool fixedShape, const void *value)
Add a field to the record.
String: the storage and methods of handling collections of characters.
void getData(AipsIO &os, uInt version, const TableAttr &)
Read the data of a record.
TableRecord()
Create a record with no fields.
virtual DataType type(Int whichField) const
Get the data type of this field.
void reopenRW()
Reopen possible tables in keywords as read/write.
Abstract base class for Record classes.
Bool CheckFieldFunction(const String &fieldName, DataType dataType, const void *extraArgument, String &message)
Define the signature of the add callback function.
Some attributes of a table.
virtual void defineDataField(Int whichField, DataType type, const void *value)
Define a value in the given field.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
String name(const RecordFieldId &) const
Get the name of this field.
friend AipsIO & operator>>(AipsIO &os, TableRecord &rec)
Read the TableRecord from an input stream.
void setRecordType(RecordType type)
Set the recordtype of this record and all its subrecords (recursively).
Bool conform(const TableRecordRep &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields...