30 #ifndef CASA_RECORDREP_H
31 #define CASA_RECORDREP_H
34 #include <casacore/casa/aips.h>
35 #include <casacore/casa/Containers/Block.h>
36 #include <casacore/casa/Containers/RecordDesc.h>
37 #include <casacore/casa/Containers/RecordInterface.h>
201 const String& recordType)
const;
216 Int maxNrValues = 25,
217 const String& indent=
"")
const;
268 const void* ptr)
const;
void renameField(const String &newName, Int whichField)
Rename the given field.
const String & comment(Int whichField) const
Get the comment for this field.
void setComment(Int whichField, const String &comment)
Set the comment for this field.
RecordType
Define the flag telling if a Record has a fixed or variable structure.
DuplicatesFlag
Define the Duplicates flag for the function merge in the various record classes.
void merge(const RecordRep &other, RecordInterface::DuplicatesFlag)
Merge all fields from the other record into this record.
Block< void * > datavec_p
Pointers to a vector of a scalar (to access a scalar as an array).
void getRecord(AipsIO &os, Int &recordType)
Get the description and data of the Record.
void delete_myself(uInt nfields)
Utility functions to avoid code duplication in the public member functions.
void deleteDataField(DataType type, void *ptr, void *vecptr)
Delete a data field.
void copyDataField(DataType type, void *ptr, const void *that) const
Copy a data field.
void renameField(const String &newName, Int whichField)
Rename the given field.
void printDataField(std::ostream &os, DataType type, const String &indent, Int maxNrValues, const void *ptr) const
Print a data field.
void copyDataField(DataType type, Int whichField, const void *that) const
Copy a data field.
Bool conform(const RecordRep &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields.
virtual ~RecordRep()
Delete all data.
void addField(const String &name, const Record &value, RecordInterface::RecordType type)
void print(std::ostream &, Int maxNrValues=25, const String &indent="") const
Print a record.
void defineDataField(Int whichField, DataType type, const void *value)
Define a value for the given field.
void putDataField(AipsIO &os, DataType type, const void *ptr) const
Put a data field.
void removeDataPtr(Int index)
Remove a data pointer add the given index.
void getDataField(AipsIO &os, DataType type, void *ptr)
Get a data field.
void * createDataField(DataType type, const IPosition &shape)
Create a data field for the given type and shape.
void mergeField(const RecordRep &other, Int whichFieldFromOther, RecordInterface::DuplicatesFlag)
Merge a field from another record into this record.
const RecordDesc & description() const
Describes the current structure of this Record.
void getScalarKeys(AipsIO &os)
Get the scalar values of a keyword set.
void removeField(Int whichField)
Remove a field from the record.
RecordRep()
Create a record with no fields.
void getArrayKeys(AipsIO &os)
Get the array values of a keyword set.
void checkShape(DataType type, const IPosition &shape, const void *value, const String &fieldName)
Check if the shape of the data array matches the shape of a fixed-shaped array in the description.
void makeDataVec(Int whichField, DataType type)
Make an array for a scalar data field.
void copy_other(const RecordRep &other)
RecordRep & operator=(const RecordRep &other)
Copy all the data over.
virtual void removeFieldFromDesc(Int whichField)
Remove a field from the description.
const String & comment(Int whichField) const
Get the comment for this field.
void getData(AipsIO &os, uInt version)
Read the data of a record.
RecordRep(const RecordRep &other)
Create a copy of other using copy semantics.
void copyData(const RecordRep &other)
Copy all data of the Record.
void restructure(const RecordDesc &newDescription, Bool recursive)
Change the structure of this Record to contain the fields in newDescription.
virtual Int fieldNumber(const String &name) const
Get the field number for a given name.
void getKeyDesc(AipsIO &os, RecordDesc &desc)
Get the description of a keyword set as a RecordDesc.
void * get_pointer(Int whichField, DataType type) const
Used by the RecordFieldPtr classes to attach in a type-safe way to the correct field.
void putRecord(AipsIO &os, int recordType) const
Put the description and data of the Record.
Block< void * > data_p
Pointers to data values.
void setComment(Int whichField, const String &comment)
Set the comment for this field.
RecordDesc desc_p
Holds the structure of this Record.
void addDataPtr(void *ptr)
Add the data pointer to the data block.
void addDataField(const String &name, DataType type, const IPosition &shape, Bool fixedShape, const void *data)
Add a field with the given name and value to the record.
uInt nused_p
#Entries used in data_p.
void getKeySet(AipsIO &os, uInt version, uInt type)
Get a Scalar/ArrayKeywordSet object as a Record.
virtual void addFieldToDesc(const String &name, DataType type, const IPosition &shape, Bool fixedShape)
Add a field to the description.
void * get_pointer(Int whichField, DataType type, const String &recordType) const
virtual void removeData(Int whichField, void *ptr, void *vecptr)
Remove a data field.
void putData(AipsIO &os) const
Put the data of a record.
RecordRep(const RecordDesc &description)
Create a record with the given description.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.