HDF5  1.12.0
H5EAprivate.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*-------------------------------------------------------------------------
15  *
16  * Created: H5EAprivate.h
17  * Jun 17 2008
18  * Quincey Koziol <koziol@hdfgroup.org>
19  *
20  * Purpose: Private header for library accessible extensible
21  * array routines.
22  *
23  *-------------------------------------------------------------------------
24  */
25 
26 #ifndef _H5EAprivate_H
27 #define _H5EAprivate_H
28 
29 /* Include package's public header */
30 #ifdef NOT_YET
31 #include "H5EApublic.h"
32 #endif /* NOT_YET */
33 
34 /* Private headers needed by this file */
35 #include "H5ACprivate.h" /* Metadata cache */
36 #include "H5Fprivate.h" /* File access */
37 
38 
39 /**************************/
40 /* Library Private Macros */
41 /**************************/
42 
43 
44 /****************************/
45 /* Library Private Typedefs */
46 /****************************/
47 
48 /* Extensible array class IDs */
49 typedef enum H5EA_cls_id_t {
50  H5EA_CLS_CHUNK_ID = 0, /* Extensible array is for indexing dataset chunks w/o filters */
51  H5EA_CLS_FILT_CHUNK_ID, /* Extensible array is for indexing dataset chunks w/filters */
52 
53  /* Start real class IDs at 0 -QAK */
54  /* (keep these last) */
55  H5EA_CLS_TEST_ID, /* Extensible array is for testing (do not use for actual data) */
56  H5EA_NUM_CLS_ID /* Number of Extensible Array class IDs (must be last) */
58 
59 /*
60  * Each type of element that can be stored in an extesible array has a
61  * variable of this type that contains class variables and methods.
62  */
63 typedef struct H5EA_class_t {
64  H5EA_cls_id_t id; /* ID of Extensible Array class, as found in file */
65  const char *name; /* Name of class (for debugging) */
66  size_t nat_elmt_size; /* Size of native (memory) element */
67 
68  /* Extensible array client callback methods */
69  void *(*crt_context)(void *udata); /* Create context for other callbacks */
70  herr_t (*dst_context)(void *ctx); /* Destroy context */
71  herr_t (*fill)(void *nat_blk, size_t nelmts); /* Fill array of elements with encoded form of "missing element" value */
72  herr_t (*encode)(void *raw, const void *elmt, size_t nelmts, void *ctx); /* Encode elements from native form to disk storage form */
73  herr_t (*decode)(const void *raw, void *elmt, size_t nelmts, void *ctx); /* Decode elements from disk storage form to native form */
74  herr_t (*debug)(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); /* Print an element for debugging */
75  void *(*crt_dbg_ctx)(H5F_t *f, haddr_t obj_addr); /* Create debugging context */
76  herr_t (*dst_dbg_ctx)(void *dbg_ctx); /* Destroy debugging context */
78 
79 /* Extensible array creation parameters */
80 typedef struct H5EA_create_t {
81  const H5EA_class_t *cls; /* Class of extensible array to create */
82  uint8_t raw_elmt_size; /* Element size in file (in bytes) */
83  uint8_t max_nelmts_bits; /* Log2(Max. # of elements in array) - i.e. # of bits needed to store max. # of elements */
84  uint8_t idx_blk_elmts; /* # of elements to store in index block */
85  uint8_t data_blk_min_elmts; /* Min. # of elements per data block */
86  uint8_t sup_blk_min_data_ptrs; /* Min. # of data block pointers for a super block */
87  uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */
89 
90 /* Extensible array metadata statistics info */
91 /* (If these are ever exposed to applications, don't let the application see
92  * which fields are computed vs. which fields are stored. -QAK)
93  */
94 typedef struct H5EA_stat_t {
95  /* Non-stored (i.e. computed) fields */
96  struct {
97  hsize_t hdr_size; /* Size of header */
98  hsize_t nindex_blks; /* # of index blocks (should be 0 or 1) */
99  hsize_t index_blk_size; /* Size of index blocks allocated */
101 
102  /* Stored fields */
103  struct {
104  hsize_t nsuper_blks; /* # of super blocks */
105  hsize_t super_blk_size; /* Size of super blocks allocated */
106  hsize_t ndata_blks; /* # of data blocks */
107  hsize_t data_blk_size; /* Size of data blocks allocated */
108  hsize_t max_idx_set; /* Highest element index stored (+1 - i.e. if element 0 has been set, this value with be '1', if no elements have been stored, this value will be '0') */
109  hsize_t nelmts; /* # of elements "realized" */
112 
113 /* Extensible array info (forward decl - defined in H5EApkg.h) */
114 typedef struct H5EA_t H5EA_t;
115 
116 /* Define the operator callback function pointer for H5EA_iterate() */
117 typedef int (*H5EA_operator_t)(hsize_t idx, const void *_elmt, void *_udata);
118 
119 
120 /*****************************/
121 /* Library-private Variables */
122 /*****************************/
123 
124 /* The Extensible Array class for dataset chunks w/o filters*/
126 
127 /* The Extensible Array class for dataset chunks w/ filters*/
129 
130 
131 /***************************************/
132 /* Library-private Function Prototypes */
133 /***************************************/
134 
135 /* General routines */
137  void *ctx_udata);
138 H5_DLL H5EA_t *H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata);
141 H5_DLL herr_t H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt);
142 H5_DLL herr_t H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt);
146 H5_DLL herr_t H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata);
148 
149 /* Statistics routines */
151 
152 /* Debugging routines */
153 #ifdef H5EA_DEBUGGING
154 #endif /* H5EA_DEBUGGING */
155 
156 #endif /* _H5EAprivate_H */
157 
f
hdr f
Definition: H5EA.c:755
H5EA_stat_t::nindex_blks
hsize_t nindex_blks
Definition: H5EAprivate.h:98
H5EA_class_t::decode
herr_t(* decode)(const void *raw, void *elmt, size_t nelmts, void *ctx)
Definition: H5EAprivate.h:73
H5EA_get_addr
H5_DLL herr_t H5EA_get_addr(const H5EA_t *ea, haddr_t *addr)
H5EA_stat_t::computed
struct H5EA_stat_t::@5 computed
H5EA_get_nelmts
H5_DLL herr_t H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts)
H5EA_CLS_CHUNK
H5_DLLVAR const H5EA_class_t H5EA_CLS_CHUNK[1]
Definition: H5EAprivate.h:125
H5EA_class_t::dst_dbg_ctx
herr_t(* dst_dbg_ctx)(void *dbg_ctx)
Definition: H5EAprivate.h:76
H5EA_create_t::sup_blk_min_data_ptrs
uint8_t sup_blk_min_data_ptrs
Definition: H5EAprivate.h:86
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
H5EA_create
H5_DLL H5EA_t * H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata)
indent
*s *s indent
Definition: H5HLdbg.c:111
H5EA_create_t::cls
const H5EA_class_t * cls
Definition: H5EAprivate.h:81
H5EA_get_stats
H5_DLL herr_t H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats)
H5EA_close
H5_DLL herr_t H5EA_close(H5EA_t *ea)
H5_DLLVAR
#define H5_DLLVAR
Definition: H5api_adpt.h:235
H5EA_cls_id_t
H5EA_cls_id_t
Definition: H5EAprivate.h:49
H5EA_class_t::id
H5EA_cls_id_t id
Definition: H5EAprivate.h:64
ea
ea
Definition: H5EA.c:925
H5EA_stat_t::stored
struct H5EA_stat_t::@6 stored
H5EA_stat_t::nelmts
hsize_t nelmts
Definition: H5EAprivate.h:109
H5EA_class_t
struct H5EA_class_t H5EA_class_t
uint8_t
unsigned char uint8_t
Definition: H5private.h:429
H5AC_proxy_entry_t
Definition: H5ACprivate.h:203
H5EA_create_t::max_dblk_page_nelmts_bits
uint8_t max_dblk_page_nelmts_bits
Definition: H5EAprivate.h:87
H5EA_class_t::debug
herr_t(* debug)(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt)
Definition: H5EAprivate.h:74
H5EA_class_t::encode
herr_t(* encode)(void *raw, const void *elmt, size_t nelmts, void *ctx)
Definition: H5EAprivate.h:72
H5EA_class_t::name
const char * name
Definition: H5EAprivate.h:65
H5EA_open
H5_DLL H5EA_t * H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata)
H5EA_stat_t::nsuper_blks
hsize_t nsuper_blks
Definition: H5EAprivate.h:104
H5EA_CLS_TEST_ID
@ H5EA_CLS_TEST_ID
Definition: H5EAprivate.h:55
H5EA_operator_t
int(* H5EA_operator_t)(hsize_t idx, const void *_elmt, void *_udata)
Definition: H5EAprivate.h:117
H5EA_class_t::dst_context
herr_t(* dst_context)(void *ctx)
Definition: H5EAprivate.h:70
H5EA_stat_t
struct H5EA_stat_t H5EA_stat_t
H5EA_NUM_CLS_ID
@ H5EA_NUM_CLS_ID
Definition: H5EAprivate.h:56
H5EA_create_t::raw_elmt_size
uint8_t raw_elmt_size
Definition: H5EAprivate.h:82
H5EA_set
H5_DLL herr_t H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt)
FILE
Invalid arguments to routine Resource unavailable Internal File accessibility Low level I O Function entry exit Object atom Object cache Links B Tree node Symbol table Heap Object header Datatype Dataspace Dataset Data storage Property lists Attribute Data filters External file list References Virtual File Layer Virtual Object Layer Ternary Search Trees Reference Counted Strings Error API Skip Lists Free Space Manager Shared Object Header Messages Extensible Array Fixed Array Plugin for dynamically loaded library Page Buffering API Context Map No error Argument errors Resource errors File accessibility errors FILE
Definition: H5err.txt:88
H5ACprivate.h
H5EA_stat_t::super_blk_size
hsize_t super_blk_size
Definition: H5EAprivate.h:105
H5EA_CLS_CHUNK_ID
@ H5EA_CLS_CHUNK_ID
Definition: H5EAprivate.h:50
H5EA_CLS_FILT_CHUNK_ID
@ H5EA_CLS_FILT_CHUNK_ID
Definition: H5EAprivate.h:51
H5EA_class_t::nat_elmt_size
size_t nat_elmt_size
Definition: H5EAprivate.h:66
int
CATCH int
Definition: H5EA.c:1002
H5Fprivate.h
fwidth
*s *s fwidth
Definition: H5HLdbg.c:111
H5EA_create_t::max_nelmts_bits
uint8_t max_nelmts_bits
Definition: H5EAprivate.h:83
H5EA_depend
H5_DLL herr_t H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent)
H5EA_class_t
Definition: H5EAprivate.h:63
H5EA_create_t
Definition: H5EAprivate.h:80
H5EA_iterate
H5_DLL herr_t H5EA_iterate(H5EA_t *fa, H5EA_operator_t op, void *udata)
H5EA_create_t::idx_blk_elmts
uint8_t idx_blk_elmts
Definition: H5EAprivate.h:84
H5EA_CLS_FILT_CHUNK
H5_DLLVAR const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]
Definition: H5EAprivate.h:128
H5EA_stat_t::index_blk_size
hsize_t index_blk_size
Definition: H5EAprivate.h:99
H5EA_class_t::fill
herr_t(* fill)(void *nat_blk, size_t nelmts)
Definition: H5EAprivate.h:71
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5EA_stat_t::ndata_blks
hsize_t ndata_blks
Definition: H5EAprivate.h:106
H5EA_create_t
struct H5EA_create_t H5EA_create_t
H5EA_t
Definition: H5EApkg.h:331
H5EA_patch_file
H5_DLL herr_t H5EA_patch_file(H5EA_t *fa, H5F_t *f)
H5EA_stat_t::data_blk_size
hsize_t data_blk_size
Definition: H5EAprivate.h:107
H5F_t
Definition: H5Fpkg.h:374
H5EA_delete
H5_DLL herr_t H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata)
nelmts
hdr stats stored nelmts
Definition: H5EAdblock.c:214
H5EA_stat_t::hdr_size
hsize_t hdr_size
Definition: H5EAprivate.h:97
H5EA_stat_t::max_idx_set
hsize_t max_idx_set
Definition: H5EAprivate.h:108
herr_t
int herr_t
Definition: H5public.h:128
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5EA_create_t::data_blk_min_elmts
uint8_t data_blk_min_elmts
Definition: H5EAprivate.h:85
H5EA_stat_t
Definition: H5EAprivate.h:94
H5EA_get
H5_DLL herr_t H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt)