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 H5Object, 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 #ifndef H5_NO_DEPRECATED_SYMBOLS
00077         // Retrieves the type of object that an object reference points to.
00078         H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
00079 #endif /* H5_NO_DEPRECATED_SYMBOLS */
00080 
00081         // Retrieves a dataspace with the region pointed to selected.
00082         DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00083 
00084         // Returns this class name
00085         virtual H5std_string fromClass () const { return("DataSet"); }
00086 
00087         // Creates a dataset by way of dereference.
00088         DataSet(H5Object& obj, void* ref);
00089         DataSet(H5File& file, void* ref);
00090 
00091         // Default constructor.
00092         DataSet();
00093 
00094         // Copy constructor.
00095         DataSet( const DataSet& original );
00096 
00097         // Creates a copy of an existing DataSet using its id.
00098         DataSet(const hid_t existing_id);
00099 
00100         // Gets the dataset id.
00101         virtual hid_t getId() const;
00102         virtual void setId(const hid_t new_id);
00103 
00104         // Destructor: properly terminates access to this dataset.
00105         virtual ~DataSet();
00106 
00107    private:
00108         hid_t id;       // HDF5 dataset id
00109 
00110         // This function contains the common code that is used by
00111         // getTypeClass and various API functions getXxxType
00112         // defined in AbstractDs for generic datatype and specific
00113         // sub-types
00114         virtual hid_t p_get_type() const;
00115 };
00116 #ifndef H5_NO_NAMESPACE
00117 }
00118 #endif
00119 #endif

Generated on Fri May 23 18:50:11 2008 by  doxygen 1.3.9.1