34 #include <casacore/casa/aips.h>
35 #include <casacore/casa/Arrays/ArrayFwd.h>
36 #include <casacore/casa/Containers/RecordInterface.h>
37 #include <casacore/casa/Containers/RecordRep.h>
38 #include <casacore/casa/Containers/RecordDesc.h>
39 #include <casacore/casa/Utilities/COWPtr.h>
391 Int maxNrValues = 25,
392 const String& indent=
"")
const;
RecordType & recordType()
Give access to the RecordType flag (write-access is needed when a record is read back).
String name(const RecordFieldId &) const
Get the name of this field.
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
RecordType
Define the flag telling if a Record has a fixed or variable structure.
@ Variable
Record has a variable structure; after Record creation fields can be added or removed at will.
@ Fixed
Record has a fixed structure; that is, no fields can be added or removed once the Record is created.
Bool CheckFieldFunction(const String &fieldName, DataType dataType, const void *extraArgument, String &message)
Define the signature of the add callback function.
DuplicatesFlag
Define the Duplicates flag for the function merge in the various record classes.
@ ThrowOnDuplicates
Throw an exception.
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.
virtual RecordInterface & asrwRecord(const RecordFieldId &)
RecordRep * parent_p
The parent Record.
friend AipsIO & operator<<(AipsIO &os, const Record &rec)
Write the Record to an output stream.
virtual void makeUnique()
Make a unique record representation (to do copy-on-write in RecordFieldPtr).
void merge(const Record &other, DuplicatesFlag=ThrowOnDuplicates)
Merge all fields from the other record into this record.
friend AipsIO & operator>>(AipsIO &os, Record &rec)
Read the Record from an input stream.
void renameField(const String &newName, const RecordFieldId &)
Rename the given field.
RecordRep & rwRef()
Return a non-const reference to the underlying RecordRep.
virtual void defineRecord(const RecordFieldId &, const RecordInterface &value, RecordType=Variable)
Bool conform(const Record &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields.
virtual void setComment(const RecordFieldId &, const String &comment)
Set the comment for this field.
void defineRecord(const RecordFieldId &, const Record &value, RecordType type=Variable)
Define a value for the given field containing a subrecord.
virtual void * get_pointer(Int whichField, DataType type, const String &recordType) const
virtual ValueHolder asValueHolder(const RecordFieldId &) const
Get or define the value as a ValueHolder.
Record(const RecordDesc &description, RecordType type=Fixed, CheckFieldFunction *=0, const void *checkArgument=0)
Create a record with the given description.
virtual RecordInterface * clone() const
Make a copy of this object.
void getData(AipsIO &os, uInt version)
Read the data of a record.
virtual void defineFromValueHolder(const RecordFieldId &, const ValueHolder &)
void getRecord(AipsIO &os)
Read the Record from an input stream.
Record(const RecordInterface &other)
Create a Record from another type of record using copy semantics.
virtual void restructure(const RecordDesc &newDescription, Bool recursive=True)
Change the structure of this Record to contain the fields in newDescription.
void mergeField(const Record &other, const RecordFieldId &, DuplicatesFlag=ThrowOnDuplicates)
Merge a field from another record into this record.
Record(RecordRep *parent, RecordType type)
virtual void addDataField(const String &name, DataType type, const IPosition &shape, Bool fixedShape, const void *value)
Add a field to the record.
COWPtr< RecordRep > rep_p
The Record representation.
virtual uInt nfields() const
How many fields does this structure have? A convenient synonym for description().nfields().
virtual Int fieldNumber(const String &fieldName) const
Get the field number from the field name.
virtual ~Record()
Release resources associated with this object.
void removeField(const RecordFieldId &)
Remove a field from the record.
virtual const RecordInterface & asRecord(const RecordFieldId &) const
virtual DataType type(Int whichField) const
Get the data type of this field.
Record()
Create a record with no fields.
virtual void assign(const RecordInterface &that)
Assign that RecordInterface object to this one.
Record(RecordRep *parent, const RecordDesc &description)
Create Record as a subrecord.
virtual RecordDesc getDescription() const
Get the description of this record.
Record & rwSubRecord(const RecordFieldId &)
Record(RecordType type, CheckFieldFunction *=0, const void *checkArgument=0)
Create a record with no fields.
virtual void defineDataField(Int whichField, DataType type, const void *value)
Define a value in the given field.
virtual const String & comment(const RecordFieldId &) const
Get the comment for this field.
void putRecord(AipsIO &os) const
Write the Record to an output stream.
void putData(AipsIO &os) const
Put the data of a record.
const RecordDesc & description() const
Describes the current structure of this Record.
const Record & subRecord(const RecordFieldId &) const
Get the subrecord from the given field.
virtual void print(std::ostream &, Int maxNrValues=25, const String &indent="") const
Print the contents of the record.
const RecordRep & ref() const
Return a const reference to the underlying RecordRep.
virtual void * get_pointer(Int whichField, DataType type) const
Used by the RecordField classes to attach in a type-safe way to the correct field.
Record(const Record &other)
Create a copy of other using copy semantics.
Record & operator=(const Record &other)
Copy the data in the other record to this record.
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.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
AipsIO & operator>>(AipsIO &os, Record &rec)