|
static void | readScalar (hid_t attrId, hid_t dtid, const String &name, RecordInterface &rec) |
| Read a scalar value and add it to the record. More...
|
|
static void | readArray (hid_t attrId, hid_t dtid, const IPosition &, const String &name, RecordInterface &rec) |
| Read an array value and add it to the record. More...
|
|
static void | readScaString (hid_t attrId, Int sz, const String &name, RecordInterface &rec) |
| Read a scalar string from an attribute and add it to the record. More...
|
|
static void | readArrString (hid_t attrId, const IPosition &, const String &name, RecordInterface &rec) |
| Read a array of strings from an atrribute and add it to the record. More...
|
|
static void | readEmptyArray (hid_t attrId, const String &name, RecordInterface &rec) |
| Read a field containing an empty array. More...
|
|
template<typename T > |
static void | readSca (hid_t attrId, const String &name, RecordInterface &rec) |
| Read a field containing a scalar of fixed length. More...
|
|
template<typename T > |
static void | readArr (hid_t attrId, const IPosition &shape, const String &name, RecordInterface &rec) |
| Read a field containing an array of fixed length elements. More...
|
|
static void | read (hid_t attrId, void *value, const HDF5DataType &dtype) |
| Read fixed length values from an attribute (scalar and array). More...
|
|
static void | writeScalar (hid_t parentHid, const String &name, const void *value, const HDF5DataType &dtype) |
| Write a fixed length scalar value as attribute. More...
|
|
static void | writeArray (hid_t parentHid, const String &name, const void *value, const IPosition &shape, const HDF5DataType &dtype) |
| Write an array of fixed length values as attribute. More...
|
|
static void | writeScaString (hid_t parentHid, const String &name, const String &value) |
| Write a scalar string as attribute. More...
|
|
static void | writeArrString (hid_t parentHid, const String &name, const Array< String > &value) |
| Write an array of strings as attribute. More...
|
|
static void | writeEmptyArray (hid_t groupHid, const String &name, Int rank, DataType dtype) |
| Write a field containing an empty array. More...
|
|
template<typename T > |
static void | writeSca (hid_t parentHid, const String &name, const RecordInterface &rec, Int i) |
| Write a field containing a fixed length scalar value. More...
|
|
template<typename T > |
static void | writeArr (hid_t parentHid, const String &name, const RecordInterface &rec, Int i) |
| Write a field containing an array of fixed length elements. More...
|
|
A class to write/read a record into HDF5.
Intended use:
Public interface
Review Status
- Test programs:
- tHDF5Record
Prerequisite
Synopsis
This class has a static function to write a Record (or TableRecord) into an HDF5 file by storing it as attributes for the given group. Another static function can read back the Record. It can handle all types of fields in a record.
A few remarks:
-
When writing the record, it first deletes all attributes of the group to be sure that the group's attributes only contain the record.
-
A Casacore Record is a recursive structure, so it is written as nested groups. The name of a subgroup is the name of the subrecord.
-
HDF5 cannot deal with empty arrays. Therefore they are written as a special compound type holding the rank and type of the empty array.
-
HDF5 cannot hold empty fixed length strings. This is solved by storing an empty string with the special value
__empty__
.
Motivation
Record is a very important class in Casacore images, so it has to be possible to read and write them from/to HDF5.
Definition at line 77 of file HDF5Record.h.