casacore
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::HDF5DataType Class Reference

A class representing an HDF5 data type. More...

#include <HDF5DataType.h>

Public Member Functions

 HDF5DataType (const Bool *)
 Create an HDF5 datatype object for the given fixed length type. More...
 
 HDF5DataType (const uChar *)
 
 HDF5DataType (const Short *)
 
 HDF5DataType (const uShort *)
 
 HDF5DataType (const Int *)
 
 HDF5DataType (const uInt *)
 
 HDF5DataType (const Int64 *)
 
 HDF5DataType (const Float *)
 
 HDF5DataType (const Double *)
 
 HDF5DataType (const Complex *)
 
 HDF5DataType (const DComplex *)
 
 HDF5DataType (const String *)
 
 HDF5DataType (const String &value)
 Create an HDF5 datatype object for a scalar string. More...
 
 HDF5DataType (Int, Int)
 Create an HDF5 datatype object for an empty array. More...
 
 ~HDF5DataType ()
 The destructor closes the HDF5 data type object. More...
 
hid_t getHidMem () const
 Get the HID for the data type in memory. More...
 
hid_t getHidFile () const
 Get the HID for the data type in the file. More...
 
uInt size () const
 Get the size in bytes of the data type. More...
 

Static Public Member Functions

static DataType getDataType (hid_t)
 Get the Casacore data type for the given HDF5 data type. More...
 

Private Member Functions

 HDF5DataType (const HDF5DataType &that)
 Copy constructor cannot be used. More...
 
HDF5DataTypeoperator= (const HDF5DataType &that)
 Assignment cannot be used. More...
 

Private Attributes

hid_t itsHidMem
 
hid_t itsHidFile
 
uInt itsSize
 

Detailed Description

A class representing an HDF5 data type.

Intended use:

Internal

Review Status

Test programs:
tHDF5DataType

Prerequisite

Synopsis

This class wraps the HDF5 functions to create a data type. It creates a data type for the datas in memory and for the file.

Motivation

It was overkill to use the HDF5 C++ interface. Instead little wrappers have been written. HDF5DataType can be embedded in a shared pointer making it possible to share an HDF5 data type amongst various HDF5Array objects and close (i.e. destruct) the HDF5 data type object when needed.

Definition at line 65 of file HDF5DataType.h.

Constructor & Destructor Documentation

casacore::HDF5DataType::HDF5DataType ( const Bool )

Create an HDF5 datatype object for the given fixed length type.

It uses the corresponding native HDF5 data type. Only for Bool it uses a uchar, because the HDF5 bool type is a uint. For the complex types it makes a compound HDF5 data type. The String type is meant for an array of strings.

Referenced by size().

casacore::HDF5DataType::HDF5DataType ( const uChar )
casacore::HDF5DataType::HDF5DataType ( const Short )
casacore::HDF5DataType::HDF5DataType ( const uShort )
casacore::HDF5DataType::HDF5DataType ( const Int )
casacore::HDF5DataType::HDF5DataType ( const uInt )
casacore::HDF5DataType::HDF5DataType ( const Int64 )
casacore::HDF5DataType::HDF5DataType ( const Float )
casacore::HDF5DataType::HDF5DataType ( const Double )
casacore::HDF5DataType::HDF5DataType ( const Complex *  )
casacore::HDF5DataType::HDF5DataType ( const DComplex *  )
casacore::HDF5DataType::HDF5DataType ( const String )
casacore::HDF5DataType::HDF5DataType ( const String value)

Create an HDF5 datatype object for a scalar string.

The length of the string is part of the type.

casacore::HDF5DataType::HDF5DataType ( Int  ,
Int   
)

Create an HDF5 datatype object for an empty array.

casacore::HDF5DataType::~HDF5DataType ( )

The destructor closes the HDF5 data type object.

casacore::HDF5DataType::HDF5DataType ( const HDF5DataType that)
private

Copy constructor cannot be used.

Member Function Documentation

static DataType casacore::HDF5DataType::getDataType ( hid_t  )
static

Get the Casacore data type for the given HDF5 data type.

hid_t casacore::HDF5DataType::getHidFile ( ) const
inline

Get the HID for the data type in the file.

Definition at line 106 of file HDF5DataType.h.

References itsHidFile.

hid_t casacore::HDF5DataType::getHidMem ( ) const
inline

Get the HID for the data type in memory.

Definition at line 102 of file HDF5DataType.h.

References itsHidMem.

HDF5DataType& casacore::HDF5DataType::operator= ( const HDF5DataType that)
private

Assignment cannot be used.

Referenced by size().

uInt casacore::HDF5DataType::size ( ) const
inline

Get the size in bytes of the data type.

Note that the size of a string is variable, thus 0.

Definition at line 111 of file HDF5DataType.h.

References HDF5DataType(), itsSize, and operator=().

Member Data Documentation

hid_t casacore::HDF5DataType::itsHidFile
private

Definition at line 123 of file HDF5DataType.h.

Referenced by getHidFile().

hid_t casacore::HDF5DataType::itsHidMem
private

Definition at line 122 of file HDF5DataType.h.

Referenced by getHidMem().

uInt casacore::HDF5DataType::itsSize
private

Definition at line 124 of file HDF5DataType.h.

Referenced by size().


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