HDF5 C++ API Reference Manual

 

 

 

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Examples

H5DataSet.h

Go to the documentation of this file.
00001 // C++ informative line for the emacs editor: -*- C++ -*-
00002 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00003  * Copyright by The HDF Group.                                               *
00004  * Copyright by the Board of Trustees of the University of Illinois.         *
00005  * All rights reserved.                                                      *
00006  *                                                                           *
00007  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00008  * terms governing use, modification, and redistribution, is contained in    *
00009  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00010  * of the source code distribution tree; Copyright.html can be found at the  *
00011  * root level of an installed copy of the electronic HDF5 document set and   *
00012  * is linked from the top-level documents page.  It can also be found at     *
00013  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00014  * access to either file, you may request a copy from help@hdfgroup.org.     *
00015  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00016 
00017 // Class DataSet inherits from AbstractDs and provides accesses to a dataset.
00018 
00019 #ifndef _H5DataSet_H
00020 #define _H5DataSet_H
00021 
00022 #ifndef H5_NO_NAMESPACE
00023 namespace H5 {
00024 #endif
00025 
00026 class H5_DLLCPP DataSet : public AbstractDs {
00027    public:
00028         // Close this dataset.
00029         virtual void close();
00030 
00031         // Extends the dataset with unlimited dimension.
00032         void extend( const hsize_t* size ) const;
00033 
00034         // Fills a selection in memory with a value
00035         void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space);
00036         // Fills a selection in memory with zero
00037         void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space);
00038 
00039         // Gets the creation property list of this dataset.
00040         DSetCreatPropList getCreatePlist() const;
00041 
00042         // Returns the address of this dataset in the file.
00043         haddr_t getOffset() const;
00044 
00045         // Gets the dataspace of this dataset.
00046         virtual DataSpace getSpace() const;
00047 
00048         // Determines whether space has been allocated for a dataset.
00049         void getSpaceStatus(H5D_space_status_t& status) const;
00050 
00051         // Returns the amount of storage size required for this dataset.
00052         hsize_t getStorageSize() const;
00053 
00054         // Returns the number of bytes required to store VL data.
00055         hsize_t getVlenBufSize( DataType& type, DataSpace& space ) const;
00056 
00057         // Reclaims VL datatype memory buffers.
00058         static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf );
00059         static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT);
00060 
00061         // Reads the data of this dataset and stores it in the provided buffer.
00062         // The memory and file dataspaces and the transferring property list
00063         // can be defaults.
00064         void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
00065         void read( H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
00066 
00067         // Writes the buffered data to this dataset.
00068         // The memory and file dataspaces and the transferring property list
00069         // can be defaults.
00070         void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
00071         void write( const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
00072 
00073         // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet
00074         int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL );
00075 
00076         // Retrieves the type of object that an object reference points to.
00077         H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
00078 
00079         // Retrieves a dataspace with the region pointed to selected.
00080         DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00081 
00082         // Creates a reference to a named Hdf5 object or to a dataset region
00083         // in this object.
00084         void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00085 
00086         // Creates a reference to a named Hdf5 object in this object.
00087         void* Reference(const char* name) const; // will be obsolete
00088         void* Reference(const H5std_string& name) const; // will be obsolete
00089 
00090         // Returns this class name
00091         virtual H5std_string fromClass () const { return("DataSet"); }
00092 
00093         // Creates a dataset by way of dereference.
00094         DataSet(IdComponent& obj, void* ref);
00095 
00096         // Default constructor.
00097         DataSet();
00098 
00099         // Copy constructor.
00100         DataSet( const DataSet& original );
00101 
00102         // Creates a copy of an existing DataSet using its id.
00103         DataSet(const hid_t existing_id);
00104 
00105         // Destructor: properly terminates access to this dataset.
00106         virtual ~DataSet();
00107 
00108    private:
00109         // This function contains the common code that is used by
00110         // getTypeClass and various API functions getXxxType
00111         // defined in AbstractDs for generic datatype and specific
00112         // sub-types
00113         virtual hid_t p_get_type() const;
00114 };
00115 #ifndef H5_NO_NAMESPACE
00116 }
00117 #endif
00118 #endif

Generated on Tue Aug 14 13:56:59 2007 by  doxygen 1.3.9.1