31#include <casacore/casa/aips.h>
32#include <casacore/casa/Arrays/ArrayFwd.h>
33#include <casacore/casa/Containers/RecordInterface.h>
34#include <casacore/casa/Containers/RecordRep.h>
35#include <casacore/casa/Containers/RecordDesc.h>
36#include <casacore/casa/Utilities/COWPtr.h>
179friend class RecordRep;
293 DataType
type (
Int whichField)
const override;
388 Int maxNrValues = 25,
389 const String& indent=
"")
const override;
412 const void*
value)
override;
416 const void*
value)
override;
438inline const RecordRep& Record::ref()
const
442inline const RecordDesc& Record::description()
const
447inline Bool Record::conform (
const Record& other)
const
457inline void Record::putData (AipsIO& os)
const
467inline void Record::getData (AipsIO& os,
uInt version)
Bool conform(const RecordRep &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields.
const RecordDesc & description() const
Describes the current structure of this Record.
void getData(AipsIO &os, uInt version)
Read the data of a record.
void putData(AipsIO &os) const
Put the data of a record.
String: the storage and methods of handling collections of characters.
@ Fixed
Record has a fixed structure; that is, no fields can be added or removed once the Record is created.
@ Variable
Record has a variable structure; after Record creation fields can be added or removed at will.
this file contains all the compiler specific defines
void assign(const RecordInterface &that) override
Assign that RecordInterface object to this one.
DataType type(Int whichField) const override
Get the data type of this field.
RecordInterface & asrwRecord(const RecordFieldId &) override
const RecordRep & ref() const
Return a const reference to the underlying RecordRep.
void defineDataField(Int whichField, DataType type, const void *value) override
Define a value in the given field.
friend AipsIO & operator>>(AipsIO &os, Record &rec)
Read the Record from an input stream.
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
void defineRecord(const RecordFieldId &, const Record &value, RecordType type=Variable)
Define a value for the given field containing a subrecord.
const RecordDesc & description() const
Describes the current structure of this Record.
void print(std::ostream &, Int maxNrValues=25, const String &indent="") const override
Print the contents of the record.
void defineFromValueHolder(const RecordFieldId &, const ValueHolder &) override
void removeField(const RecordFieldId &) override
Remove a field from the record.
void * get_pointer(Int whichField, DataType type) const override
Used by the RecordField classes to attach in a type-safe way to the correct field.
uInt nfields() const override
How many fields does this structure have?
COWPtr< RecordRep > rep_p
The Record representation.
void addDataField(const String &name, DataType type, const IPosition &shape, Bool fixedShape, const void *value) override
Add a field to the record.
ValueHolder asValueHolder(const RecordFieldId &) const override
Get or define the value as a ValueHolder.
Bool CheckFieldFunction(const String &fieldName, DataType dataType, const void *extraArgument, String &message)
Define the signature of the add callback function.
void putRecord(AipsIO &os) const
Write the Record to an output stream.
void setComment(const RecordFieldId &, const String &comment) override
Set the comment for this field.
DuplicatesFlag
Define the Duplicates flag for the function merge in the various record classes.
@ ThrowOnDuplicates
Throw an exception.
Int fieldNumber() const
Return the fieldnumber of this field.
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
String name() const
Return the name of the field.
const Record & subRecord(const RecordFieldId &) const
Get the subrecord from the given field.
const String & comment(const RecordFieldId &) const override
Get the comment for this field.
RecordType & recordType()
Give access to the RecordType flag (write-access is needed when a record is read back).
void putData(AipsIO &os) const
Put the data of a record.
RecordRep & rwRef()
Return a non-const reference to the underlying RecordRep.
Bool conform(const Record &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields.
Record & operator=(const Record &other)
Copy the data in the other record to this record.
Record & rwSubRecord(const RecordFieldId &)
const RecordInterface & asRecord(const RecordFieldId &) const override
RecordInterface()
The default constructor creates an empty record with a variable structure.
bool Bool
Define the standard types used by Casacore.
void mergeField(const Record &other, const RecordFieldId &, DuplicatesFlag=ThrowOnDuplicates)
Merge a field from another record into this record.
void getData(AipsIO &os, uInt version)
Read the data of a record.
RecordDesc getDescription() const override
Get the description of this record.
~Record()
Release resources associated with this object.
void renameField(const String &newName, const RecordFieldId &)
Rename the given field.
NewDelAllocator< T > NewDelAllocator< T >::value
void getRecord(AipsIO &os)
Read the Record from an input stream.
void makeUnique() override
Make a unique record representation (to do copy-on-write in RecordFieldPtr).
const String & comment() const
Get the comment of this field.
RecordInterface * clone() const override
Make a copy of this object.
void merge(const Record &other, DuplicatesFlag=ThrowOnDuplicates)
Merge all fields from the other record into this record.
void restructure(const RecordDesc &newDescription, Bool recursive=True) override
Change the structure of this Record to contain the fields in newDescription.
RecordRep * parent_p
The parent Record.