27#ifndef CASA_RECORDREP_H
28#define CASA_RECORDREP_H
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Containers/Block.h>
33#include <casacore/casa/Containers/RecordDesc.h>
34#include <casacore/casa/Containers/RecordInterface.h>
165 RecordInterface::RecordType
type);
203 RecordInterface::DuplicatesFlag);
213 Int maxNrValues = 25,
214 const String& indent=
"")
const;
265 const void* ptr)
const;
312 return desc_p.comment (whichField);
322 desc_p.renameField (newName, whichField);
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.
RecordRep & operator=(const RecordRep &other)
Copy all the data over.
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 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)
virtual void removeFieldFromDesc(Int whichField)
Remove a field from the description.
void * get_pointer(Int whichField, DataType type, const String &recordType) const
void * get_pointer(Int whichField, DataType type) const
Used by the RecordFieldPtr classes to attach in a type-safe way to the correct field.
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 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 * createDataField(DataType type, const IPosition &shape)
Create a data field for the given type and shape.
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
uInt nfields() const override
How many fields does this structure have?
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
String name() const
Return the name of the field.
RecordType & recordType()
Give access to the RecordType flag (write-access is needed when a record is read back).
bool Bool
Define the standard types used by Casacore.
NewDelAllocator< T > NewDelAllocator< T >::value
const String & comment() const
Get the comment of this field.