HDF5 C++ API Reference Manual |
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 #ifndef _H5DataSpace_H 00018 #define _H5DataSpace_H 00019 00020 #ifndef H5_NO_NAMESPACE 00021 namespace H5 { 00022 #endif 00023 00024 class H5_DLLCPP DataSpace : public IdComponent { 00025 public: 00026 // Default DataSpace objects 00027 static const DataSpace ALL; 00028 00029 // Creates a dataspace object given the space type 00030 DataSpace(H5S_class_t type = H5S_SCALAR); 00031 00032 // Creates a simple dataspace 00033 DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); 00034 00035 // Assignment operator 00036 DataSpace& operator=( const DataSpace& rhs ); 00037 00038 // Closes this dataspace. 00039 virtual void close(); 00040 00041 // Makes copy of an existing dataspace. 00042 void copy(const DataSpace& like_space); 00043 00044 // Copies the extent of this dataspace. 00045 void extentCopy( DataSpace& dest_space ) const; 00046 00047 // Gets the bounding box containing the current selection. 00048 void getSelectBounds( hsize_t* start, hsize_t* end ) const; 00049 00050 // Gets the number of element points in the current selection. 00051 hssize_t getSelectElemNpoints() const; 00052 00053 // Retrieves the list of element points currently selected. 00054 void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const; 00055 00056 // Gets the list of hyperslab blocks currently selected. 00057 void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const; 00058 00059 // Get number of hyperslab blocks. 00060 hssize_t getSelectHyperNblocks() const; 00061 00062 // Gets the number of elements in this dataspace selection. 00063 hssize_t getSelectNpoints() const; 00064 00065 // Retrieves dataspace dimension size and maximum size. 00066 int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const; 00067 00068 // Gets the dimensionality of this dataspace. 00069 int getSimpleExtentNdims() const; 00070 00071 // Gets the number of elements in this dataspace. 00072 // 12/05/00 - changed return type to hssize_t from hsize_t - C API 00073 hssize_t getSimpleExtentNpoints() const; 00074 00075 // Gets the current class of this dataspace. 00076 H5S_class_t getSimpleExtentType() const; 00077 00078 // Determines if this dataspace is a simple one. 00079 bool isSimple() const; 00080 00081 // Sets the offset of this simple dataspace. 00082 void offsetSimple( const hssize_t* offset ) const; 00083 00084 // Selects the entire dataspace. 00085 void selectAll() const; 00086 00087 // Selects array elements to be included in the selection for 00088 // this dataspace. 00089 void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; 00090 00091 // Selects a hyperslab region to add to the current selected region. 00092 void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const; 00093 00094 // Resets the selection region to include no elements. 00095 void selectNone() const; 00096 00097 // Verifies that the selection is within the extent of the dataspace. 00098 bool selectValid() const; 00099 00100 // Removes the extent from this dataspace. 00101 void setExtentNone() const; 00102 00103 // Sets or resets the size of this dataspace. 00104 void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const; 00105 00106 // Returns this class name 00107 virtual H5std_string fromClass () const { return("DataSpace"); } 00108 00109 // Creates a DataSpace object using an existing dataspace id. 00110 DataSpace(const hid_t space_id); 00111 00112 // Copy constructor: makes a copy of the original DataSpace object. 00113 DataSpace(const DataSpace& original); 00114 00115 // Gets the dataspace id. 00116 virtual hid_t getId() const; 00117 00118 // Destructor: properly terminates access to this dataspace. 00119 virtual ~DataSpace(); 00120 00121 protected: 00122 // Sets the dataspace id. 00123 virtual void p_setId(const hid_t new_id); 00124 00125 private: 00126 hid_t id; // HDF5 dataspace id 00127 }; 00128 #ifndef H5_NO_NAMESPACE 00129 } 00130 #endif 00131 #endif