30 #ifndef CASA_RECORDDESCREP_H
31 #define CASA_RECORDDESCREP_H
141 int duplicateAction);
161 DataType
type (
Int whichField)
const;
235 Bool& equalDataTypes)
const;
304 return DataType(
types_p[whichField]);
324 return isScalarFun (DataType(
types_p[whichField]));
329 return (
types_p[whichField] == TpRecord);
334 return (
types_p[whichField] == TpTable);
void addFieldAny(DataType scalarOrArrayType)
Add the field info.
A Vector of integers, for indexing into Array<T> objects.
void addFieldArray(DataType scalarOrArrayType, const IPosition &shape)
uInt n_p
Number of fields in the description.
uInt merge(const RecordDescRep &other, int duplicateAction)
Add all the fields from another RecordDescRep to the current objects.
Bool isSubset(const RecordDescRep &other, Bool &equalDataTypes) const
Test if this description is a subset of another one.
Bool isEqual(const RecordDescRep &other, Bool &equalDataTypes) const
Test if this description equals another one.
const IPosition & shape(Int whichField) const
What is the shape of the given field.
Block< IPosition > shapes_p
The shape of the field [1] for scalars and sub-records.
virtual uInt removeField(Int whichField)
Remove the given field from the description.
const String & name(Int whichField) const
What is the name of the given field.
Block< String > tableDescNames_p
Table description name for table fields.
Bool conform(const RecordDescRep &other) const
Test if this description conforms the other.
Bool isSubRecord(Int whichField) const
Returns True if whichField is a sub-record.
Representation of a RecordDesc.
Block< Bool > is_array_p
True if the corresponding field is an array.
std::map< String, Int > name_map_p
Mapping of field name to field number.
PtrBlock< RecordDesc * > sub_records_p
The description of the subrecords.
Int fieldNumber(const String &fieldName) const
Returns the index of the field named fieldName.
Bool isTable(Int whichField) const
Returns True if whichField is a table.
RecordDescRep()
Create a description with no fields.
void setShape(Int whichField, const IPosition &shape)
Set the shape for this field.
uInt addRecord(const String &fieldName, const RecordDesc &subDesc)
Add a Record field to the description.
Block< String > comments_p
Comments for each field.
Block< Int > types_p
The DataType of each field.
Bool operator==(const RecordDescRep &other) const
This and other compare equal if the field types and shapes are identical (recursively if there are de...
DataType type(Int whichField) const
What is the type of the given field.
const RecordDesc & subRecord(Int whichField) const
If whichField is a sub-record return its description.
Bool isScalar(Int whichField) const
Returns True if whichField is a scalar.
Description of the fields in a record object.
uInt nfields() const
Number of fields in the description.
bool Bool
Define the standard types used by Casacore.
A drop-in replacement for Block<T*>.
Bool isDisjoint(const RecordDescRep &other) const
Test if the set of field names in this and other record description is disjoint (i.e.
virtual void increment_length()
Helper functions.
void copy_other(const RecordDescRep &other)
String makeName(Int whichField) const
Create a name for a field defined by index as *i (similar to glish).
String: the storage and methods of handling collections of characters.
void addFieldName(const String &fieldName, DataType type)
Add a field name and its type.
Bool operator!=(const RecordDescRep &other) const
uInt addArray(const String &fieldName, DataType scalarOrArrayType, const IPosition &shape)
Add an array field of the indicated type.
String uniqueName(const String &name) const
Make the given name unique by adding a suffix _j when needed.
Bool isStrictSubset(const RecordDescRep &other, Bool &equalDataTypes) const
Test if this description is a strict subset of another one, thus if it is a subset and not equal...
const RecordDesc & subRecord(Int whichField) const
If whichField is a sub-record with a description, return its description.
Block< String > names_p
The name of each field.
RecordDescRep & operator=(const RecordDescRep &other)
Replace this description with other.
const String & comment(Int whichField) const
Get the comment for this field.
Bool isArray(Int whichField) const
Returns True if whichField is an array.
Bool allExist(const RecordDescRep &, Bool &equalDataTypes) const
Test if all fields are part of the other description.
const String & tableDescName(Int whichField) const
What is the name of the table description associated with a table.
virtual void renameField(const String &newName, Int whichField)
Rename the given field.
void setComment(Int whichField, const String &comment)
Set the comment for this field.
uInt mergeField(const RecordDescRep &other, Int whichFieldFromOther, int duplicateAction)
Merge a single field from other.
uInt addTable(const String &fieldName, const String &tableDescName)
Add a Table field to the description.
uInt addField(const String &fieldName, DataType scalarOrArrayType)
Add scalar or array field.
virtual void addRepField(const RecordDescRep &other, const String &newName, Int whichField)
Add a field from another Record description.