summaryrefslogtreecommitdiffstats
path: root/c++/examples/h5tutr_extend.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2013-09-24 02:12:40 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2013-09-24 02:12:40 (GMT)
commit91df66782ea03416f4dae1a8171ede49fb016725 (patch)
treec8486e06ed06240e9f548d360903d6337151a8c6 /c++/examples/h5tutr_extend.cpp
parentab239810e1ae81f390a91dfbb3e5d68934efee55 (diff)
downloadhdf5-91df66782ea03416f4dae1a8171ede49fb016725.zip
hdf5-91df66782ea03416f4dae1a8171ede49fb016725.tar.gz
hdf5-91df66782ea03416f4dae1a8171ede49fb016725.tar.bz2
[svn-r24195] Description:
- Improved format/comments in tutorial examples - Added them to Makefile.* and run-c++-ex.sh.in Platforms tested: Linux/32 2.6 (jam) Linux/64 2.6 (koala)/PGI compilers
Diffstat (limited to 'c++/examples/h5tutr_extend.cpp')
-rw-r--r--c++/examples/h5tutr_extend.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp
index 6437fb8..c3a18d7 100644
--- a/c++/examples/h5tutr_extend.cpp
+++ b/c++/examples/h5tutr_extend.cpp
@@ -36,21 +36,19 @@ const H5std_string DATASETNAME("ExtendibleArray");
int main (void)
{
-
- hsize_t dims[2] = {3,3}; // dataset dimensions at creation
- hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
- hsize_t chunk_dims[2] ={2, 5};
-
+ hsize_t dims[2] = {3,3}; // dataset dimensions at creation
+ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] ={2, 5};
int data[3][3] = { {1, 1, 1}, // data to write
{1, 1, 1},
{1, 1, 1} };
// Variables used in extending and writing to the extended portion of dataset
- hsize_t size[2];
- hsize_t offset[2];
- hsize_t dimsext[2] = {7, 3}; // extend dimensions
- int dataext[7][3] = { {2, 3, 4},
+ hsize_t size[2];
+ hsize_t offset[2];
+ hsize_t dimsext[2] = {7, 3}; // extend dimensions
+ int dataext[7][3] = { {2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
@@ -118,13 +116,15 @@ int main (void)
int i,j, rank, rank_chunk;
hsize_t chunk_dimsr[2], dimsr[2];
+ // Open the file and dataset.
file.openFile(FILE_NAME, H5F_ACC_RDONLY);
-
dataset = new DataSet(file.openDataSet( DATASETNAME));
-
- filespace = new DataSpace(dataset->getSpace());
+ // Get the dataset's dataspace and creation property list.
+ filespace = new DataSpace(dataset->getSpace());
prop = dataset->getCreatePlist();
+
+ // Get information to obtain memory dataspace.
rank = filespace->getSimpleExtentNdims();
herr_t status_n = filespace->getSimpleExtentDims(dimsr);