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>
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;
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.
const Record & subRecord(const RecordFieldId &) const
Get the subrecord from the given field.
RecordRep * parent_p
The parent Record.
void defineRecord(const RecordFieldId &, const RecordInterface &value, RecordType=Variable) override
const RecordInterface & asRecord(const RecordFieldId &) const override
void removeField(const RecordFieldId &) override
Remove a field from the record.
void merge(const Record &other, DuplicatesFlag=ThrowOnDuplicates)
Merge all fields from the other record into this record.
uInt nfields() const override
How many fields does this structure have? A convenient synonym for description().nfields().
void renameField(const String &newName, const RecordFieldId &)
Rename the given field.
RecordRep & rwRef()
Return a non-const reference to the underlying RecordRep.
RecordDesc getDescription() const override
Get the description of this record.
Bool conform(const Record &other) const
Returns True if this and other have the same RecordDesc, other than different names for the fields.
friend AipsIO & operator<<(AipsIO &os, const Record &rec)
Write the Record to an output stream.
void defineRecord(const RecordFieldId &, const Record &value, RecordType type=Variable)
Define a value for the given field containing a subrecord.
Record(const RecordDesc &description, RecordType type=Fixed, CheckFieldFunction *=0, const void *checkArgument=0)
Create a record with the given description.
void getData(AipsIO &os, uInt version)
Read the data of a record.
Record & rwSubRecord(const RecordFieldId &)
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.
void restructure(const RecordDesc &newDescription, Bool recursive=True) override
Change the structure of this Record to contain the fields in newDescription.
friend AipsIO & operator>>(AipsIO &os, Record &rec)
Read the Record from an input stream.
void mergeField(const Record &other, const RecordFieldId &, DuplicatesFlag=ThrowOnDuplicates)
Merge a field from another record into this record.
void defineFromValueHolder(const RecordFieldId &, const ValueHolder &) override
Record(RecordRep *parent, RecordType type)
RecordInterface * clone() const override
Make a copy of this object.
COWPtr< RecordRep > rep_p
The Record representation.
DataType type(Int whichField) const override
Get the data type of this field.
Record & operator=(const Record &other)
Copy the data in the other record to this record.
void print(std::ostream &, Int maxNrValues=25, const String &indent="") const override
Print the contents of the record.
Int fieldNumber(const String &fieldName) const override
Get the field number from the field name.
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.
void defineDataField(Int whichField, DataType type, const void *value) override
Define a value in the given field.
void * get_pointer(Int whichField, DataType type, const String &recordType) const override
const String & comment(const RecordFieldId &) const override
Get the comment for this field.
void addDataField(const String &name, DataType type, const IPosition &shape, Bool fixedShape, const void *value) override
Add a field to the record.
void makeUnique() override
Make a unique record representation (to do copy-on-write in RecordFieldPtr).
Record()
Create a record with no fields.
Record(RecordRep *parent, const RecordDesc &description)
Create Record as a subrecord.
ValueHolder asValueHolder(const RecordFieldId &) const override
Get or define the value as a ValueHolder.
~Record()
Release resources associated with this object.
RecordInterface & asrwRecord(const RecordFieldId &) override
Record(RecordType type, CheckFieldFunction *=0, const void *checkArgument=0)
Create a record with no fields.
void assign(const RecordInterface &that) override
Assign that RecordInterface object to this one.
void setComment(const RecordFieldId &, const String &comment) override
Set 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 RecordRep & ref() const
Return a const reference to the underlying RecordRep.
Record(const Record &other)
Create a copy of other using copy semantics.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
AipsIO & operator>>(AipsIO &os, Record &rec)
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
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.