Example #1
0
// copyDatatype should be called by any function wishing to return
// an existing Datatype from a Dataset or Attribute.
func copyDatatype(id C.hid_t) (*Datatype, error) {
	hid := C.H5Tcopy(id)
	if err := checkID(hid); err != nil {
		return nil, err
	}
	return NewDatatype(hid), nil
}
Example #2
0
// copyDatatype should be called by any function wishing to return
// an existing Datatype from a Dataset or Attribute.
func copyDatatype(id C.hid_t) (*Datatype, error) {
	hid := C.H5Tcopy(id)
	err := h5err(C.herr_t(int(hid)))
	if err != nil {
		return nil, err
	}
	return NewDatatype(hid), nil
}
Example #3
0
// Copies an existing datatype.
// hid_t H5Tcopy( hid_t dtype_id )
func (t *DataType) Copy() (*DataType, error) {
	hid := C.H5Tcopy(t.id)
	err := togo_err(C.herr_t(int(hid)))
	if err != nil {
		return nil, err
	}
	o := new_dtype(hid, t.rt)
	return o, err
}
Example #4
0
File: h5t.go Project: pauh/go-hdf5
// Copies an existing datatype.
func (t *Datatype) Copy() (*Datatype, error) {
	hid := C.H5Tcopy(t.id)
	err := h5err(C.herr_t(int(hid)))
	if err != nil {
		return nil, err
	}
	o := NewDatatype(hid, t.rt)
	return o, err
}