0
      0
  @   ˆl–Ým_Jå/”Š�và�q–TÅ£�þBFdY¹@�ðÊ6�üÿÆƒtBÃ_ˆI|¥�+y,ÂÁ =    // C++ informative line for the emacs editor: -*- C++ -*-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://www.hdfgroup.org/licenses.               *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef H5DataSet_H
#define H5DataSet_H

namespace H5 {

/*! \class DataSet
    \brief Class DataSet operates on HDF5 datasets.

    An datasets has many characteristics similar to an attribute, thus both
    Attribute and DataSet are derivatives of AbstractDs.  DataSet also
    inherits from H5Object because a dataset is an HDF5 object.
*/
//  Inheritance: multiple H5Object/AbstractDs -> H5Location -> IdComponent
class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
  public:
    // Close this dataset.
    virtual void close();

    // Extends the dataset with unlimited dimension.
    void extend(const hsize_t *size) const;

    // Fills a selection in memory with a value
    void fillMemBuf(const void *fill, const DataType &fill_type, void *buf, const DataType &buf_type,
                    const DataSpace &space) const;
    // void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace&
    // space); // removed from 1.8.18 and 1.10.1

    // Fills a selection in memory with zero
    void fillMemBuf(void *buf, const DataType &buf_type, const DataSpace &space) const;
    // void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1

    // Gets the creation property list of this dataset.
    DSetCreatPropList getCreatePlist() const;

    // Gets the access property list of this dataset.
    DSetAccPropList getAccessPlist() const;

    // Returns the address of this dataset in the file.
    haddr_t getOffset() const;

    // Gets the dataspace of this dataset.
    virtual DataSpace getSpace() const;

    // Determines whether space has been allocated for a dataset.
    void getSpaceStatus(H5D_space_status_t &status) const;

    // Returns the amount of storage size required for this dataset.
    virtual hsize_t getStorageSize() const;

    // Returns the in memory size of this attribute's data.
    virtual size_t getInMemDataSize() const;

    // Returns the number of bytes required to store VL data.
    hsize_t getVlenBufSize(const DataType &type, const DataSpace &space) const;
    // hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1

    // Reclaims VL datatype memory buffers.
    static void vlenReclaim(const DataType &type, const DataSpace &space,
                            const DSetMemXferPropList &xfer_plist, void *buf);
    static void vlenReclaim(void *buf, const DataType &type, const DataSpace &space = DataSpace::ALL,
                            const DSetMemXferPropList &xfer_plist = DSetMemXferPropList::DEFAULT);

    // Reads the data of this dataset and stores it in the provided buffer.
    // The memory and file dataspaces and the transferring property list
    // can be defaults.
    void read(void *buf, const DataType &mem_type, const DataSpace &mem_space = DataSpace::ALL,
              const DataSpace &          file_space = DataSpace::ALL,
              const DSetMemXferPropList &xfer_pl