Loading...
Searching...
No Matches
casacore::HDF5Object Class Referenceabstract
casa package (libcasa_casa) » HDF5_module

More...

`#include <HDF5Object.h>`

## Public Member Functions

| 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.
virtual void | close ()=0
| Close the hid if valid.
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 Bool | hasHDF5Support ()
| Check if there is HDF5 support compiled in.
static void | throwNoHDF5 ()
| If no HDF5, throw an exception that HDF5 is not supported.

## Protected Member Functions

void | setHid (hid_t hid)
| Set the hid.
void | clearHid ()
| Clear the hid (set to invalid).

## Private Attributes

union { |
hid_t itsHid |
int64_t itsDummyHid |
}; |
String | itsName

## Detailed Description

An abstract base class representing an HDF5 object

### Intended use:

Public interface

### Review Status

Test programs:
  tHDF5Dataset

### Synopsis

This class wraps a basic HDF5 object. It offers several benefits:

- The most important is resource management. In case of an exception, the object's hid will automatically be closed by the destructor.
- It acts as the base class for the basic objects file, group, and dataset.
- An HDF5 hid is a kind of pointer and should not be copied. These classes forbid making a copy, but make it possible to use them in a shared pointer context.

Definition at line 68 of file HDF5Object.h.

## Constructor & Destructor Documentation

## HDF5Object() [1/2]

casacore::HDF5Object::HDF5Object | ( |  | ) |

inline

Default constructor sets to invalid hid.

Definition at line 72 of file HDF5Object.h.

References itsHid.

Referenced by casacore::HDF5DataSet::create(), casacore::HDF5Group::exists(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5DataSet::HDF5DataSet(), casacore::HDF5Group::HDF5Group(), HDF5Object(), casacore::HDF5Group::linkNames(), casacore::HDF5DataSet::open(), operator=(), and casacore::HDF5Group::remove().

## ~HDF5Object()

virtual casacore::HDF5Object::~HDF5Object | ( |  | ) |

virtual

The destructor in a derived class should close the hid appropriately.

## HDF5Object() [2/2]

casacore::HDF5Object::HDF5Object | ( | const HDF5Object & |  | ) |

delete

Copy constructor cannot be used because a HID cannot be copied.

References HDF5Object().

## Member Function Documentation

## clearHid()

void casacore::HDF5Object::clearHid | ( |  | ) |

inline protected

Clear the hid (set to invalid).

Definition at line 120 of file HDF5Object.h.

References itsHid.

## close()

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

pure virtual

Close the hid if valid.

Implemented in casacore::HDF5DataSet, casacore::HDF5File, and casacore::HDF5Group.

## getHid()

hid_t casacore::HDF5Object::getHid | ( |  | ) | const

inline

Get the hid.

Definition at line 96 of file HDF5Object.h.

References itsHid.

Referenced by casacore::HDF5File::isClosed().

## getName()

const String & casacore::HDF5Object::getName | ( |  | ) | const

inline

Definition at line 107 of file HDF5Object.h.

References itsName.

Referenced by casacore::HDF5Group::HDF5Group().

## hasHDF5Support()

Bool casacore::HDF5Object::hasHDF5Support | ( |  | ) |

static

Check if there is HDF5 support compiled in.

Referenced by casacore::canUseHDF5Image().

## isValid()

bool casacore::HDF5Object::isValid | ( |  | ) | const

inline

Is it a valid hid?

Definition at line 92 of file HDF5Object.h.

References itsHid.

## operator hid_t()

casacore::HDF5Object::operator hid_t | ( |  | ) | const

inline

Convert automatically to hid_t.

Definition at line 100 of file HDF5Object.h.

References itsHid.

## operator=()

HDF5Object & casacore::HDF5Object::operator= | ( | const HDF5Object & |  | ) |

delete

Assignment cannot be used because a HID cannot be copied.

References HDF5Object().

## setHid()

void casacore::HDF5Object::setHid | ( | hid_t | hid | ) |

inline protected

Set the hid.

Definition at line 116 of file HDF5Object.h.

References itsHid.

## setName()

void casacore::HDF5Object::setName | ( | const String & | name | ) |

inline

Get or set the name.

Definition at line 105 of file HDF5Object.h.

References itsName, and casacore::name().

## throwNoHDF5()

void casacore::HDF5Object::throwNoHDF5 | ( |  | ) |

static

If no HDF5, throw an exception that HDF5 is not supported.

## Member Data Documentation

## [union]

union { ... } casacore::HDF5Object

## itsDummyHid

int64_t casacore::HDF5Object::itsDummyHid

Definition at line 129 of file HDF5Object.h.

## itsHid

hid_t casacore::HDF5Object::itsHid

Definition at line 128 of file HDF5Object.h.

Referenced by clearHid(), getHid(), HDF5Object(), isValid(), operator hid_t(), and setHid().

## itsName

String casacore::HDF5Object::itsName

private

Definition at line 131 of file HDF5Object.h.

Referenced by getName(), and setName().

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

- casa/HDF5/HDF5Object.h