![]() |
|
|||
File indexing completed on 2025-04-18 09:16:05
0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0002 * Copyright by The HDF Group. * 0003 * All rights reserved. * 0004 * * 0005 * This file is part of HDF5. The full HDF5 copyright notice, including * 0006 * terms governing use, modification, and redistribution, is contained in * 0007 * the COPYING file, which can be found at the root of the source code * 0008 * distribution tree, or in https://www.hdfgroup.org/licenses. * 0009 * If you do not have access to either file, you may request a copy from * 0010 * help@hdfgroup.org. * 0011 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 0012 0013 /* 0014 * This file contains public declarations for the H5S module. 0015 */ 0016 #ifndef H5Spublic_H 0017 #define H5Spublic_H 0018 0019 #include "H5public.h" /* Generic Functions */ 0020 #include "H5Ipublic.h" /* Identifiers */ 0021 0022 /* Define special dataspaces for dataset I/O operations */ 0023 0024 /** 0025 * Used with @ref H5Dread and @ref H5Dwrite to indicate that the entire 0026 * dataspace will be selected. In the case of a file dataspace, this means 0027 * that the entire file dataspace, as defined by the dataset's dimensions, 0028 * will be selected. In the case of a memory dataspace, this means that 0029 * the specified file dataspace will also be used for the memory dataspace. 0030 * Used in place of a file or memory dataspace @ref hid_t value. 0031 */ 0032 #define H5S_ALL 0 0033 0034 /** 0035 * Indicates that the buffer provided in a call to @ref H5Dread or @ref H5Dwrite 0036 * is a single contiguous block of memory, with the same number of elements 0037 * as the file dataspace. Used in place of a memory dataspace @ref hid_t value. 0038 */ 0039 #define H5S_BLOCK 1 0040 0041 /** 0042 * Used with @ref H5Dread and @ref H5Dwrite to indicate that the file dataspace 0043 * selection was set via @ref H5Pset_dataset_io_hyperslab_selection calls. 0044 * Used in place of a file dataspace @ref hid_t value. 0045 */ 0046 #define H5S_PLIST 2 0047 0048 #define H5S_UNLIMITED HSIZE_UNDEF /**< Value for 'unlimited' dimensions */ 0049 0050 /** 0051 * The maximum dataspace rank or number of dimensions 0052 */ 0053 #define H5S_MAX_RANK 32 0054 0055 /* Flags for selection iterators */ 0056 #define H5S_SEL_ITER_GET_SEQ_LIST_SORTED \ 0057 0x0001 /**< Retrieve elements from iterator in increasing offset order, for \ 0058 * each call to retrieve sequences. Currently, this only applies to \ 0059 * point selections, as hyperslab selections are always returned in \ 0060 * increasing offset order. Note that the order is only increasing \ 0061 * for each call to H5Sget_seq_list(), the next set of sequences \ 0062 * could start with an earlier offset than the previous one. \ 0063 */ 0064 #define H5S_SEL_ITER_SHARE_WITH_DATASPACE \ 0065 0x0002 /**< Don't copy the dataspace selection when creating the selection \ 0066 * iterator. This can improve performance of creating the iterator, \ 0067 * but the dataspace \Bold{MUST NOT} be modified or closed until the \ 0068 * selection iterator is closed or the iterator's behavior will be \ 0069 * undefined. \ 0070 */ 0071 0072 /** 0073 * Types of dataspaces 0074 */ 0075 typedef enum H5S_class_t { 0076 H5S_NO_CLASS = -1, /**< Error */ 0077 H5S_SCALAR = 0, /**< Singleton (scalar) */ 0078 H5S_SIMPLE = 1, /**< Regular grid */ 0079 H5S_NULL = 2 /**< Empty set */ 0080 } H5S_class_t; 0081 0082 /** 0083 * Different ways of combining selections 0084 */ 0085 typedef enum H5S_seloper_t { 0086 H5S_SELECT_NOOP = -1, /**< Error */ 0087 H5S_SELECT_SET = 0, /**< Select "set" operation */ 0088 H5S_SELECT_OR, /**< Binary "or" operation for hyperslabs 0089 * (add new selection to existing selection) 0090 * \code 0091 * Original region: AAAAAAAAAA 0092 * New region: BBBBBBBBBB 0093 * A or B: CCCCCCCCCCCCCCCC 0094 * \endcode 0095 */ 0096 H5S_SELECT_AND, /**< Binary "and" operation for hyperslabs 0097 * (only leave overlapped regions in selection) 0098 * \code 0099 * Original region: AAAAAAAAAA 0100 * New region: BBBBBBBBBB 0101 * A and B: CCCC 0102 * \endcode 0103 */ 0104 H5S_SELECT_XOR, /**< Binary "xor" operation for hyperslabs 0105 * (only leave non-overlapped regions in selection) 0106 * \code 0107 * Original region: AAAAAAAAAA 0108 * New region: BBBBBBBBBB 0109 * A xor B: CCCCCC CCCCCC 0110 * \endcode 0111 */ 0112 H5S_SELECT_NOTB, /**< Binary "not" operation for hyperslabs 0113 * (only leave non-overlapped regions in original selection) 0114 * \code 0115 * Original region: AAAAAAAAAA 0116 * New region: BBBBBBBBBB 0117 * A not B: CCCCCC 0118 * \endcode 0119 */ 0120 H5S_SELECT_NOTA, /**< Binary "not" operation for hyperslabs 0121 * (only leave non-overlapped regions in new selection) 0122 * \code 0123 * Original region: AAAAAAAAAA 0124 * New region: BBBBBBBBBB 0125 * B not A: CCCCCC 0126 * \endcode 0127 */ 0128 H5S_SELECT_APPEND, /**< Append elements to end of point selection */ 0129 H5S_SELECT_PREPEND, /**< Prepend elements to beginning of point selection */ 0130 H5S_SELECT_INVALID /**< Invalid upper bound on selection operations */ 0131 } H5S_seloper_t; 0132 0133 /** 0134 * Selection type 0135 */ 0136 typedef enum { 0137 H5S_SEL_ERROR = -1, /**< Error */ 0138 H5S_SEL_NONE = 0, /**< Empty selection */ 0139 H5S_SEL_POINTS = 1, /**< Set of points */ 0140 H5S_SEL_HYPERSLABS = 2, /**< Hyperslab */ 0141 H5S_SEL_ALL = 3, /**< Everything */ 0142 H5S_SEL_N /**< Sentinel \internal THIS MUST BE LAST */ 0143 } H5S_sel_type; 0144 0145 #ifdef __cplusplus 0146 extern "C" { 0147 #endif 0148 0149 /* Operations on dataspaces, dataspace selections and selection iterators */ 0150 0151 /** 0152 * \ingroup H5S 0153 * 0154 * \brief Releases and terminates access to a dataspace 0155 * 0156 * \space_id 0157 * 0158 * \return \herr_t 0159 * 0160 * \details H5Sclose() releases a dataspace. Further access through the 0161 * dataspace identifier is illegal. Failure to release a dataspace with this 0162 * call will result in resource leaks. 0163 * 0164 * \version 1.4.0 Fortran subroutine introduced in this release. 0165 * \since 1.0.0 0166 * 0167 */ 0168 H5_DLL herr_t H5Sclose(hid_t space_id); 0169 /** 0170 * \ingroup H5S 0171 * 0172 * \brief Performs an operation on a hyperslab and an existing selection and 0173 * returns the resulting selection 0174 * 0175 * \space_id 0176 * \param[in] op Operation to perform on the current selection 0177 * \param[in] start Offset of the start of of the hyperslab 0178 * \param[in] stride Hyperslab stride 0179 * \param[in] count Number of blocks included in the hyperslab 0180 * \param[in] block Size of a block in the hyperslab 0181 * 0182 * \return \hid_t{dataspace} 0183 * 0184 * \details H5Scombine_hyperslab() combines a hyperslab selection specified 0185 * by \p start, \p stride, \p count and \p block with the current 0186 * selection for the dataspace \p space_id, creating a new dataspace 0187 * to return the generated selection. If the current selection is 0188 * not a hyperslab, it is freed and the hyperslab parameters passed 0189 * in are combined with the #H5S_SEL_ALL hyperslab (ie. a selection 0190 * composing the entire current extent). If either \p stride or 0191 * \p block is NULL, then it will be set to \p 1. 0192 * 0193 * \since 1.10.6 0194 * 0195 */ 0196 H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], 0197 const hsize_t stride[], const hsize_t count[], const hsize_t block[]); 0198 /** 0199 * \ingroup H5S 0200 * 0201 * \brief Combine two hyperslab selections with an operation, returning a 0202 * dataspace with the resulting selection 0203 * 0204 * \space_id{space1_id} 0205 * \param[in] op Selection operator 0206 * \space_id{space2_id} 0207 * 0208 * \return \hid_t{dataspace} 0209 * 0210 * \details H5Scombine_select() combines two hyperslab selections 0211 * \p space1_id and \p space2_id with an operation, returning a 0212 * new dataspace with the resulting selection. The dataspace extent 0213 * from \p space1_id is copied for the dataspace extent of the 0214 * newly created dataspace. 0215 * 0216 * \since 1.10.6 0217 * 0218 */ 0219 H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id); 0220 /** 0221 * \ingroup H5S 0222 * 0223 * \brief Creates an exact copy of a dataspace 0224 * 0225 * \space_id 0226 * 0227 * \return \hid_t{dataspace} 0228 * 0229 * \details H5Scopy() creates a new dataspace which is an exact copy of the 0230 * dataspace identified by \p space_id. The dataspace identifier 0231 * returned from this function should be released with H5Sclose() 0232 * or resource leaks will occur. 0233 * 0234 * \version 1.4.0 Fortran subroutine introduced. 0235 * \since 1.0.0 0236 * 0237 */ 0238 H5_DLL hid_t H5Scopy(hid_t space_id); 0239 /** 0240 * \ingroup H5S 0241 * 0242 * \brief Creates a new dataspace of a specified type 0243 * 0244 * \param[in] type Type of dataspace to be created 0245 * 0246 * \return \hid_t{dataspace} 0247 * 0248 * \details H5Screate() creates a new dataspace of a particular type. Currently 0249 * supported types are #H5S_SCALAR, #H5S_SIMPLE, and #H5S_NULL. 0250 * 0251 * Further dataspace types may be added later. 0252 * 0253 * A scalar dataspace, #H5S_SCALAR, has a single element, though that 0254 * element may be of a complex datatype, such as a compound or array 0255 * datatype. By convention, the rank of a scalar dataspace is always \p 0 0256 * (zero); think of it geometrically as a single, dimensionless point, 0257 * though that point can be complex. 0258 * 0259 * A simple dataspace, #H5S_SIMPLE, consists of a regular array of elements. 0260 * 0261 * A null dataspace, #H5S_NULL, has no data elements. 0262 * 0263 * The dataspace identifier returned by this function can be released with 0264 * H5Sclose() so that resource leaks will not occur. 0265 * 0266 * \version 1.4.0 Fortran subroutine introduced. 0267 * \since 1.0.0 0268 * 0269 */ 0270 H5_DLL hid_t H5Screate(H5S_class_t type); 0271 /** 0272 * \ingroup H5S 0273 * \brief Creates a new simple dataspace and opens it for access 0274 * 0275 * \param[in] rank Number of dimensions of dataspace 0276 * \param[in] dims Array specifying the size of each dimension 0277 * \param[in] maxdims Array specifying the maximum size of each dimension 0278 * 0279 * \return \hid_t{dataspace} 0280 * 0281 * \details H5Screate_simple() creates a new simple dataspace and opens it 0282 * for access, returning a dataspace identifier. 0283 * 0284 * \p rank is the number of dimensions used in the dataspace. 0285 * 0286 * \p dims is a one-dimensional array of size rank specifying the 0287 * size of each dimension of the dataset. \p maxdims is an array of 0288 * the same size specifying the upper limit on the size of each 0289 * dimension. 0290 * 0291 * Any element of \p dims can be \p 0 (zero). Note that no data can 0292 * be written to a dataset if the size of any dimension of its current 0293 * dataspace is \p 0. This is sometimes a useful initial state for 0294 * a dataset. 0295 * 0296 * \p maxdims may be the null pointer, in which case the upper limit 0297 * is the same as \p dims. Otherwise, no element of \p maxdims 0298 * should be smaller than the corresponding element of \p dims. 0299 * 0300 * If an element of \p maxdims is #H5S_UNLIMITED, the maximum size of 0301 * the corresponding dimension is unlimited. 0302 * 0303 * Any dataset with an unlimited dimension must also be chunked; see 0304 * H5Pset_chunk(). Similarly, a dataset must be chunked if \p dims 0305 * does not equal \p maxdims. 0306 * 0307 * The dataspace identifier returned from this function must be 0308 * released with H5Sclose() or resource leaks will occur. 0309 * 0310 * \note Once a dataspace has been created, specific regions or elements in 0311 * the dataspace can be selected and selections can be removed, as well. 0312 * For example, H5Sselect_hyperslab() selects a region in a dataspace and 0313 * H5Sselect_elements() selects array elements in a dataspace. These 0314 * functions are used for subsetting. H5Sselect_none() removes all 0315 * selections from a dataspace and is used in Parallel HDF5 when a process 0316 * does not have or need to write data. 0317 * 0318 * \version 1.4.0 Fortran subroutine introduced. 0319 * 0320 * \since 1.0.0 0321 * 0322 */ 0323 H5_DLL hid_t H5Screate_simple(int rank, const hsize_t dims[], const hsize_t maxdims[]); 0324 /** 0325 * \ingroup H5S 0326 * 0327 * \brief Decodes a binary object description of data space and returns a 0328 * new object handle 0329 * 0330 * \param[in] buf Buffer for the data space object to be decoded 0331 * 0332 * \return \hid_t{dataspace} 0333 * 0334 * \details Given an object description of a dataspace in binary in a 0335 * buffer, H5Sdecode() reconstructs the HDF5 data type object and 0336 * returns a new object handle for it. The binary description of the 0337 * object is encoded by H5Sencode(). The user is responsible for 0338 * passing in the right buffer. The types of dataspace addressed 0339 * in this function are null, scalar, and simple space. For a 0340 * simple dataspace, the selection information (for example, 0341 * hyperslab selection) is also encoded and decoded. A complex 0342 * dataspace has not been implemented in the library. 0343 * 0344 * \since 1.8.0 0345 * 0346 */ 0347 H5_DLL hid_t H5Sdecode(const void *buf); 0348 /** 0349 * \ingroup H5S 0350 * 0351 * \brief Encodes a data space object description into a binary buffer 0352 * 0353 * \space_id{obj_id} 0354 * \param[in,out] buf Buffer for the object to be encoded into; 0355 * If the provided buffer is NULL, only the size 0356 * of buffer needed is returned through \p nalloc. 0357 * \param[in,out] nalloc The size of the allocated buffer 0358 * \fapl_id{fapl} 0359 * 0360 * \return \herr_t 0361 * 0362 * \details Given the data space identifier \p obj_id, H5Sencode2() converts 0363 * a data space description into binary form in a buffer. Using this 0364 * binary form in the buffer, a data space object can be 0365 * reconstructed with H5Sdecode() to return a new object handle 0366 * (#hid_t) for this data space. 0367 * 0368 * A preliminary H5Sencode2() call can be made to determine the 0369 * size of the buffer needed. This value is returned in \p nalloc. 0370 * That value can then be assigned to \p nalloc for a second 0371 * H5Sencode2() call, which will retrieve the actual encoded object. 0372 * 0373 * If the library determines that \p nalloc is not big enough for the 0374 * object, it simply returns the size of the buffer needed through 0375 * \p nalloc without encoding the provided buffer. 0376 * 0377 * The file access property list \p fapl_id is used to control the 0378 * encoding via the \a libver_bounds property (see 0379 * H5Pset_libver_bounds()). If the \a libver_bounds property is missing, 0380 * H5Sencode2() proceeds as if the \a libver_bounds property were set to 0381 * (#H5F_LIBVER_EARLIEST, #H5F_LIBVER_LATEST). (Functionally, 0382 * H5Sencode1() is identical to H5Sencode2() with \a libver_bounds set to 0383 * (#H5F_LIBVER_EARLIEST, #H5F_LIBVER_LATEST).) 0384 * 0385 * The types of data space that are addressed in this function are 0386 * null, scalar, and simple space. For a simple data space, the 0387 * information on the selection, for example, hyperslab selection, 0388 * is also encoded and decoded. A complex data space has not been 0389 * implemented in the library. 0390 * 0391 * \note Motivation: This function was introduced in HDF5-1.12 as part of the 0392 * H5Sencode() format change to enable 64-bit selection encodings and 0393 * a dataspace selection that is tied to a file. See the \ref_news_112 0394 * as well as the \ref_sencode_fmt_change. 0395 * 0396 * \since 1.12.0 0397 * 0398 */ 0399 H5_DLL herr_t H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl); 0400 /** 0401 * \ingroup H5S 0402 * 0403 * \brief Copies the extent of a dataspace 0404 * 0405 * \space_id{dst_id} 0406 * \space_id{src_id} 0407 * 0408 * \return \herr_t 0409 * 0410 * \details H5Sextent_copy() copies the extent from \p src_id to \p dst_id. 0411 * This action may change the type of the dataspace. 0412 * 0413 * \version 1.4.0 Fortran subroutine was introduced. 0414 * \since 1.0.0 0415 * 0416 */ 0417 H5_DLL herr_t H5Sextent_copy(hid_t dst_id, hid_t src_id); 0418 /** 0419 * \ingroup H5S 0420 * 0421 * \brief Determines whether two dataspace extents are equal 0422 * 0423 * \space_id{space1_id} 0424 * \space_id{space2_id} 0425 * 0426 * \return \htri_t 0427 * 0428 * \details H5Sextent_equal() determines whether the dataspace extents of 0429 * two dataspaces, \p space1_id and \p space2_id, are equal. 0430 * 0431 * \since 1.8.0 0432 * 0433 */ 0434 H5_DLL htri_t H5Sextent_equal(hid_t space1_id, hid_t space2_id); 0435 /** 0436 * \ingroup H5S 0437 * 0438 * \brief Retrieves a regular hyperslab selection 0439 * 0440 * \space_id{spaceid} 0441 * \param[out] start Offset of the start of the regular hyperslab 0442 * \param[out] stride Stride of the regular hyperslab 0443 * \param[out] count Number of blocks in the regular hyperslab 0444 * \param[out] block Size of a block in the regular hyperslab 0445 * 0446 * \return \herr_t 0447 * 0448 * \details H5Sget_regular_hyperslab() takes the dataspace identifier, 0449 * \p spaceid, and retrieves the values of \p start, \p stride, 0450 * \p count, and \p block for the regular hyperslab selection. 0451 * 0452 * A regular hyperslab selection is a hyperslab selection 0453 * described by setting the \p offset, \p stride, \p count, and 0454 * \p block parameters to the H5Sselect_hyperslab() call. If 0455 * several calls to H5Sselect_hyperslab() are needed, the 0456 * hyperslab selection is irregular. 0457 * 0458 * See H5Sselect_hyperslab() for descriptions of \p offset, 0459 * \p stride, \p count, and \p block. 0460 * 0461 * \note If a hyperslab selection is originally regular, then becomes 0462 * irregular through selection operations, and then becomes regular 0463 * again, the final regular selection may be equivalent but not 0464 * identical to the original regular selection. 0465 * 0466 * \since 1.10.0 0467 * 0468 */ 0469 H5_DLL htri_t H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], hsize_t count[], 0470 hsize_t block[]); 0471 /** 0472 * \ingroup H5S 0473 * 0474 * \brief Gets the bounding box containing the current selection 0475 * 0476 * \space_id{spaceid} 0477 * \param[out] start Starting coordinates of the bounding box 0478 * \param[out] end Ending coordinates of the bounding box, i.e., the 0479 * coordinates of the diagonally opposite corner 0480 * 0481 * \return \herr_t 0482 * 0483 * \details H5Sget_select_bounds() retrieves the coordinates of the bounding 0484 * box containing the current selection and places them into 0485 * user-supplied buffers. 0486 * 0487 * The \p start and \p end buffers must be large enough to hold 0488 * the dataspace rank number of coordinates. 0489 * 0490 * The bounding box exactly contains the selection. I.e., if a 0491 * 2-dimensional element selection is currently defined as containing 0492 * the points (4,5), (6,8), and (10,7), then the bounding box 0493 * will be (4, 5), (10, 8). 0494 * 0495 * The bounding box calculation includes the current offset of the 0496 * selection within the dataspace extent. 0497 * 0498 * Calling this function on a \a none selection will fail. 0499 * 0500 * \version 1.6.0 The \p start and \p end parameters have changed from type 0501 * \p hsize_t * to \p hssize_t *. 0502 * \version 1.4.0 Fortran subroutine was introduced. 0503 * \since 1.2.0 0504 * 0505 */ 0506 H5_DLL herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t start[], hsize_t end[]); 0507 /** 0508 * \ingroup H5S 0509 * 0510 * \brief Gets the number of element points in the current selection 0511 * 0512 * \space_id{spaceid} 0513 * 0514 * \return Returns the number of element points in the current dataspace 0515 * selection if successful. Otherwise returns a negative value. 0516 * 0517 * \details H5Sget_select_elem_npoints() returns the number of element 0518 * points in the current dataspace selection, so that the element 0519 * points can be retrieved with H5Sget_select_elem_pointlist(). 0520 * (This is similar to the way that H5Sget_select_hyper_nblocks() 0521 * and H5Sget_select_hyper_blocklist() work with hyperslab 0522 * selections.) 0523 * 0524 * Coincidentally, H5Sget_select_npoints() and 0525 * H5Sget_select_elem_npoints() will always return the same value 0526 * when an element selection is queried, but 0527 * H5Sget_select_elem_npoints() does not work with other selection 0528 * types. 0529 * 0530 * \since 1.2.0 0531 * 0532 */ 0533 H5_DLL hssize_t H5Sget_select_elem_npoints(hid_t spaceid); 0534 /** 0535 * \ingroup H5S 0536 * 0537 * \brief Gets the list of element points currently selected 0538 * 0539 * \space_id{spaceid} 0540 * \param[in] startpoint Element point to start with 0541 * \param[in] numpoints Number of element points to get 0542 * \param[out] buf List of element points selected 0543 * 0544 * \return \herr_t 0545 * 0546 * \details H5Sget_select_elem_pointlist() returns the list of element 0547 * points in the current dataspace selection \p space_id. Starting 0548 * with the \p startpoint in the list of points, \p numpoints 0549 * points are put into the user's buffer. If the user's buffer 0550 * fills up before \p numpoints points are inserted, the buffer 0551 * will contain only as many points as fit. 0552 * 0553 * The element point coordinates have the same dimensionality 0554 * (rank) as the dataspace they are located within. The list of 0555 * element points is formatted as follows:\n 0556 * \<coordinate\>, followed by\n 0557 * the next coordinate,\n 0558 * etc.\n 0559 * until all of the selected element points have been listed. 0560 * 0561 * The points are returned in the order they will be iterated 0562 * through when the selection is read/written from/to disk. 0563 * 0564 * \since 1.2.0 0565 * 0566 */ 0567 H5_DLL herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, 0568 hsize_t buf[/*numpoints*/]); 0569 /** 0570 * \ingroup H5S 0571 * 0572 * \brief Gets the list of hyperslab blocks currently selected 0573 * 0574 * \space_id{spaceid} 0575 * \param[in] startblock Hyperslab block to start with 0576 * \param[in] numblocks Number of hyperslab blocks to get 0577 * \param[out] buf List of hyperslab blocks selected 0578 * 0579 * \return \herr_t 0580 * 0581 * \details H5Sget_select_hyper_blocklist() returns a list of the hyperslab 0582 * blocks currently selected. Starting with the \p startblock-th block 0583 * in the list of blocks, \p numblocks blocks are put into the 0584 * user's buffer. If the user's buffer fills up before \p numblocks 0585 * blocks are inserted, the buffer will contain only as many blocks 0586 * as fit. 0587 * 0588 * The block coordinates have the same dimensionality (rank) as the 0589 * dataspace they are located within. The list of blocks is 0590 * formatted as follows:\n 0591 * \<"start" coordinate\>, immediately followed by\n 0592 * \<"opposite" corner coordinate\>, followed by\n 0593 * the next "start" and "opposite" coordinates,\n 0594 * etc. until all of the selected blocks have been listed.\n 0595 * No guarantee of any order of the blocks is implied. 0596 * 0597 * \since 1.2.0 0598 * 0599 */ 0600 H5_DLL herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks, 0601 hsize_t buf[/*numblocks*/]); 0602 /** 0603 * \ingroup H5S 0604 * 0605 * \brief Get number of hyperslab blocks 0606 * 0607 * \space_id{spaceid} 0608 * 0609 * \return Returns the number of hyperslab blocks in the current dataspace 0610 * selection if successful. Otherwise returns a negative value. 0611 * 0612 * \details H5Sget_select_hyper_nblocks() returns the number of hyperslab 0613 * blocks in the current dataspace selection. 0614 * 0615 * \since 1.2.0 0616 * 0617 */ 0618 H5_DLL hssize_t H5Sget_select_hyper_nblocks(hid_t spaceid); 0619 /** 0620 * \ingroup H5S 0621 * 0622 * \brief Determines the number of elements in a dataspace selection 0623 * 0624 * \space_id{spaceid} 0625 * 0626 * \return Returns the number of elements in the selection if successful; 0627 * otherwise returns a negative value. 0628 * 0629 * \details H5Sget_select_npoints() determines the number of elements in 0630 * the current selection of a dataspace. It works with any 0631 * selection type, and is the correct way to retrieve the number 0632 * of elements in a selection. 0633 * 0634 * \version 1.4.0 Fortran subroutine introduced in this release. 0635 * \since 1.0.0 0636 * 0637 */ 0638 H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid); 0639 /** 0640 * \ingroup H5S 0641 * 0642 * \brief Determines the type of the dataspace selection 0643 * 0644 * \space_id{spaceid} 0645 * 0646 * \return Returns the dataspace selection type, a value of the enumerated 0647 * datatype #H5S_sel_type, if successful. 0648 * 0649 * \details H5Sget_select_type() retrieves the type of dataspace selection 0650 * currently defined for the dataspace \p space_id. Valid values 0651 * for the dataspace selection type are: 0652 * 0653 * <table> 0654 * <tr> 0655 * <td>#H5S_SEL_NONE</td> 0656 * <td>No selection is defined</td> 0657 * </tr> 0658 * <tr> 0659 * <td>#H5S_SEL_POINTS</td> 0660 * <td>A sequence of points is selected</td> 0661 * </tr> 0662 * <tr> 0663 * <td>#H5S_SEL_HYPERSLABS</td> 0664 * <td>A hyperslab or compound hyperslab is selected</td> 0665 * </tr> 0666 * <tr> 0667 * <td>#H5S_SEL_ALL</td> 0668 * <td>The entire dataset is selected</td> 0669 * </tr> 0670 * </table> 0671 * 0672 * Otherwise returns a negative value. 0673 * 0674 * \since 1.6.0 0675 * 0676 */ 0677 H5_DLL H5S_sel_type H5Sget_select_type(hid_t spaceid); 0678 /** 0679 * \ingroup H5S 0680 * 0681 * \brief Retrieves dataspace dimension size and maximum size 0682 * 0683 * \space_id 0684 * \param[out] dims Pointer to array to store the size of each dimension 0685 * \param[out] maxdims Pointer to array to store the maximum size of each 0686 * dimension 0687 * 0688 * \return Returns the number of dimensions in the dataspace if successful; 0689 * otherwise returns a negative value. 0690 * 0691 * \details H5Sget_simple_extent_dims() returns the size and maximum sizes 0692 * of each dimension of a dataspace \p space_id through the \p dims 0693 * and \p maxdims parameters. 0694 * 0695 * Either or both of \p dims and \p maxdims may be NULL. 0696 * 0697 * If a value in the returned array \p maxdims is #H5S_UNLIMITED (-1), 0698 * the maximum size of that dimension is unlimited. 0699 * 0700 * \version 1.4.0 Fortran subroutine introduced. 0701 * \since 1.0.0 0702 * 0703 */ 0704 H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], hsize_t maxdims[]); 0705 /** 0706 * \ingroup H5S 0707 * 0708 * \brief Determines the dimensionality of a dataspace 0709 * 0710 * \space_id 0711 * 0712 * \return Returns the number of dimensions in the dataspace if successful; 0713 * otherwise returns a negative value. 0714 * 0715 * \details H5Sget_simple_extent_ndims() determines the dimensionality (or 0716 * rank) of a dataspace. 0717 * 0718 * \version 1.4.0 Fortran subroutine introduced. 0719 * \since 1.0.0 0720 * 0721 */ 0722 H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id); 0723 /** 0724 * \ingroup H5S 0725 * 0726 * \brief Determines the number of elements in a dataspace 0727 * 0728 * \space_id 0729 * 0730 * \return Returns the number of elements in the dataspace if successful; 0731 * otherwise returns a negative value. 0732 * 0733 * \details H5Sget_simple_extent_npoints() determines the number of elements 0734 * in a dataspace \p space_id. For example, a simple 3-dimensional 0735 * dataspace with dimensions 2, 3, and 4 would have 24 elements. 0736 * 0737 * \version 1.4.0 Fortran subroutine introduced. 0738 * \since 1.0.0 0739 * 0740 */ 0741 H5_DLL hssize_t H5Sget_simple_extent_npoints(hid_t space_id); 0742 /** 0743 * \ingroup H5S 0744 * 0745 * \brief Determines the current class of a dataspace 0746 * 0747 * \space_id 0748 * 0749 * \return Returns a dataspace class name if successful; 0750 * otherwise #H5S_NO_CLASS (-1). 0751 * 0752 * \details H5Sget_simple_extent_type() determines the current class of a 0753 * dataspace \p space_id. 0754 * 0755 * \version 1.4.0 Fortran subroutine was introduced. 0756 * \since 1.0.0 0757 * 0758 */ 0759 H5_DLL H5S_class_t H5Sget_simple_extent_type(hid_t space_id); 0760 /** 0761 * \ingroup H5S 0762 * 0763 * \brief Determines if a hyperslab selection is regular 0764 * 0765 * \space_id{spaceid} 0766 * 0767 * \return \htri_t 0768 * 0769 * \details H5Sis_regular_hyperslab() takes the dataspace identifier, 0770 * \p spaceid, and queries the type of the hyperslab selection. 0771 * 0772 * A regular hyperslab selection is a hyperslab selection described 0773 * by setting the offset, stride, count, and block parameters for 0774 * a single H5Sselect_hyperslab() call. If several calls to 0775 * H5Sselect_hyperslab() are needed, then the hyperslab selection 0776 * is irregular. 0777 * 0778 * \since 1.10.0 0779 * 0780 */ 0781 H5_DLL htri_t H5Sis_regular_hyperslab(hid_t spaceid); 0782 /** 0783 * \ingroup H5S 0784 * 0785 * \brief Determines whether a dataspace is a simple dataspace 0786 * 0787 * \space_id 0788 * 0789 * \return \htri_t 0790 * 0791 * \details H5Sis_simple() determines whether or not a dataspace is a simple 0792 * dataspace. 0793 * 0794 * \note Currently, all dataspace objects are simple dataspaces; complex 0795 * dataspace support will be added in the future. 0796 * 0797 * \version 1.4.0 Fortran subroutine was introduced. 0798 * \since 1.0.0 0799 * 0800 */ 0801 H5_DLL htri_t H5Sis_simple(hid_t space_id); 0802 /** 0803 * \ingroup H5S 0804 * 0805 * \brief Refines a hyperslab selection with an operation, using a second 0806 * hyperslab to modify it 0807 * 0808 * \space_id{space1_id} 0809 * \param[in] op Selection operator 0810 * \space_id{space2_id} 0811 * 0812 * \return \herr_t 0813 * 0814 * \details H5Smodify_select() refines an existing hyperslab selection 0815 * \p space1_id with an operation \p op, using a second hyperslab 0816 * \p space2_id. The first selection is modified to contain the 0817 * result of \p space1_id operated on by \p space2_id. 0818 * 0819 * \since 1.10.6 0820 * 0821 */ 0822 H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id); 0823 /** 0824 * \ingroup H5S 0825 * 0826 * \brief Sets the offset of a simple dataspace 0827 * 0828 * \space_id 0829 * \param[in] offset The offset at which to position the selection 0830 * 0831 * \return \herr_t 0832 * 0833 * \details H5Soffset_simple() sets the offset of a simple dataspace 0834 * \p space_id. The offset array must be the same number of 0835 * elements as the number of dimensions for the dataspace. If the 0836 * \p offset array is set to NULL, the offset for the dataspace is 0837 * reset to 0 in all dimensions. 0838 * 0839 * This function allows the same shaped selection to be moved to 0840 * different locations within a dataspace without requiring it to 0841 * be redefined. 0842 * 0843 * \note Until 1.14.4, setting the offset parameter to NULL was considered 0844 * an error, despite the reference manual stating that it had the 0845 * behavior described above. 0846 * 0847 * \version 1.4.0 Fortran subroutine was introduced. 0848 * \since 1.0.0 0849 * 0850 */ 0851 H5_DLL herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset); 0852 /** 0853 * \ingroup H5S 0854 * 0855 * \brief Closes a dataspace selection iterator 0856 * 0857 * \param[in] sel_iter_id Identifier of the dataspace selection iterator 0858 * 0859 * \return \herr_t 0860 * 0861 * \details H5Ssel_iter_close() closes a dataspace selection iterator 0862 * specified by \p sel_iter_id, releasing its state. 0863 * 0864 * \since 1.12.0 0865 * 0866 */ 0867 H5_DLL herr_t H5Ssel_iter_close(hid_t sel_iter_id); 0868 /**\ingroup H5S 0869 * 0870 * \brief Creates a dataspace selection iterator for a dataspace's selection 0871 * 0872 * \space_id{spaceid} 0873 * \param[in] elmt_size Size of element in the selection 0874 * \param[in] flags Selection iterator flag, valid values are: 0875 * \li @ref H5S_SEL_ITER_GET_SEQ_LIST_SORTED 0876 * \li @ref H5S_SEL_ITER_SHARE_WITH_DATASPACE 0877 * \return \hid_t{valid dataspace selection iterator} 0878 * 0879 * \details H5Ssel_iter_create() creates a selection iterator and initializes 0880 * it to start at the first element selected in the dataspace. 0881 * 0882 * \since 1.12.0 0883 * 0884 */ 0885 H5_DLL hid_t H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags); 0886 /** 0887 * \ingroup H5S 0888 * 0889 * \brief Retrieves a list of offset / length sequences for the elements in 0890 * an iterator 0891 * 0892 * \param[in] sel_iter_id Identifier of the dataspace selection iterator 0893 * \param[in] maxseq Maximum number of sequences to retrieve 0894 * \param[in] maxelmts Maximum number of elements to retrieve in sequences 0895 * \param[out] nseq Number of sequences retrieved 0896 * \param[out] nelmts Number of elements retrieved, in all sequences 0897 * \param[out] off Array of sequence offsets 0898 * \param[out] len Array of sequence lengths 0899 * 0900 * \return \herr_t 0901 * 0902 * \details H5Ssel_iter_get_seq_list() retrieves a list of offset / length 0903 * pairs (a list of "sequences") matching the selected elements for 0904 * an iterator \p sel_iter_id, according to the iteration order for 0905 * the iterator. The lengths returned are in bytes, not elements. 0906 * 0907 * Note that the iteration order for "all" and "hyperslab" 0908 * selections is row-major (i.e. "C-ordered"), but the iteration 0909 * order for "point" selections is "in order selected", unless the 0910 * #H5S_SEL_ITER_GET_SEQ_LIST_SORTED flag is passed to 0911 * H5Ssel_iter_create() for a point selection. 0912 * 0913 * \p maxseq and \p maxelmts specify the most sequences or elements 0914 * possible to place into the \p off and \p len arrays. \p nseq and 0915 * \p nelmts return the actual number of sequences and elements put 0916 * into the arrays. 0917 * 0918 * Each call to H5Ssel_iter_get_seq_list() will retrieve the next 0919 * set of sequences for the selection being iterated over. 0920 * 0921 * The total number of bytes possible to retrieve from a selection 0922 * iterator is the \p elmt_size passed to H5Ssel_iter_create() 0923 * multiplied by the number of elements selected in the dataspace 0924 * the iterator was created from (which can be retrieved with 0925 * H5Sget_select_npoints(). When there are no further sequences of 0926 * elements to retrieve, calls to this routine will set \p nseq 0927 * and \p nelmts to zero. 0928 * 0929 * \since 1.12.0 0930 * 0931 */ 0932 H5_DLL herr_t H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxelmts, size_t *nseq, 0933 size_t *nelmts, hsize_t *off, size_t *len); 0934 /** 0935 * \ingroup H5S 0936 * 0937 * \brief Resets a dataspace selection iterator back to an initial state 0938 * 0939 * \param[in] sel_iter_id Identifier of the dataspace selection iterator 0940 * to reset 0941 * \param[in] space_id Identifier of the dataspace with selection to 0942 * iterate over 0943 * 0944 * \return \herr_t 0945 * 0946 * \details H5Ssel_iter_reset() resets a dataspace selection iterator back to 0947 * an initial state so that the iterator may be used for iteration 0948 * once again. 0949 * 0950 * \since 1.12.1 0951 * 0952 */ 0953 H5_DLL herr_t H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id); 0954 /** 0955 * \ingroup H5S 0956 * 0957 * \brief Adjusts a selection by subtracting an offset 0958 * 0959 * \space_id{spaceid} 0960 * \param[in] offset Offset to subtract 0961 * 0962 * \return \herr_t 0963 * 0964 * \details H5Sselect_adjust() shifts a dataspace selection by a specified 0965 * logical offset within the dataspace extent. 0966 * 0967 * \note This can be useful for VOL developers to implement chunked datasets. 0968 * 0969 * \since 1.10.6 0970 */ 0971 H5_DLL herr_t H5Sselect_adjust(hid_t spaceid, const hssize_t *offset); 0972 /** 0973 * \ingroup H5S 0974 * 0975 * \brief Selects an entire dataspace 0976 * 0977 * \space_id{spaceid} 0978 * 0979 * \return \herr_t 0980 * 0981 * \details H5Sselect_all() selects the entire extent of the dataspace 0982 * \p dspace_id. 0983 * 0984 * More specifically, H5Sselect_all() sets the selection type to 0985 * #H5S_SEL_ALL, which specifies the entire dataspace anywhere it 0986 * is applied. 0987 * 0988 * \since 1.0.0 0989 * 0990 */ 0991 H5_DLL herr_t H5Sselect_all(hid_t spaceid); 0992 /** 0993 * \ingroup H5S 0994 * 0995 * \brief Copies a selection from one dataspace to another 0996 * 0997 * \space_id{dst_id} 0998 * \space_id{src_id} 0999 * 1000 * \return \herr_t 1001 * 1002 * \details H5Sselect_copy() copies all selection information (including 1003 * offset) from the source dataspace \p src_id to the destination 1004 * dataspace \p dst_id. 1005 * 1006 * \since 1.10.6 1007 * 1008 */ 1009 H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); 1010 /** 1011 * \ingroup H5S 1012 * 1013 * \brief Selects array elements to be included in the selection for a 1014 * dataspace 1015 * 1016 * \space_id 1017 * \param[in] op Operator specifying how the new selection is to be 1018 * combined with the existing selection for the dataspace 1019 * \param[in] num_elem Number of elements to be selected 1020 * \param[in] coord A pointer to a buffer containing a serialized copy of 1021 * a 2-dimensional array of zero-based values specifying 1022 * the coordinates of the elements in the point selection 1023 * 1024 * \return \herr_t 1025 * 1026 * \details H5Sselect_elements() selects array elements to be included in 1027 * the selection for the \p space_id dataspace. This is referred 1028 * to as a point selection. 1029 * 1030 * The number of elements selected is set in the \p num_elements 1031 * parameter. 1032 * 1033 * The \p coord parameter is a pointer to a buffer containing a 1034 * serialized 2-dimensional array of size \p num_elements by the 1035 * rank of the dataspace. The array lists dataset elements in the 1036 * point selection; that is, it's a list of zero-based values 1037 * specifying the coordinates in the dataset of the selected 1038 * elements. The order of the element coordinates in the \p coord 1039 * array specifies the order in which the array elements are 1040 * iterated through when I/O is performed. Duplicate coordinate 1041 * locations are not checked for. See below for examples of the 1042 * mapping between the serialized contents of the buffer and the 1043 * point selection array that it represents. 1044 * 1045 * The selection operator \p op determines how the new selection 1046 * is to be combined with the previously existing selection for 1047 * the dataspace. The following operators are supported: 1048 * 1049 * <table> 1050 * <tr> 1051 * <td>#H5S_SELECT_SET</td> 1052 * <td>Replaces the existing selection with the parameters from 1053 * this call. Overlapping blocks are not supported with this 1054 * operator. Adds the new selection to the existing selection. 1055 * </td> 1056 * </tr> 1057 * <tr> 1058 * <td>#H5S_SELECT_APPEND</td> 1059 * <td>Adds the new selection following the last element of the 1060 * existing selection.</td> 1061 * </tr> 1062 * <tr> 1063 * <td>#H5S_SELECT_PREPEND</td> 1064 * <td>Adds the new selection preceding the first element of the 1065 * existing selection.</td> 1066 * </tr> 1067 * </table> 1068 * 1069 * <b>Mapping the serialized \p coord buffer to a 2-dimensional 1070 * point selection array:</b> 1071 * To illustrate the construction of the contents of the \p coord 1072 * buffer, consider two simple examples: a selection of 5 points in 1073 * a 1-dimensional array and a selection of 3 points in a 1074 * 4-dimensional array. 1075 * 1076 * In the 1D case, we will be selecting five points and a 1D 1077 * dataspace has rank 1, so the selection will be described in a 1078 * 5-by-1 array. To select the 1st, 14th, 17th, 23rd and 8th elements 1079 * of the dataset, the selection array would be as follows 1080 * (remembering that point coordinates are zero-based): 1081 * \n 0 1082 * \n 13 1083 * \n 16 1084 * \n 22 1085 * \n 7 1086 * 1087 * This point selection array will be serialized in the \p coord 1088 * buffer as: 1089 * \n 0 13 16 22 7 1090 * 1091 * In the 4D case, we will be selecting three points and a 4D 1092 * dataspace has rank 4, so the selection will be described in a 1093 * 3-by-4 array. To select the points (1,1,1,1), (14,6,12,18), and 1094 * (8,22,30,22), the point selection array would be as follows: 1095 * \n 0 0 0 0 1096 * \n 13 5 11 17 1097 * \n 7 21 29 21 1098 * 1099 * This point selection array will be serialized in the \p coord 1100 * buffer as: 1101 * \n 0 0 0 0 13 5 11 17 7 21 29 21 1102 * 1103 * \version 1.6.4 C coord parameter type changed to \p const hsize_t. 1104 * \version 1.6.4 Fortran \p coord parameter type changed to \p INTEGER(HSIZE_T). 1105 * \since 1.0.0 1106 * 1107 */ 1108 H5_DLL herr_t H5Sselect_elements(hid_t space_id, H5S_seloper_t op, size_t num_elem, const hsize_t *coord); 1109 /** 1110 * \ingroup H5S 1111 * 1112 * \brief Selects a hyperslab region to add to the current selected region 1113 * 1114 * \space_id 1115 * \param[in] op Operation to perform on current selection 1116 * \param[in] start Offset of start of hyperslab 1117 * \param[in] stride Hyperslab stride 1118 * \param[in] count Number of blocks included in hyperslab 1119 * \param[in] block Size of block in hyperslab 1120 * 1121 * \return \herr_t 1122 * 1123 * \details H5Sselect_hyperslab() selects a hyperslab region to add to the 1124 * current selected region for the dataspace specified by 1125 * \p space_id. 1126 * 1127 * The \p start, \p stride, \p count, and \p block arrays must be the 1128 * same size as the rank of the dataspace. For example, if the 1129 * dataspace is 4-dimensional, each of these parameters must be a 1130 * 1-dimensional array of size 4. 1131 * 1132 * The selection operator \p op determines how the new selection 1133 * is to be combined with the already existing selection for the 1134 * dataspace. The following operators are supported: 1135 * 1136 * <table> 1137 * <tr> 1138 * <td>#H5S_SELECT_SET</td> 1139 * <td>Replaces the existing selection with the 1140 * parameters from this call. Overlapping blocks 1141 * are not supported with this operator.</td> 1142 * </tr> 1143 * <tr> 1144 * <td>#H5S_SELECT_OR</td> 1145 * <td>Adds the new selection to the existing selection. 1146 * (Binary OR)</td> 1147 * </tr> 1148 * <tr> 1149 * <td>#H5S_SELECT_AND</td> 1150 * <td>Retains only the overlapping portions of the 1151 * new selection and the existing selection. 1152 * (Binary AND)</td> 1153 * </tr> 1154 * <tr> 1155 * <td>#H5S_SELECT_XOR</td> 1156 * <td>Retains only the elements that are members of 1157 * the new selection or the existing selection, 1158 * excluding elements that are members of both 1159 * selections. (Binary exclusive-OR, XOR) 1160 * </td> 1161 * </tr> 1162 * <tr> 1163 * <td>#H5S_SELECT_NOTB</td> 1164 * <td>Retains only elements of the existing selection 1165 * that are not in the new selection.</td> 1166 * </tr> 1167 * <tr> 1168 * <td>#H5S_SELECT_NOTA</td> 1169 * <td>Retains only elements of the new selection that 1170 * are not in the existing selection.</td> 1171 * </tr> 1172 * </table> 1173 * 1174 * The \p start array specifies the offset of the starting element 1175 * of the specified hyperslab. 1176 * 1177 * The \p stride array chooses array locations from the dataspace with 1178 * each value in the \p stride array determining how many elements to 1179 * move in each dimension. Setting a value in the \p stride array to 1180 * \p 1 moves to each element in that dimension of the dataspace; 1181 * setting a value of \p 2 in allocation in the \p stride array moves 1182 * to every other element in that dimension of the dataspace. In 1183 * other words, the \p stride determines the number of elements to 1184 * move from the \p start location in each dimension. Stride values 1185 * of \p 0 are not allowed. If the \p stride parameter is NULL, a 1186 * contiguous hyperslab is selected (as if each value in the \p stride 1187 * array were set to \p 1). 1188 * 1189 * The \p count array determines how many blocks to select from the 1190 * dataspace, in each dimension. 1191 * 1192 * The \p block array determines the size of the element block 1193 * selected from the dataspace. If the \p block parameter is set to 1194 * NULL, the block size defaults to a single element in each dimension 1195 * (as if each value in the \p block array were set to \p 1). 1196 * 1197 * For example, consider a 2-dimensional dataspace with hyperslab 1198 * selection settings as follows: the \p start offset is specified as 1199 * [1,1], \p stride is [4,4], \p count is [3,7], and \p block is [2,2]. 1200 * In C, these settings will specify a hyperslab consisting of 21 1201 * 2x2 blocks of array elements starting with location (1,1) with the 1202 * selected blocks at locations (1,1), (5,1), (9,1), (1,5), (5,5), etc.; 1203 * in Fortran, they will specify a hyperslab consisting of 21 2x2 1204 * blocks of array elements starting with location (2,2), since \p start 1205 * is 0-based indexed, with the selected blocks at 1206 * locations (2,2), (6,2), (10,2), (2,6), (6,6), etc. 1207 * 1208 * Regions selected with this function call default to C order 1209 * iteration when I/O is performed. 1210 * 1211 * \version 1.4.0 Fortran subroutine introduced in this release. 1212 * \since 1.0.0 1213 * 1214 */ 1215 H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], 1216 const hsize_t stride[], const hsize_t count[], const hsize_t block[]); 1217 /*--------------------------------------------------------------------------*/ 1218 /**\ingroup H5S 1219 * 1220 * \brief Checks if current selection intersects with a block 1221 * 1222 * \space_id 1223 * \param[in] start Starting coordinate of block 1224 * \param[in] end Opposite ("ending") coordinate of block 1225 * 1226 * \return \htri_t 1227 * 1228 * \details H5Sselect_intersect_block() checks to see if the current 1229 * selection \p space_id in the dataspace intersects with the block 1230 * specified by \p start and \p end. 1231 * 1232 * \note Assumes that \p start & \p end block bounds are inclusive, so 1233 * \p start == \p end value is OK. 1234 * 1235 * \since 1.10.6 1236 * 1237 */ 1238 H5_DLL htri_t H5Sselect_intersect_block(hid_t space_id, const hsize_t *start, const hsize_t *end); 1239 /*--------------------------------------------------------------------------*/ 1240 /**\ingroup H5S 1241 * 1242 * \brief Resets the selection region to include no elements 1243 * 1244 * \space_id{spaceid} 1245 * 1246 * \return \herr_t 1247 * 1248 * \details H5Sselect_none() resets the selection region for the dataspace 1249 * \p space_id to include no elements. 1250 * 1251 * \since 1.0.0 1252 * 1253 */ 1254 H5_DLL herr_t H5Sselect_none(hid_t spaceid); 1255 /*--------------------------------------------------------------------------*/ 1256 /**\ingroup H5S 1257 * 1258 * \brief Projects the intersection of two source selections to a 1259 * destination selection 1260 * 1261 * \space_id{src_space_id} 1262 * \space_id{dst_space_id} 1263 * \space_id{src_intersect_space_id} 1264 * 1265 * \return Returns a dataspace with a selection equal to the intersection of 1266 * \p src_intersect_space_id and \p src_space_id projected from 1267 * \p src_space to \p dst_space on success, negative on failure. 1268 * 1269 * \details H5Sselect_project_intersection() computes the intersection 1270 * between two dataspace selections and projects that intersection 1271 * into a third selection.This can be useful for VOL developers to 1272 * implement chunked or virtual datasets. 1273 * 1274 * \since 1.10.6 1275 * 1276 */ 1277 H5_DLL hid_t H5Sselect_project_intersection(hid_t src_space_id, hid_t dst_space_id, 1278 hid_t src_intersect_space_id); 1279 /*--------------------------------------------------------------------------*/ 1280 /**\ingroup H5S 1281 * 1282 * \brief Checks if two selections are the same shape 1283 * 1284 * \space_id{space1_id} 1285 * \space_id{space2_id} 1286 * 1287 * \return \htri_t 1288 * 1289 * \details H5Sselect_shape_same() checks to see if the current selection 1290 * in the dataspaces are the same dimensionality and shape. 1291 * 1292 * This is primarily used for reading the entire selection in 1293 * one swoop. 1294 * 1295 * \since 1.10.6 1296 * 1297 */ 1298 H5_DLL htri_t H5Sselect_shape_same(hid_t space1_id, hid_t space2_id); 1299 /*--------------------------------------------------------------------------*/ 1300 /**\ingroup H5S 1301 * 1302 * \brief Verifies that the selection is within the extent of the dataspace 1303 * 1304 * \space_id{spaceid} 1305 * 1306 * \return \htri_t 1307 * 1308 * \details H5Sselect_valid() verifies that the selection for the dataspace 1309 * \p space_id is within the extent of the dataspace if the current 1310 * offset for the dataspace is used. 1311 * 1312 * \version 1.4.0 Fortran subroutine introduced in this release. 1313 * \since 1.0.0 1314 * 1315 */ 1316 H5_DLL htri_t H5Sselect_valid(hid_t spaceid); 1317 /*--------------------------------------------------------------------------*/ 1318 /**\ingroup H5S 1319 * 1320 * \brief Resets the extent of a dataspace back to "none" 1321 * 1322 * \space_id 1323 * 1324 * \return \herr_t 1325 * 1326 * \details H5Sset_extent_none() resets the type of a dataspace to 1327 * #H5S_NULL with no extent information stored for the dataspace. 1328 * 1329 * \version 1.10.7, 1.12.1 The function behavior changed. The previous 1330 * behavior was to set the class to #H5S_NO_CLASS. 1331 * \version 1.4.0 Fortran subroutine was introduced. 1332 * \since 1.0.0 1333 * 1334 */ 1335 H5_DLL herr_t H5Sset_extent_none(hid_t space_id); 1336 /*--------------------------------------------------------------------------*/ 1337 /**\ingroup H5S 1338 * 1339 * \brief Sets or resets the size of an existing dataspace 1340 * 1341 * \space_id 1342 * \param[in] rank Rank, or dimensionality, of the dataspace 1343 * \param[in] dims Array containing current size of dataspace 1344 * \param[in] max Array containing maximum size of dataspace 1345 * 1346 * \return \herr_t 1347 * 1348 * \details H5Sset_extent_simple() sets or resets the size of an existing 1349 * dataspace. 1350 * 1351 * \p dims is an array of size \p rank that contains the new size 1352 * of each dimension in the dataspace. \p max is an array of size 1353 * \p rank that contains the maximum size of each dimension in 1354 * the dataspace. 1355 * 1356 * Any previous extent is removed from the dataspace, the dataspace 1357 * type is set to #H5S_SIMPLE, and the extent is set as specified. 1358 * 1359 * \version 1.4.0 Fortran subroutine was introduced. 1360 * \since 1.0.0 1361 * 1362 */ 1363 H5_DLL herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[], const hsize_t max[]); 1364 1365 /* Symbols defined for compatibility with previous versions of the HDF5 API. 1366 * 1367 * Use of these symbols is deprecated. 1368 */ 1369 #ifndef H5_NO_DEPRECATED_SYMBOLS 1370 /* Function prototypes */ 1371 /* --------------------------------------------------------------------------*/ 1372 /**\ingroup H5S 1373 * 1374 * \brief Encodes a data space object description into a binary buffer 1375 * 1376 * \space_id{obj_id} 1377 * \param[in,out] buf Buffer for the object to be encoded into; 1378 * If the provided buffer is NULL, only the size of 1379 * buffer needed is returned through \p nalloc. 1380 * \param[in,out] nalloc The size of the allocated buffer 1381 * 1382 * \return \herr_t 1383 * 1384 * \deprecated Deprecated in favor of H5Sencode2() 1385 * 1386 * \details Given the data space identifier \p obj_id, H5Sencode1() converts 1387 * a data space description into binary form in a buffer. Using 1388 * this binary form in the buffer, a data space object can be 1389 * reconstructed using H5Sdecode() to return a new object handle 1390 * (\p hid_t) for this data space. 1391 * 1392 * A preliminary H5Sencode1() call can be made to find out the size 1393 * of the buffer needed. This value is returned as \p nalloc. That 1394 * value can then be assigned to \p nalloc for a second H5Sencode1() 1395 * call, which will retrieve the actual encoded object. 1396 * 1397 * If the library finds out \p nalloc is not big enough for the 1398 * object, it simply returns the size of the buffer needed through 1399 * \p nalloc without encoding the provided buffer. 1400 * 1401 * The types of data space addressed in this function are null, 1402 * scalar, and simple space. For a simple data space, the information 1403 * on the selection, for example, hyperslab selection, is also 1404 * encoded and decoded. A complex data space has not been 1405 * implemented in the library. 1406 * 1407 * \version 1.12.0 The function H5Sencode() was renamed H5Sencode1() and 1408 * deprecated. 1409 * \since 1.8.0 1410 * 1411 */ 1412 H5_DLL herr_t H5Sencode1(hid_t obj_id, void *buf, size_t *nalloc); 1413 1414 #endif /* H5_NO_DEPRECATED_SYMBOLS */ 1415 1416 #ifdef __cplusplus 1417 } 1418 #endif 1419 #endif /* H5Spublic_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |