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