casacore
|
#include <ImageAttrHandlerHDF5.h>
Public Member Functions | |
ImageAttrHandlerHDF5 () | |
Default construct from the image table. More... | |
ImageAttrHandlerHDF5 & | attachTable (const Table &image, Bool createHandler=False) |
Attach the table and return this object. More... | |
virtual | ~ImageAttrHandlerHDF5 () |
ImageAttrHandlerHDF5 & | attachHid (const HDF5Object &hid, Bool createHandler, Bool isWritable) |
Attach the hid and return this object. More... | |
virtual void | flush () |
Flush the attibrutes if needed. More... | |
virtual Bool | hasGroup (const String &name) |
Test if the given attribute group is present. More... | |
virtual Vector< String > | groupNames () const |
Get all attribute group names. More... | |
virtual ImageAttrGroup & | openGroup (const String &groupName) |
Get access to a group. More... | |
virtual ImageAttrGroup & | createGroup (const String &groupName) |
Create an attribute group with the given name. More... | |
virtual void | closeGroup (const String &groupName) |
Close the group with the given name. More... | |
Public Member Functions inherited from casacore::ImageAttrHandler | |
ImageAttrHandler () | |
Default constructor. More... | |
virtual | ~ImageAttrHandler () |
Private Attributes | |
Bool | itsCanWrite |
CountedPtr< HDF5Group > | itsGroup |
std::map< String, ImageAttrGroupHDF5 > | itsGroupMap |
Abstract base class for an image attributes handler.
Public interface
This class makes it possible to store extra attributes with an image to describe atrbitrary meta information.
For LOFAR it was needed to store extra meta information and to be able to convert it from casacore table format to HDF5 format and vice-versa. Furthermore, it must be possible to access the information in a way that arbitrary info can be stored and retrieved.
The attributes are divided into handlers. Each handler can reside in a subtable of the image or in a handler in HDF5. All attributes in a handler have the same number of values, where each value can be a scalar or (small) array. It is possible to define units and measure info for an attribute.
This example shows how to get attributes from an image. make it known to the image.
LOFAR needed functionality to store arbitrary attributes.
Definition at line 89 of file ImageAttrHandlerHDF5.h.
casacore::ImageAttrHandlerHDF5::ImageAttrHandlerHDF5 | ( | ) |
Default construct from the image table.
|
virtual |
ImageAttrHandlerHDF5& casacore::ImageAttrHandlerHDF5::attachHid | ( | const HDF5Object & | hid, |
Bool | createHandler, | ||
Bool | isWritable | ||
) |
Attach the hid and return this object.
It looks for the group ATTRGROUPS which contains groups defining the attribute groups. If the group does not exist, it will be added if createHandler
is set. Otherwise the handler is an empty one and no groups can be added to it.
ImageAttrHandlerHDF5& casacore::ImageAttrHandlerHDF5::attachTable | ( | const Table & | image, |
Bool | createHandler = False |
||
) |
Attach the table and return this object.
It looks for the table keyword ATTRGROUPS which contains the subtables defining the attribute groups. If the keyword does not exist, it will be added if createHandler
is set. Otherwise the handler is an empty one and no groups can be added to it.
|
virtual |
Close the group with the given name.
It will flush its attributes. Nothing is done if it is not open.
Reimplemented from casacore::ImageAttrHandler.
|
virtual |
Create an attribute group with the given name.
Reimplemented from casacore::ImageAttrHandler.
|
virtual |
Flush the attibrutes if needed.
Reimplemented from casacore::ImageAttrHandler.
Get all attribute group names.
Reimplemented from casacore::ImageAttrHandler.
Test if the given attribute group is present.
Reimplemented from casacore::ImageAttrHandler.
|
virtual |
Get access to a group.
Reimplemented from casacore::ImageAttrHandler.
|
private |
Definition at line 136 of file ImageAttrHandlerHDF5.h.
|
private |
Definition at line 137 of file ImageAttrHandlerHDF5.h.
|
private |
Definition at line 138 of file ImageAttrHandlerHDF5.h.