00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _H5B2private_H
00028 #define _H5B2private_H
00029
00030
00031 #include "H5B2public.h"
00032
00033
00034 #include "H5Fprivate.h"
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 typedef enum H5B2_subid_t {
00047 H5B2_TEST_ID = 0,
00048 H5B2_FHEAP_HUGE_INDIR_ID,
00049 H5B2_FHEAP_HUGE_FILT_INDIR_ID,
00050 H5B2_FHEAP_HUGE_DIR_ID,
00051 H5B2_FHEAP_HUGE_FILT_DIR_ID,
00052 H5B2_GRP_DENSE_NAME_ID,
00053 H5B2_GRP_DENSE_CORDER_ID,
00054 H5B2_SOHM_INDEX_ID,
00055 H5B2_ATTR_DENSE_NAME_ID,
00056 H5B2_ATTR_DENSE_CORDER_ID,
00057 H5B2_NUM_BTREE_ID
00058 } H5B2_subid_t;
00059
00060
00061 typedef int (*H5B2_operator_t)(const void *record, void *op_data);
00062
00063
00064 typedef herr_t (*H5B2_found_t)(const void *record, void *op_data);
00065
00066
00067 typedef herr_t (*H5B2_modify_t)(void *record, void *op_data, hbool_t *changed);
00068
00069
00070 typedef herr_t (*H5B2_remove_t)(const void *record, void *op_data);
00071
00072
00073 typedef enum H5B2_compare_t {
00074 H5B2_COMPARE_LESS,
00075 H5B2_COMPARE_GREATER
00076 } H5B2_compare_t;
00077
00078
00079
00080
00081
00082 typedef struct H5B2_class_t H5B2_class_t;
00083 struct H5B2_class_t {
00084 H5B2_subid_t id;
00085 const char *name;
00086 size_t nrec_size;
00087
00088
00089 void *(*crt_context)(void *udata);
00090 herr_t (*dst_context)(void *ctx);
00091 herr_t (*store)(void *nrecord, const void *udata);
00092 herr_t (*compare)(const void *rec1, const void *rec2);
00093 herr_t (*encode)(uint8_t *raw, const void *record, void *ctx);
00094 herr_t (*decode)(const uint8_t *raw, void *record, void *ctx);
00095 herr_t (*debug)(FILE *stream, const H5F_t *f, hid_t dxpl_id,
00096 int indent, int fwidth, const void *record, const void *udata);
00097 void *(*crt_dbg_ctx)(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr);
00098 herr_t (*dst_dbg_ctx)(void *dbg_ctx);
00099 };
00100
00101
00102 typedef struct H5B2_create_t {
00103 const H5B2_class_t *cls;
00104 uint32_t node_size;
00105 uint32_t rrec_size;
00106 uint8_t split_percent;
00107 uint8_t merge_percent;
00108 } H5B2_create_t;
00109
00110
00111 typedef struct H5B2_stat_t {
00112 unsigned depth;
00113 hsize_t nrecords;
00114 } H5B2_stat_t;
00115
00116
00117 typedef struct H5B2_t H5B2_t;
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 H5_DLL H5B2_t *H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam,
00129 void *ctx_udata);
00130 H5_DLL H5B2_t *H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata);
00131 H5_DLL herr_t H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr);
00132 H5_DLL herr_t H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata);
00133 H5_DLL herr_t H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op,
00134 void *op_data);
00135 H5_DLL htri_t H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata,
00136 H5B2_found_t op, void *op_data);
00137 H5_DLL herr_t H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order,
00138 hsize_t idx, H5B2_found_t op, void *op_data);
00139 H5_DLL herr_t H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range,
00140 void *udata, H5B2_found_t op, void *op_data);
00141 H5_DLL herr_t H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata,
00142 H5B2_modify_t op, void *op_data);
00143 H5_DLL herr_t H5B2_remove(H5B2_t *b2, hid_t dxpl_id, void *udata,
00144 H5B2_remove_t op, void *op_data);
00145 H5_DLL herr_t H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id,
00146 H5_iter_order_t order, hsize_t idx, H5B2_remove_t op, void *op_data);
00147 H5_DLL herr_t H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec);
00148 H5_DLL herr_t H5B2_size(H5B2_t *bt2, hid_t dxpl_id,
00149 hsize_t *btree_size);
00150 H5_DLL herr_t H5B2_close(H5B2_t *bt2, hid_t dxpl_id);
00151 H5_DLL herr_t H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr,
00152 void *ctx_udata, H5B2_remove_t op, void *op_data);
00153
00154
00155 H5_DLL herr_t H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info);
00156
00157 #endif
00158