Validity H5 objects if parameters are temporaries.

Hi,

I placed the configuration of dataset creation properties to a
separate method (see example below).
hsize_t chunk_dims[2] is a temporary which cases to exist when the
method is completed.

I use chunk_dims to set the chunk dimension.
H5Pset_chunk(dscreateProperties_, RANK_, chunk_dims );

Is this OK that chunk_dims is a temporary or should chunk_dims exist
until I call H5Pclose(dscreateProperties_)?

hid_t dscreateProperties_ ; //member variable of class;
hid_t ConfigDataSetCreateProp()
{
        //std::cerr << e.getFuncName();
        if(dscreateProperties_ < 0 )
        {
          dscreateProperties_ = H5Pcreate(H5P_DATASET_CREATE);
          hsize_t chunk_dims[ 2 ] = { 1024 , 1024 };
          H5Pset_chunk(dscreateProperties_, RANK_, chunk_dims );
          H5Pset_szip(dscreateProperties_, H5_SZIP_NN_OPTION_MASK , 16 )
            int fill_val = 0;
          H5Pset_fill_value(dscreateProperties_, H5T_NATIVE_INT, &fill_val);
          return dscreateProperties_;
        }
                               return dscreateProperties_;
}

regards
Eryk

···

--
Witold Eryk Wolski

Heidmark str 5
D-28329 Bremen
tel.: 04215261837

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Hi Eryk,

Hi,

I placed the configuration of dataset creation properties to a
separate method (see example below).
hsize_t chunk_dims[2] is a temporary which cases to exist when the
method is completed.

I use chunk_dims to set the chunk dimension.
H5Pset_chunk(dscreateProperties_, RANK_, chunk_dims );

Is this OK that chunk_dims is a temporary or should chunk_dims exist
until I call H5Pclose(dscreateProperties_)?

  Yes, this is fine - the property list makes a copy of any parameters set for a property.

  Quincey

···

On Jul 2, 2009, at 5:07 AM, W Eryk Wolski wrote:

hid_t dscreateProperties_ ; //member variable of class;
hid_t ConfigDataSetCreateProp()
{
        //std::cerr << e.getFuncName();
        if(dscreateProperties_ < 0 )
        {
          dscreateProperties_ = H5Pcreate(H5P_DATASET_CREATE);
          hsize_t chunk_dims[ 2 ] = { 1024 , 1024 };
          H5Pset_chunk(dscreateProperties_, RANK_, chunk_dims );
          H5Pset_szip(dscreateProperties_, H5_SZIP_NN_OPTION_MASK , 16 )
            int fill_val = 0;
          H5Pset_fill_value(dscreateProperties_, H5T_NATIVE_INT, &fill_val);
          return dscreateProperties_;
        }
                              return dscreateProperties_;
}

regards
Eryk
--
Witold Eryk Wolski

Heidmark str 5
D-28329 Bremen
tel.: 04215261837

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.