![]() |
|
|||
File indexing completed on 2025-04-18 09:16:03
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 H5I (ID management) developer 0015 * support routines. 0016 */ 0017 0018 #ifndef H5Idevelop_H 0019 #define H5Idevelop_H 0020 0021 /* Include package's public header */ 0022 #include "H5Ipublic.h" /* ID management */ 0023 0024 /*****************/ 0025 /* Public Macros */ 0026 /*****************/ 0027 0028 /*******************/ 0029 /* Public Typedefs */ 0030 /*******************/ 0031 0032 /** 0033 * The type of the realize_cb callback for H5Iregister_future 0034 */ 0035 //! <!-- [H5I_future_realize_func_t_snip] --> 0036 typedef herr_t (*H5I_future_realize_func_t)(void *future_object, hid_t *actual_object_id); 0037 //! <!-- [H5I_future_realize_func_t_snip] --> 0038 0039 /** 0040 * The type of the discard_cb callback for H5Iregister_future 0041 */ 0042 //! <!-- [H5I_future_discard_func_t_snip] --> 0043 typedef herr_t (*H5I_future_discard_func_t)(void *future_object); 0044 //! <!-- [H5I_future_discard_func_t_snip] --> 0045 0046 /********************/ 0047 /* Public Variables */ 0048 /********************/ 0049 0050 /*********************/ 0051 /* Public Prototypes */ 0052 /*********************/ 0053 0054 #ifdef __cplusplus 0055 extern "C" { 0056 #endif 0057 0058 /** 0059 * \ingroup H5I 0060 * 0061 * \brief Registers a "future" object under a type and returns an ID for it 0062 * 0063 * \param[in] type The identifier of the type of the new ID 0064 * \param[in] object Pointer to "future" object for which a new ID is created 0065 * \param[in] realize_cb Function pointer to realize a future object 0066 * \param[in] discard_cb Function pointer to destroy a future object 0067 * 0068 * \return \hid_t{object} 0069 * 0070 * \details H5Iregister_future() creates and returns a new ID for a "future" object. 0071 * Future objects are a special kind of object and represent a 0072 * placeholder for an object that has not yet been created or opened. 0073 * The \p realize_cb will be invoked by the HDF5 library to 'realize' 0074 * the future object as an actual object. A call to H5Iobject_verify() 0075 * will invoke the \p realize_cb callback and if it successfully 0076 * returns, will return the actual object, not the future object. 0077 * 0078 * \details The \p type parameter is the identifier for the ID type to which 0079 * this new future ID will belong. This identifier may have been created 0080 * by a call to H5Iregister_type() or may be one of the HDF5 pre-defined 0081 * ID classes (e.g. H5I_FILE, H5I_GROUP, H5I_DATASPACE, etc). 0082 * 0083 * \details The \p object parameter is a pointer to the memory which the new ID 0084 * will be a reference to. This pointer will be stored by the library, 0085 * but will not be returned to a call to H5Iobject_verify() until the 0086 * \p realize_cb callback has returned the actual pointer for the object. 0087 * 0088 * A NULL value for \p object is allowed. 0089 * 0090 * \details The \p realize_cb parameter is a function pointer that will be 0091 * invoked by the HDF5 library to convert a future object into an 0092 * actual object. The \p realize_cb function may be invoked by 0093 * H5Iobject_verify() to return the actual object for a user-defined 0094 * ID class (i.e. an ID class registered with H5Iregister_type()) or 0095 * internally by the HDF5 library in order to use or get information 0096 * from an HDF5 pre-defined ID type. For example, the \p realize_cb 0097 * for a future dataspace object will be called during the process 0098 * of returning information from H5Sget_simple_extent_dims(). 0099 * 0100 * Note that although the \p realize_cb routine returns 0101 * an ID (as a parameter) for the actual object, the HDF5 library 0102 * will swap the actual object in that ID for the future object in 0103 * the future ID. This ensures that the ID value for the object 0104 * doesn't change for the user when the object is realized. 0105 * 0106 * Note that the \p realize_cb callback could receive a NULL value 0107 * for a future object pointer, if one was used when H5Iregister_future() 0108 * was initially called. This is permitted as a means of allowing 0109 * the \p realize_cb to act as a generator of new objects, without 0110 * requiring creation of unnecessary future objects. 0111 * 0112 * It is an error to pass NULL for \p realize_cb. 0113 * 0114 * \details The \p discard_cb parameter is a function pointer that will be 0115 * invoked by the HDF5 library to destroy a future object. This 0116 * callback will always be invoked for _every_ future object, whether 0117 * the \p realize_cb is invoked on it or not. It's possible that 0118 * the \p discard_cb is invoked on a future object without the 0119 * \p realize_cb being invoked, e.g. when a future ID is closed without 0120 * requiring the future object to be realized into an actual one. 0121 * 0122 * Note that the \p discard_cb callback could receive a NULL value 0123 * for a future object pointer, if one was used when H5Iregister_future() 0124 * was initially called. 0125 * 0126 * It is an error to pass NULL for \p discard_cb. 0127 * 0128 * \note The H5Iregister_future() function is primarily targeted at VOL connector 0129 * authors and is _not_ designed for general-purpose application use. 0130 * 0131 * \since 1.14.0 0132 * 0133 */ 0134 H5_DLL hid_t H5Iregister_future(H5I_type_t type, const void *object, H5I_future_realize_func_t realize_cb, 0135 H5I_future_discard_func_t discard_cb); 0136 0137 #ifdef __cplusplus 0138 } 0139 #endif 0140 0141 #endif /* H5Idevelop_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |