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