casa
5.7.0-16
|
A class to write/read a record into HDF5. More...
#include <HDF5Record.h>
Static Public Member Functions | |
static Record | readRecord (const HDF5Object &parentHid, const String &groupName) |
Read a record from the attributes of the given group. More... | |
static void | writeRecord (const HDF5Object &parentHid, const String &recordName, const RecordInterface &rec) |
Write the record as attributes of a group of the given parent. More... | |
static void | remove (const HDF5Object &parentHid, const String &recordName) |
Remove the record (i.e. More... | |
static Record | doReadRecord (hid_t parentHid) |
Read the (possibly nested) record values from the given group hid. More... | |
static void | doWriteRecord (const HDF5Object &groupHid, const RecordInterface &rec) |
Write the (possibly nested) record values into the given group hid. More... | |
Static Private Member Functions | |
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.
Public interface
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:
__empty__
. 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.
Read the (possibly nested) record values from the given group hid.
|
static |
Write the (possibly nested) record values into the given group hid.
|
staticprivate |
|
inlinestaticprivate |
Read a field containing an array of fixed length elements.
Definition at line 139 of file HDF5Record.h.
References casacore::Array< T >::data(), casacore::RecordInterface::define(), read(), and casacore::value().
|
staticprivate |
Read an array value and add it to the record.
|
staticprivate |
Read a array of strings from an atrribute and add it to the record.
|
staticprivate |
Read a field containing an empty array.
|
static |
Read a record from the attributes of the given group.
Nested records are read back correctly. An empty record is returned if the group does not exist.
|
inlinestaticprivate |
Read a field containing a scalar of fixed length.
Definition at line 128 of file HDF5Record.h.
References casacore::RecordInterface::define(), read(), and casacore::value().
|
staticprivate |
Read a scalar value and add it to the record.
|
staticprivate |
Read a scalar string from an attribute and add it to the record.
|
static |
Remove the record (i.e.
group) from the given parent. Nothing is done if the record does not exist.
|
inlinestaticprivate |
Write a field containing an array of fixed length elements.
Definition at line 192 of file HDF5Record.h.
References casacore::Array< T >::data(), casacore::RecordInterface::get(), casacore::ArrayBase::shape(), casacore::value(), and writeArray().
|
staticprivate |
Write an array of fixed length values as attribute.
Referenced by writeArr().
|
staticprivate |
Write an array of strings as attribute.
HDF5 cannot handle empty strings, so for empty strings a special value is written.
|
staticprivate |
Write a field containing an empty array.
|
static |
Write the record as attributes of a group of the given parent.
Nested records are written as nested groups. The group is deleted first if it already exists.
|
inlinestaticprivate |
Write a field containing a fixed length scalar value.
Definition at line 181 of file HDF5Record.h.
References casacore::RecordInterface::get(), casacore::value(), and writeScalar().
|
staticprivate |
Write a fixed length scalar value as attribute.
Referenced by writeSca().
|
staticprivate |
Write a scalar string as attribute.
HDF5 cannot handle empty strings, so for empty strings a special value is written.