title: Reading a HDF5 dataset with compound data type containing multiple sets with variable numbers of floats and ints
body: <p>I'm trying to read a HDF5 dataset with a compound data type using the H5Cpp library in C++. The HDF5 file is created by a simulator, so unfortunately I have no control over the structure. Each cell contains multiple sets of variable length floats and one set of variable length ints. The header structure shown by h5dump is:</p>
  
  <pre><code>DATASET "SET_NAME" {
           DATATYPE  H5T_COMPOUND {
              H5T_VLEN { H5T_IEEE_F64LE} "dProp1";
              H5T_VLEN { H5T_IEEE_F64LE} "dProp2";
              H5T_VLEN { H5T_STD_I32LE} "iProp1";
              H5T_VLEN { H5T_IEEE_F64LE} "dProp3";
           }
           DATASPACE  SIMPLE { ( 5, 122 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) }
  }
  </code></pre>
  
  <p>I've tried to create a <code>CompType</code> containing <code>VarLenType</code>s, but when running an exception is thrown, stating that a member overlaps with another member (which is what I would expect when the only size given anywhere is the size of a struct containing pointers). This is an excerpt what I have so far:</p>
  
  <pre><code>#include &lt;H5Cpp.h&gt;
  typedef struct mytype_t {
      double* dprop1;
      double* dprop2;
      int* iprop1;
      double* dprop3;
  } mytype_t;
  
  H5::CompType ctype(sizeof(mytype_t));
  auto double_type = H5::PredType::NATIVE_DOUBLE;
  auto int_type = H5::PredType::NATIVE_INT;
  auto vdouble_type = H5::VarLenType(&amp;double_type);
  auto vint_type = H5::VarLenType(&amp;int_type);
  ctype.insertMember("dProp1", HOFFSET(mytype_t, dprop1), vdouble_type);
  ctype.insertMember("dProp2", HOFFSET(mytype_t, dprop2), vdouble_type);
  ctype.insertMember("vProp1", HOFFSET(mytype_t, iprop1), vint_type);
  ctype.insertMember("dProp3", HOFFSET(mytype_t, dprop3), vdouble_type);
  
  std::vector&lt;mytype_t&gt; data_vector;
  data_vector.resize(dims[0]*dims[1]);
  dataset.read(data_vector.data(), ctype);
  </code></pre>
  
  <p>How can I read a dataset like this?</p>