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);
300 virtual DataType
type (
Int whichField)
const;
383 const String& oldParentName);
417 virtual void print (std::ostream&,
418 Int maxNrValues = 25,
419 const String& indent=
"")
const;
534 const String& oldParentName)
virtual DataType type(Int whichField) const
Get the data type of this field.
A Vector of integers, for indexing into Array<T> objects.
const RecordDesc & description() const
Describes the current structure of this Record.
void reopenRW()
Reopen possible tables in keywords as read/write.
RecordType
Define the flag telling if a Record has a fixed or variable structure.
Bool areTablesMultiUsed() const
Are subtables used in other processes.
virtual Int fieldNumber(const String &fieldName) const
Get the field number from the field name.
void renameTables(const String &newParentName, const String &oldParentName)
Rename the subtables with a path containing the old parent table name.
void getData(AipsIO &os, uInt version, const TableAttr &)
Read the data of a record.
Main interface class to a read/write table.
const TableRecord & subRecord(const RecordFieldId &) const
Get the subrecord or table from the given field.
AipsIO is the object persistency mechanism of Casacore.
void closeTables() const
Close all open tables.
const TableRecordRep & ref() const
Return a const reference to the underlying TableRecordRep.
const RecordDesc & description() const
Describes the current structure of this TableRecord.
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).
void closeTable(const RecordFieldId &) const
Close the table in the given field.
TableRecordRep & rwRef()
Return a non-const reference to the underlying TableRecordRep.
~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 putData(AipsIO &os, const TableAttr &) const
Put the data of a record.
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.
void getRecord(AipsIO &os, const TableAttr &)
Read a record.
void flushTables(Bool fsync=False) const
Flush all open subtables.
The identification of a record field.
Bool areTablesMultiUsed() const
Are subtables used in other processes.
Bool conform(const TableRecord &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields...
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 uInt nfields() const
How many fields does this structure have? A convenient synonym for description().nfields().
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.
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.
The representation of a TableRecord.
void renameField(const String &newName, const RecordFieldId &)
Rename the given field.
bool Bool
Define the standard types used by Casacore.
void flushTables(Bool fsync) const
Flush all open subtables.
virtual void print(std::ostream &, Int maxNrValues=25, const String &indent="") const
Print the contents of the 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. ...
const TableAttr & tableAttributes(const RecordFieldId &) const
Get the attributes of a table field.
COWPtr< TableRecordRep > rep_p
The TableRecord representation.
Bool conform(const TableRecordRep &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields...
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 const RecordInterface & asRecord(const RecordFieldId &) const
void renameTables(const String &newParentName, const String &oldParentName)
Rename the subtables with a path containing the old parent table name.
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.
virtual RecordInterface * clone() const
Make a copy of this object.
TableRecordRep * parent_p
The parent TableRecord.
void putRecord(AipsIO &os, const TableAttr &) const
Put the data of a record.
RecordType & recordType()
Give access to the RecordType flag (write-access is needed when a record is read back).
Table asTable(const RecordFieldId &) const
Get the table from the given field.
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.
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
void getData(AipsIO &os, uInt version, const TableAttr &)
Read the data of a record.
TableRecord()
Create a record with no fields.
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.
void putData(AipsIO &os, const TableAttr &) const
Put the data of a record.
String name(const RecordFieldId &) const
Get the name of this field.
virtual void defineDataField(Int whichField, DataType type, const void *value)
Define a value in the given field.
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.
this file contains all the compiler specific defines
virtual RecordDesc getDescription() const
Get the description of this record.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
friend AipsIO & operator>>(AipsIO &os, TableRecord &rec)
Read the TableRecord from an input stream.
virtual const String & comment(const RecordFieldId &) const
Get the comment for this field.
void setRecordType(RecordType type)
Set the recordtype of this record and all its subrecords (recursively).