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