Logo Search packages:      
Sourcecode: jhdf version File versions  Download package

Datatype ncsa::hdf::object::h5::H5ScalarDS::getDatatype (  )  [inline, virtual]

Returns the datatype object of the dataset.

Returns:
the datatype object of the dataset.

Implements ncsa::hdf::object::Dataset.

Definition at line 1186 of file H5ScalarDS.java.

References ncsa::hdf::object::Dataset::datatype, isNativeDatatype, and open().

Referenced by test::unittests::H5ScalarDSTest::testGetDatatype().

    {
        if (datatype == null)
        {
            int did=-1, tid=-1;
            
            did = open();

            try {
                tid = H5.H5Dget_type(did);
                if (!isNativeDatatype) {
                    int tmptid = -1;
                    try {
                        tmptid = tid;
                        tid = H5.H5Tget_native_type(tmptid);
                    } finally {
                        try { H5.H5Tclose(tmptid); } catch (Exception ex2) {}
                    }
                }  
                datatype = new H5Datatype(tid);
            } catch (Exception ex) {} 
            finally {
                try {H5.H5Tclose(tid);} catch (HDF5Exception ex) {};
                try {H5.H5Dclose(did);} catch (HDF5Exception ex) {};
            }
        }

        return datatype;
    }


Generated by  Doxygen 1.6.0   Back to index