Loading...
Searching...
No Matches
casacore::HDF5Group Class Reference
casa package (libcasa_casa) » HDF5_module

More...

`#include <HDF5Group.h>`

## Public Member Functions

| HDF5Group ()
| Construct from given hid.
| HDF5Group (const HDF5Object &parentHid, const String &name, bool mustExist=false, bool mustNotExist=false)
| Open or create a group at the given hid.
| HDF5Group (hid_t parentHid, const String &name, bool mustExist=false, bool mustNotExist=false)
virtual | ~HDF5Group ()
| The destructor closes the hid.
virtual void | close ()
| Close the hid if valid.
Public Member Functions inherited from casacore::HDF5Object
| HDF5Object ()
| Default constructor sets to invalid hid.
virtual | ~HDF5Object ()
| The destructor in a derived class should close the hid appropriately.
| HDF5Object (const HDF5Object &)=delete
| Copy constructor cannot be used because a HID cannot be copied.
HDF5Object & | operator= (const HDF5Object &)=delete
| Assignment cannot be used because a HID cannot be copied.
bool | isValid () const
| Is it a valid hid?
hid_t | getHid () const
| Get the hid.
| operator hid_t () const
| Convert automatically to hid_t.
void | setName (const String &name)
| Get or set the name.
const String & | getName () const

## Static Public Member Functions

static std::vector< String > | linkNames (const HDF5Object &parentHid)
| Get the names of all links at the given hid.
static bool | exists (const HDF5Object &parentHid, const String &name)
| Test if the group at the given hid exists.
static void | remove (const HDF5Object &parentHid, const String &name)
| Delete group at the given hid if it exists.
Static Public Member Functions inherited from casacore::HDF5Object
static Bool | hasHDF5Support ()
| Check if there is HDF5 support compiled in.
static void | throwNoHDF5 ()
| If no HDF5, throw an exception that HDF5 is not supported.

## Private Member Functions

| HDF5Group (const HDF5Group &that)
| Copy constructor cannot be used.
HDF5Group & | operator= (const HDF5Group &that)
| Assignment cannot be used.
void | init (hid_t parentHid, const String &parentName, const String &name, bool mustExist=false, bool mustNotExist=false)
| Initialize (execute the constructor).

## Additional Inherited Members

Protected Member Functions inherited from casacore::HDF5Object
void | setHid (hid_t hid)
| Set the hid.
void | clearHid ()
| Clear the hid (set to invalid).

## Detailed Description

A class representing an HDF5 group.

### Intended use:

Public interface

### Review Status

Test programs:
  tHDF5Dataset

### Synopsis

This class wraps an HDF5 group hid (hdf5 id). It offers two benefits:

- The most important is resource management. In case of an exception, the hid will automatically be closed by the destructor.
- A hid is a kind of pointer and should not be copied. These classes make it possible to use them in a shared pointer.

Definition at line 52 of file HDF5Group.h.

## Constructor & Destructor Documentation

## HDF5Group() [1/4]

casacore::HDF5Group::HDF5Group | ( |  | ) |

inline

Construct from given hid.

Definition at line 56 of file HDF5Group.h.

Referenced by HDF5Group(), and operator=().

## HDF5Group() [2/4]

casacore::HDF5Group::HDF5Group | ( | const HDF5Object & | parentHid,
|  | const String & | name,
|  | bool | mustExist = false,
|  | bool | mustNotExist = false )

inline

Open or create a group at the given hid.

Default is that the group may exist; it is created if not existing.

Definition at line 62 of file HDF5Group.h.

References casacore::HDF5Object::getName(), casacore::HDF5Object::HDF5Object(), casacore::init(), and casacore::name().

## HDF5Group() [3/4]

casacore::HDF5Group::HDF5Group | ( | hid_t | parentHid,
|  | const String & | name,
|  | bool | mustExist = false,
|  | bool | mustNotExist = false )

inline

Definition at line 66 of file HDF5Group.h.

References casacore::init(), and casacore::name().

## ~HDF5Group()

virtual casacore::HDF5Group::~HDF5Group | ( |  | ) |

virtual

The destructor closes the hid.

## HDF5Group() [4/4]

casacore::HDF5Group::HDF5Group | ( | const HDF5Group & | that | ) |

private

Copy constructor cannot be used.

References HDF5Group().

## Member Function Documentation

## close()

virtual void casacore::HDF5Group::close | ( |  | ) |

virtual

Close the hid if valid.

Implements casacore::HDF5Object.

## exists()

bool casacore::HDF5Group::exists | ( | const HDF5Object & | parentHid,
|  | const String & | name )

static

Test if the group at the given hid exists.

References casacore::HDF5Object::HDF5Object(), and casacore::name().

## init()

void casacore::HDF5Group::init | ( | hid_t | parentHid,
|  | const String & | parentName,
|  | const String & | name,
|  | bool | mustExist = false,
|  | bool | mustNotExist = false )

private

Initialize (execute the constructor).

References casacore::name().

## linkNames()

std::vector< String > casacore::HDF5Group::linkNames | ( | const HDF5Object & | parentHid | ) |

static

Get the names of all links at the given hid.

References casacore::HDF5Object::HDF5Object().

## operator=()

HDF5Group & casacore::HDF5Group::operator= | ( | const HDF5Group & | that | ) |

private

Assignment cannot be used.

References HDF5Group().

## remove()

void casacore::HDF5Group::remove | ( | const HDF5Object & | parentHid,
|  | const String & | name )

static

Delete group at the given hid if it exists.

References casacore::HDF5Object::HDF5Object(), and casacore::name().

The documentation for this class was generated from the following file:

- casa/HDF5/HDF5Group.h