Compare commits
904 Commits
hdf5_1_8_1
...
hdf5-1_6_3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68d88b2cf7 | ||
|
|
047be918c8 | ||
|
|
6481d1a82e | ||
|
|
9636e858cb | ||
|
|
ccbfd8d259 | ||
|
|
6e9fcb709f | ||
|
|
f8d297734b | ||
|
|
a4d1dde47a | ||
|
|
243001c468 | ||
|
|
69b9488a31 | ||
|
|
e9affeefa5 | ||
|
|
5ae98779b0 | ||
|
|
cb9f6774a4 | ||
|
|
2e9f69a5b3 | ||
|
|
099ce40c91 | ||
|
|
8a57915e8f | ||
|
|
363ef14909 | ||
|
|
144aecbf93 | ||
|
|
48b492d4d7 | ||
|
|
3e6fec59f7 | ||
|
|
16a1163f6b | ||
|
|
23ed135d0a | ||
|
|
51397b43ba | ||
|
|
17bcf55a5b | ||
|
|
8844285732 | ||
|
|
55caa464ca | ||
|
|
6a22c19d24 | ||
|
|
e9af913810 | ||
|
|
1ff51be807 | ||
|
|
a7f691dc8e | ||
|
|
8ebc0cd7f9 | ||
|
|
7228f44127 | ||
|
|
8552b3e571 | ||
|
|
a3381d37d8 | ||
|
|
18ba9f93ba | ||
|
|
b45920cb8b | ||
|
|
16e904e22a | ||
|
|
5da54649fb | ||
|
|
1dd5d9e44a | ||
|
|
e0ef078a93 | ||
|
|
48339a4e26 | ||
|
|
6a9aebbc41 | ||
|
|
3a7e970908 | ||
|
|
eea7dc291e | ||
|
|
1f7898a283 | ||
|
|
9af04a05bb | ||
|
|
7dd3ed2f7b | ||
|
|
7db64a9d02 | ||
|
|
f58d981d6f | ||
|
|
52b9f5c4f7 | ||
|
|
8a82aa889f | ||
|
|
f422ba9c98 | ||
|
|
518d5ae6a8 | ||
|
|
c7364155af | ||
|
|
5bf2422ec6 | ||
|
|
85f1a65414 | ||
|
|
b7ee471d77 | ||
|
|
03fcb6d13e | ||
|
|
49431e72f8 | ||
|
|
9b4a772bae | ||
|
|
9619e0c62a | ||
|
|
9de008dcdf | ||
|
|
70d3e2cb5b | ||
|
|
9b82f95005 | ||
|
|
bf22056ecd | ||
|
|
1802494959 | ||
|
|
17d65263b9 | ||
|
|
8798e30eef | ||
|
|
c468f78ec1 | ||
|
|
8976c88c71 | ||
|
|
2a8dc0a135 | ||
|
|
e9c038fcff | ||
|
|
abed0bd5a0 | ||
|
|
a266107f0d | ||
|
|
d0bc7e5274 | ||
|
|
c0838b2ae5 | ||
|
|
b9101e4195 | ||
|
|
b6183b2a51 | ||
|
|
8dca875987 | ||
|
|
e05cf04e3f | ||
|
|
ec217c4eb9 | ||
|
|
9c2e22f136 | ||
|
|
f301c2928b | ||
|
|
bc7d82ab16 | ||
|
|
0f60918a11 | ||
|
|
d5aff3652b | ||
|
|
3be80cc1f0 | ||
|
|
6c87077c74 | ||
|
|
da9fd4bb18 | ||
|
|
2202352d28 | ||
|
|
448da32994 | ||
|
|
15a195b4df | ||
|
|
900d6b4109 | ||
|
|
85074943fe | ||
|
|
4766cfd583 | ||
|
|
4ab8e6ece8 | ||
|
|
c7e907a359 | ||
|
|
2bad6974f2 | ||
|
|
0b7973c292 | ||
|
|
9795b68ae5 | ||
|
|
8180c44531 | ||
|
|
d00e416732 | ||
|
|
fd7afc2d4b | ||
|
|
928ddb9463 | ||
|
|
76b1ae5950 | ||
|
|
2f6b3eadf7 | ||
|
|
a01d41a74c | ||
|
|
01fd9a0163 | ||
|
|
e2ed7dc26a | ||
|
|
d07edb2123 | ||
|
|
6a9e054486 | ||
|
|
91d35f09f8 | ||
|
|
6bedc7a729 | ||
|
|
df7f7f48e2 | ||
|
|
31a5595bd5 | ||
|
|
03c1156cd9 | ||
|
|
2543070d31 | ||
|
|
ce7473dee5 | ||
|
|
cdc33df1a8 | ||
|
|
77ecfceede | ||
|
|
cc034573b1 | ||
|
|
9a16096082 | ||
|
|
19cb3b5ae7 | ||
|
|
d3e91f2689 | ||
|
|
d86efabc13 | ||
|
|
200f4c079f | ||
|
|
907dbc770a | ||
|
|
8d40aa83cf | ||
|
|
f69b447fab | ||
|
|
fdb18b7e22 | ||
|
|
2a8b7d7bfd | ||
|
|
e30878da87 | ||
|
|
21041c8d56 | ||
|
|
1eea438567 | ||
|
|
3bacab3bb5 | ||
|
|
6af12ac282 | ||
|
|
29dd55a197 | ||
|
|
88c4523ac2 | ||
|
|
460927cf81 | ||
|
|
cb7a720fac | ||
|
|
fa2f99e642 | ||
|
|
7d636b8269 | ||
|
|
6ce8bab631 | ||
|
|
7de4101d12 | ||
|
|
4dfae9e897 | ||
|
|
03ddea6cda | ||
|
|
407feb412a | ||
|
|
82af9859ef | ||
|
|
ebd477c930 | ||
|
|
1b47c2a677 | ||
|
|
92f2899160 | ||
|
|
393a51eb92 | ||
|
|
68674a90ad | ||
|
|
3069dd3d88 | ||
|
|
f9e414bc75 | ||
|
|
5a7fcfa213 | ||
|
|
6936f40fb8 | ||
|
|
0da9b3db8d | ||
|
|
619d3b02d1 | ||
|
|
f7d9933431 | ||
|
|
8cf233090f | ||
|
|
88997338e6 | ||
|
|
8a4404945b | ||
|
|
ee5ce4a27f | ||
|
|
1276bcc432 | ||
|
|
c17fb6fa1d | ||
|
|
db1239f17d | ||
|
|
94fb43379a | ||
|
|
462efe1cc7 | ||
|
|
7aeee0a929 | ||
|
|
28ab722e86 | ||
|
|
71e29531eb | ||
|
|
0335f6948a | ||
|
|
8885c892be | ||
|
|
ac207ffe07 | ||
|
|
e39f5dc559 | ||
|
|
89405db2ea | ||
|
|
eb06a7c95b | ||
|
|
71ffe29679 | ||
|
|
2ac16dbb1c | ||
|
|
2df5bf7e31 | ||
|
|
f709fe884f | ||
|
|
d46c6a80ce | ||
|
|
2a36f1b1d2 | ||
|
|
34cbb564af | ||
|
|
af7def1357 | ||
|
|
ded3a312e7 | ||
|
|
8a594dbff5 | ||
|
|
529c7b27c7 | ||
|
|
f8b2efd52d | ||
|
|
75d5d0ec17 | ||
|
|
8db2c48438 | ||
|
|
3eb4dc3b4f | ||
|
|
c8c0400412 | ||
|
|
464c27172b | ||
|
|
fddc43caad | ||
|
|
e8671d70c3 | ||
|
|
2f28978053 | ||
|
|
fab82e54da | ||
|
|
232e5f7366 | ||
|
|
4b8a6687f6 | ||
|
|
5f8a9d5dd2 | ||
|
|
d9235366bb | ||
|
|
33cf994614 | ||
|
|
1b77f23dc2 | ||
|
|
52563e6fa8 | ||
|
|
6dae05b645 | ||
|
|
1382bb2b20 | ||
|
|
954e4f4817 | ||
|
|
231d363a5c | ||
|
|
35d0fabefd | ||
|
|
631e94869b | ||
|
|
881ba16bca | ||
|
|
8b866d0e85 | ||
|
|
acdd4e1d3f | ||
|
|
062decfdce | ||
|
|
8d843938ba | ||
|
|
12ee450f70 | ||
|
|
77ac102e43 | ||
|
|
ba5b63d231 | ||
|
|
a12aaab67f | ||
|
|
475718eb24 | ||
|
|
795cb2b1ed | ||
|
|
184a7aba5e | ||
|
|
a013116c4d | ||
|
|
031fa6696d | ||
|
|
c106102b9a | ||
|
|
4e98e2d19a | ||
|
|
7dc938f649 | ||
|
|
c157f86368 | ||
|
|
c911905f27 | ||
|
|
f75ed67d2b | ||
|
|
7547be91e5 | ||
|
|
1b0b9048b7 | ||
|
|
b79142ca2b | ||
|
|
0f985ebb0a | ||
|
|
f81bf3b56f | ||
|
|
c1666563b7 | ||
|
|
5bc3314c9b | ||
|
|
909b3f6bea | ||
|
|
a6889aa255 | ||
|
|
a8994e3c71 | ||
|
|
d59d7be140 | ||
|
|
d89d73048a | ||
|
|
f0fe9b0114 | ||
|
|
b67740452b | ||
|
|
87a59c6f1c | ||
|
|
2eaa20781d | ||
|
|
fa3be978e5 | ||
|
|
e240c00154 | ||
|
|
0b2827f9ce | ||
|
|
81f50b436d | ||
|
|
45cd1e2e8b | ||
|
|
9e7fcd24e3 | ||
|
|
d50d5cae24 | ||
|
|
10bae2c875 | ||
|
|
83ff4069fd | ||
|
|
34d1d056c9 | ||
|
|
ce2c695798 | ||
|
|
93f724cecf | ||
|
|
6beaf50c8f | ||
|
|
9437a26865 | ||
|
|
65cf95ab06 | ||
|
|
3062c4dd1e | ||
|
|
636fc2be4a | ||
|
|
3b01516da6 | ||
|
|
3eeb0d9d54 | ||
|
|
e8cb6650ca | ||
|
|
7361049db1 | ||
|
|
d4777031e9 | ||
|
|
d02acc8f60 | ||
|
|
8d7e8124f1 | ||
|
|
2afbcb2f0e | ||
|
|
c889f67f9c | ||
|
|
01c549696d | ||
|
|
69302997ac | ||
|
|
10289819c7 | ||
|
|
46e30acda1 | ||
|
|
2cc37b9460 | ||
|
|
208f5631d3 | ||
|
|
22d442825b | ||
|
|
513012e673 | ||
|
|
e29eb9c99d | ||
|
|
3897645d92 | ||
|
|
9c19127e54 | ||
|
|
d100f26a7c | ||
|
|
ee3fbc240d | ||
|
|
6f0f86aa3f | ||
|
|
dcb8bc3f1c | ||
|
|
5ccfe5a724 | ||
|
|
700a3f0b3c | ||
|
|
23ea43d9c8 | ||
|
|
10834e1e8f | ||
|
|
822af258c7 | ||
|
|
ddb825f2a8 | ||
|
|
e0d268380a | ||
|
|
f0eb18d140 | ||
|
|
09dd5e1625 | ||
|
|
25d4f9b024 | ||
|
|
eb0f44eee9 | ||
|
|
1e6d66909c | ||
|
|
3ee761cfa8 | ||
|
|
122b313734 | ||
|
|
ab97da906a | ||
|
|
6d682a5a28 | ||
|
|
903580837a | ||
|
|
7438a71a0b | ||
|
|
a9c3f57785 | ||
|
|
5935247f99 | ||
|
|
3fe2e8a513 | ||
|
|
9b84be1422 | ||
|
|
c95b683457 | ||
|
|
cdf28fd58f | ||
|
|
1dc234fd96 | ||
|
|
38b0c5f558 | ||
|
|
09ee6ebc4c | ||
|
|
d6bb759cbd | ||
|
|
79184f310f | ||
|
|
0eb01e1a42 | ||
|
|
a782fe28ed | ||
|
|
da4021c41d | ||
|
|
bb5ed44dd6 | ||
|
|
ad9a4a2d97 | ||
|
|
1bb801fe2f | ||
|
|
25a80ea2dc | ||
|
|
5d2983abf6 | ||
|
|
0ed0224142 | ||
|
|
ec6ff32ec7 | ||
|
|
65370b8417 | ||
|
|
a7f0ce8fc5 | ||
|
|
49c1c57ee1 | ||
|
|
a0fe318aac | ||
|
|
33a566ea9b | ||
|
|
d66de6e699 | ||
|
|
1b919a11da | ||
|
|
ffbd43d88b | ||
|
|
3247aa351e | ||
|
|
69a63b02bc | ||
|
|
17850cf50b | ||
|
|
6ed61e5dda | ||
|
|
737f79b5da | ||
|
|
6e2c92c082 | ||
|
|
0a12b3ae33 | ||
|
|
7dfe108b53 | ||
|
|
a3668504d9 | ||
|
|
8735902ea3 | ||
|
|
2a59a4ca3d | ||
|
|
bec53eb4ce | ||
|
|
8376ccdd97 | ||
|
|
af155fcfb3 | ||
|
|
747ff12449 | ||
|
|
0e1d8e3977 | ||
|
|
3382eea1da | ||
|
|
b795b5bf2e | ||
|
|
f4492a33c1 | ||
|
|
2a7d7e5121 | ||
|
|
02d3fef648 | ||
|
|
c4d6057361 | ||
|
|
d79a4d6a38 | ||
|
|
9df18ff5bb | ||
|
|
896cd2e17d | ||
|
|
cf3dbfc245 | ||
|
|
82187ebb09 | ||
|
|
0b8cbb89e1 | ||
|
|
5c2b09a88c | ||
|
|
8b6abe7b2d | ||
|
|
9889d390c5 | ||
|
|
6a672a783b | ||
|
|
95eeb50f0f | ||
|
|
9cd4e394db | ||
|
|
60c6500fad | ||
|
|
085f120d19 | ||
|
|
689cc09294 | ||
|
|
24ccbea9f3 | ||
|
|
7d9e9bced3 | ||
|
|
b4ac48552d | ||
|
|
fbe777b67a | ||
|
|
b0cde675fe | ||
|
|
daa241c422 | ||
|
|
6e6760216b | ||
|
|
66be6f05d4 | ||
|
|
fd07138459 | ||
|
|
4ba7a0e373 | ||
|
|
02e561fa97 | ||
|
|
7912d54d4d | ||
|
|
b770b9065d | ||
|
|
c62c0eb9d2 | ||
|
|
9edb2fcc8d | ||
|
|
6d1993fdf4 | ||
|
|
7e5b1ce185 | ||
|
|
c385536b9e | ||
|
|
d765d42718 | ||
|
|
b195382de7 | ||
|
|
f53197332d | ||
|
|
61f3aed0ec | ||
|
|
bc2386faeb | ||
|
|
664d327923 | ||
|
|
9f93209aee | ||
|
|
70686065d0 | ||
|
|
aec19e771d | ||
|
|
0660f8b63b | ||
|
|
8f0a7d9465 | ||
|
|
f3b26a8ce9 | ||
|
|
19704681e1 | ||
|
|
f0c2b247e2 | ||
|
|
948a94f2be | ||
|
|
820a21f61f | ||
|
|
eb0f0ad287 | ||
|
|
f646f060ea | ||
|
|
5719061f35 | ||
|
|
19f9a72e54 | ||
|
|
3231afc0de | ||
|
|
5fc9dec1df | ||
|
|
449a55b634 | ||
|
|
cb4b2ad153 | ||
|
|
050ff9dc1a | ||
|
|
9850d99297 | ||
|
|
67eb0968e1 | ||
|
|
f202e3dba4 | ||
|
|
61667c35e0 | ||
|
|
32d4f1041e | ||
|
|
715316db66 | ||
|
|
fbc0aaa0f7 | ||
|
|
1eabcda339 | ||
|
|
56eca2e488 | ||
|
|
ebd1db61fc | ||
|
|
a58adc04a7 | ||
|
|
ce62590144 | ||
|
|
95cb80c7a6 | ||
|
|
e91728b3e7 | ||
|
|
948120dac1 | ||
|
|
2195eeafb8 | ||
|
|
7bb8094745 | ||
|
|
af184d7e8c | ||
|
|
507ab9cafb | ||
|
|
253ee36580 | ||
|
|
6010b691f9 | ||
|
|
26b7c31a6b | ||
|
|
935f19ec99 | ||
|
|
9cf79f5a13 | ||
|
|
0eeb50005c | ||
|
|
1555c1ae0a | ||
|
|
478865258b | ||
|
|
324c2883fd | ||
|
|
365ca1225d | ||
|
|
beb0079ae1 | ||
|
|
c39de522e9 | ||
|
|
793f7c72dc | ||
|
|
721c3fb6b6 | ||
|
|
d09b08ce39 | ||
|
|
0343b61666 | ||
|
|
8b0d7dc95a | ||
|
|
014319c704 | ||
|
|
458a45b433 | ||
|
|
d50379c758 | ||
|
|
8c13598a4a | ||
|
|
9c38fa3e32 | ||
|
|
4ff7021a37 | ||
|
|
ebc1ff3f52 | ||
|
|
97dc0abb96 | ||
|
|
7c0d250a8d | ||
|
|
eb266def02 | ||
|
|
d01acbbddd | ||
|
|
508b06e286 | ||
|
|
da3f980be5 | ||
|
|
098043014b | ||
|
|
10579b3641 | ||
|
|
acaf0a0107 | ||
|
|
3910acb2be | ||
|
|
3270d9e488 | ||
|
|
5c361b5968 | ||
|
|
849bcede8e | ||
|
|
3aedef4328 | ||
|
|
f2a3dd6a53 | ||
|
|
8761f20ae8 | ||
|
|
ad62490f6c | ||
|
|
dedb402f2e | ||
|
|
9cf3bf50b6 | ||
|
|
e696bc826a | ||
|
|
6612950317 | ||
|
|
8174e4c286 | ||
|
|
fc152eff1c | ||
|
|
3a0524dfa9 | ||
|
|
740a672798 | ||
|
|
79e7ccdd03 | ||
|
|
44b990001f | ||
|
|
310a684fc2 | ||
|
|
0180863320 | ||
|
|
b3e1ba5816 | ||
|
|
e991aa94e8 | ||
|
|
0642ae58be | ||
|
|
40b72387ab | ||
|
|
0af78cf333 | ||
|
|
9439854caf | ||
|
|
8737c9ff2b | ||
|
|
7fe2ed7f91 | ||
|
|
891308f73c | ||
|
|
87f80226a8 | ||
|
|
cdcf0e1e12 | ||
|
|
4644afd4af | ||
|
|
caf8d81e07 | ||
|
|
56a6632950 | ||
|
|
2bb3534b8f | ||
|
|
13e05040b9 | ||
|
|
576904f993 | ||
|
|
f39bb776e3 | ||
|
|
1922d2d93e | ||
|
|
0d87abc601 | ||
|
|
2c94f1023c | ||
|
|
409760028f | ||
|
|
3426192ed8 | ||
|
|
d111d69c36 | ||
|
|
10ef4e9a97 | ||
|
|
c23d11475e | ||
|
|
aa0e780842 | ||
|
|
bd433d92ba | ||
|
|
a07f22582e | ||
|
|
7488de6c34 | ||
|
|
2bca5589bc | ||
|
|
bb35a53e4f | ||
|
|
cdfaa75e5e | ||
|
|
54ca217527 | ||
|
|
76d948fe81 | ||
|
|
f9491185b3 | ||
|
|
fac0a86dba | ||
|
|
8f7e37c9e4 | ||
|
|
2847617737 | ||
|
|
aeb1c38353 | ||
|
|
3a98b437bf | ||
|
|
060a527ded | ||
|
|
cfa317b2d3 | ||
|
|
feea47c923 | ||
|
|
cb5611f773 | ||
|
|
d1d6538da8 | ||
|
|
d778dd0909 | ||
|
|
7b1c09511a | ||
|
|
f63891efb5 | ||
|
|
b47b8eca07 | ||
|
|
a3b6e07770 | ||
|
|
dfb626f53e | ||
|
|
56f977148a | ||
|
|
35c204bad0 | ||
|
|
17d9a6f699 | ||
|
|
b66a383c5e | ||
|
|
0b327aab21 | ||
|
|
e43ee7a86d | ||
|
|
4963676373 | ||
|
|
1e8b2abff3 | ||
|
|
4bbfb5d3fb | ||
|
|
056bed9755 | ||
|
|
a4ed2d7de1 | ||
|
|
d77b49efe0 | ||
|
|
6e0a562d25 | ||
|
|
34b2fedf24 | ||
|
|
76bcf91b27 | ||
|
|
3aadcf6b46 | ||
|
|
de0c29b439 | ||
|
|
86382b56f8 | ||
|
|
6d41a8cd01 | ||
|
|
b023308294 | ||
|
|
7369c95245 | ||
|
|
6aae753b90 | ||
|
|
c2d20f62d4 | ||
|
|
be0a322db3 | ||
|
|
36ad158dd2 | ||
|
|
c0c69d1a17 | ||
|
|
c84e2ff653 | ||
|
|
493394bc17 | ||
|
|
2a90299de7 | ||
|
|
e2833ee1e3 | ||
|
|
4dc9b5f023 | ||
|
|
f8cd97a833 | ||
|
|
0a3c362073 | ||
|
|
01f079c241 | ||
|
|
60437a575a | ||
|
|
b96a990f04 | ||
|
|
fecdd9022d | ||
|
|
4c9ff323aa | ||
|
|
ca6c8cbeae | ||
|
|
c516bc9a85 | ||
|
|
4a3be41643 | ||
|
|
552feb708c | ||
|
|
23a3648278 | ||
|
|
1ae65c4ef8 | ||
|
|
ca8d225c20 | ||
|
|
e8c1fc7b64 | ||
|
|
feda85c82a | ||
|
|
5dd93ebcbf | ||
|
|
2ad18c24ac | ||
|
|
a847246eb4 | ||
|
|
41ea50dea1 | ||
|
|
7f6fbe6b60 | ||
|
|
c891e4a01e | ||
|
|
be87d135e1 | ||
|
|
45646fcb89 | ||
|
|
300af1d809 | ||
|
|
4264e3444a | ||
|
|
6a9d906c90 | ||
|
|
fb1494ea6e | ||
|
|
c4b27c5a18 | ||
|
|
7cb2f1bad3 | ||
|
|
4ccf6a145f | ||
|
|
24fcd4013f | ||
|
|
56bf3cb4d3 | ||
|
|
0e53db4964 | ||
|
|
64e365a48f | ||
|
|
83c7a8dfaa | ||
|
|
31dc73ffcc | ||
|
|
32a213632c | ||
|
|
2a14f37bda | ||
|
|
a550ccd1d2 | ||
|
|
502b49b2b9 | ||
|
|
9599f877c3 | ||
|
|
51638099ad | ||
|
|
1d913177a8 | ||
|
|
d765a024ea | ||
|
|
7a84df8979 | ||
|
|
4db6879a8c | ||
|
|
dbcb597810 | ||
|
|
26ef0873b7 | ||
|
|
38aa912af2 | ||
|
|
daece6fc91 | ||
|
|
768ff478d8 | ||
|
|
43234790a1 | ||
|
|
b512b165c4 | ||
|
|
d76f228300 | ||
|
|
b7ede363d4 | ||
|
|
e5a200f939 | ||
|
|
33768706c7 | ||
|
|
4394881d94 | ||
|
|
4ad9908de0 | ||
|
|
7352b3a30f | ||
|
|
bbb4d22621 | ||
|
|
1214d6e304 | ||
|
|
6528bd5473 | ||
|
|
3f845b25c0 | ||
|
|
ff328b54b9 | ||
|
|
05194784fd | ||
|
|
7f6c619305 | ||
|
|
375cef3d83 | ||
|
|
4eeaf0bcca | ||
|
|
1f272a2cee | ||
|
|
cf59123115 | ||
|
|
69d2e3fd11 | ||
|
|
b9f349d953 | ||
|
|
c66d1ae181 | ||
|
|
bf918c5abe | ||
|
|
d19927898d | ||
|
|
7aee827e45 | ||
|
|
211baa5e46 | ||
|
|
f00ad1c5d6 | ||
|
|
99258dce52 | ||
|
|
63e2541626 | ||
|
|
3ac28525ee | ||
|
|
de50a0fb41 | ||
|
|
762f236fab | ||
|
|
1c80e0216f | ||
|
|
600b2f08b8 | ||
|
|
48ab7fbf63 | ||
|
|
f2eecee94c | ||
|
|
4a77040deb | ||
|
|
54712d33eb | ||
|
|
2d09675e14 | ||
|
|
595ca51493 | ||
|
|
36a46913be | ||
|
|
d0b29413fc | ||
|
|
55f78f7baa | ||
|
|
80c45ea549 | ||
|
|
7d68090f03 | ||
|
|
1e0da8a33a | ||
|
|
8350c2b241 | ||
|
|
cd2c884923 | ||
|
|
247113c3d9 | ||
|
|
1b27db1755 | ||
|
|
649ddde342 | ||
|
|
74996193eb | ||
|
|
25b5d2b0df | ||
|
|
5967e0542a | ||
|
|
217d934133 | ||
|
|
9b27239ba8 | ||
|
|
42eb9ee55f | ||
|
|
898ba82d42 | ||
|
|
dd241064c1 | ||
|
|
2d3c7c457e | ||
|
|
a89dda8cb1 | ||
|
|
677f6cc3d8 | ||
|
|
1716cab24b | ||
|
|
9bd97b4496 | ||
|
|
40a64a6938 | ||
|
|
b7c199e600 | ||
|
|
d677301726 | ||
|
|
48988885d6 | ||
|
|
8dba5a6bfd | ||
|
|
aac52421c5 | ||
|
|
f34c639e3f | ||
|
|
a481eaa62d | ||
|
|
1fcd976d2a | ||
|
|
107eb4d4d7 | ||
|
|
5cc5e0c5dc | ||
|
|
1948208208 | ||
|
|
a47a65885a | ||
|
|
1e7b213aa2 | ||
|
|
3a6c866bf8 | ||
|
|
bba4295cb1 | ||
|
|
45bf0a583f | ||
|
|
7840775796 | ||
|
|
6859fd9ef2 | ||
|
|
1d0e34e7e4 | ||
|
|
20958358f2 | ||
|
|
1655f87a67 | ||
|
|
76409b1d81 | ||
|
|
28c2e442dd | ||
|
|
73afb8ce3e | ||
|
|
5e2f37f579 | ||
|
|
f2205620fe | ||
|
|
a6f5c742ba | ||
|
|
4c9e00886a | ||
|
|
a510f4e8a2 | ||
|
|
8624dff4d9 | ||
|
|
88595aecaa | ||
|
|
0e008a403e | ||
|
|
e7339323c4 | ||
|
|
79c7a62982 | ||
|
|
bc0fce5ba7 | ||
|
|
83f49851c1 | ||
|
|
b9e1706b8d | ||
|
|
c54bafe243 | ||
|
|
09fc43ba75 | ||
|
|
017c6dc88d | ||
|
|
b14862e2f8 | ||
|
|
e68e5aea56 | ||
|
|
0502d501c2 | ||
|
|
d8c33ee5d4 | ||
|
|
848ea8370b | ||
|
|
96160c5c9f | ||
|
|
fff49a52a6 | ||
|
|
e28d341378 | ||
|
|
fc59fc145d | ||
|
|
a0a7849d51 | ||
|
|
1de258c74c | ||
|
|
5adc5f7a5e | ||
|
|
e8a5037bf8 | ||
|
|
50fc3aa90d | ||
|
|
5969f9b759 | ||
|
|
70a72e25b4 | ||
|
|
3229b2e89a | ||
|
|
b7b2fa633e | ||
|
|
c0bbc1771c | ||
|
|
f16c87cdc1 | ||
|
|
1b4abf8e45 | ||
|
|
a47a0ac49a | ||
|
|
db240fe802 | ||
|
|
d95549a97d | ||
|
|
d6bf02f008 | ||
|
|
f1af7146fa | ||
|
|
e64002074b | ||
|
|
cf378ed5d3 | ||
|
|
5f17827df4 | ||
|
|
03b8c29148 | ||
|
|
cc3f8148ed | ||
|
|
e67fc6a10c | ||
|
|
fbebe36aea | ||
|
|
87cb207125 | ||
|
|
dc51c5093b | ||
|
|
80a2e207f8 | ||
|
|
5de413e72f | ||
|
|
7e448b4393 | ||
|
|
fbf7331f7d | ||
|
|
0ee744833e | ||
|
|
9ae8ff3906 | ||
|
|
048b52f9c6 | ||
|
|
77da80dd1b | ||
|
|
232de6ee72 | ||
|
|
d04ba65f9d | ||
|
|
421dfab94c | ||
|
|
26757351f5 | ||
|
|
9fc00478b2 | ||
|
|
cb02e121a2 | ||
|
|
7cdd8df50d | ||
|
|
90bdeac677 | ||
|
|
49727974f3 | ||
|
|
6bc068e998 | ||
|
|
9eec8c21ea | ||
|
|
f0fc174cdd | ||
|
|
dad6c778d5 | ||
|
|
3c4f589329 | ||
|
|
36ac2a1769 | ||
|
|
134a692a83 | ||
|
|
a5d1c5c576 | ||
|
|
4ee4926dbd | ||
|
|
c6c904de02 | ||
|
|
7dd5df4fa3 | ||
|
|
1e5bd125bf | ||
|
|
cd6a20f0c8 | ||
|
|
919f3ec4e8 | ||
|
|
4739cc20ee | ||
|
|
e1ba6c55de | ||
|
|
b18839aebc | ||
|
|
eb12b59f7c | ||
|
|
2834dda2b4 | ||
|
|
defe2fb64f | ||
|
|
c9c54b6041 | ||
|
|
478ed94629 | ||
|
|
152aded51f | ||
|
|
580f0b83ab | ||
|
|
1b5e1aba49 | ||
|
|
339316c91c | ||
|
|
2ab6b28c76 | ||
|
|
5ecde13413 | ||
|
|
33a96cf913 | ||
|
|
e248afea59 | ||
|
|
113e26cf76 | ||
|
|
82d1061467 | ||
|
|
5234dd7fd9 | ||
|
|
645b7cae4f | ||
|
|
4589e4410a | ||
|
|
1f7e7d9dca | ||
|
|
52a4d694b6 | ||
|
|
ed635e1eee | ||
|
|
2d7eaf4363 | ||
|
|
1399cd0f01 | ||
|
|
2f06ba1563 | ||
|
|
9b15282007 | ||
|
|
58b49c8302 | ||
|
|
3abb7a1f68 | ||
|
|
82515c8899 | ||
|
|
4d86712bdb | ||
|
|
f3e445cfcb | ||
|
|
75471825fd | ||
|
|
4e39682a9b | ||
|
|
14ed172f87 | ||
|
|
9c31ce9a7b | ||
|
|
0282f2219b | ||
|
|
59e8237a02 | ||
|
|
ef6a62d4d9 | ||
|
|
c63abc42b0 | ||
|
|
175beb3e95 | ||
|
|
80d6d8e472 | ||
|
|
4c4a93612e | ||
|
|
04137b3a16 | ||
|
|
39106425cf | ||
|
|
b772787079 | ||
|
|
be04bab58b | ||
|
|
57e38d527c | ||
|
|
88218592e6 | ||
|
|
15e1a2c0c0 | ||
|
|
ff8132d510 | ||
|
|
c3e81d7168 | ||
|
|
883fecaff2 | ||
|
|
398a2db300 | ||
|
|
9f5fab0f3c | ||
|
|
3bec117108 | ||
|
|
81b8f134f8 | ||
|
|
42b1d300a5 | ||
|
|
bbb546d4de | ||
|
|
7646297a82 | ||
|
|
300e95b7d0 | ||
|
|
8efb3398b2 | ||
|
|
e9f6bf020a | ||
|
|
f4c7202762 | ||
|
|
0727a47886 | ||
|
|
e9cbf18ffb | ||
|
|
c8a653e397 | ||
|
|
5c0b6b9676 | ||
|
|
c0e0bacd02 | ||
|
|
6bd2f88477 | ||
|
|
e5b4e5567b | ||
|
|
407fc805d5 | ||
|
|
e5ae46c7d1 | ||
|
|
51aa45fd78 | ||
|
|
eb23557dee | ||
|
|
a880422749 | ||
|
|
26db4f6e01 | ||
|
|
610a44a636 | ||
|
|
e5f3eae80a | ||
|
|
d4eb621a16 | ||
|
|
6ab4d9c1a5 | ||
|
|
de7460f79c | ||
|
|
ec6c6f9bc0 | ||
|
|
f80cba321d | ||
|
|
e0c59d75a1 | ||
|
|
703c5352ea | ||
|
|
06b7c1a326 | ||
|
|
c74382063a | ||
|
|
01a5c0cf65 | ||
|
|
5dd1e76958 | ||
|
|
ac3f572919 | ||
|
|
04dc3fb5d3 | ||
|
|
20a85b0e23 | ||
|
|
320499b91c | ||
|
|
4b97a9f491 | ||
|
|
8961bd3504 | ||
|
|
7782cc0796 | ||
|
|
5474e06434 | ||
|
|
3da4c37539 | ||
|
|
cdee39002d | ||
|
|
58e0f63a3c | ||
|
|
7d4bb6efd2 | ||
|
|
8732e5f0d8 | ||
|
|
ed5f7c7766 | ||
|
|
89c91494e6 | ||
|
|
71a10a7184 | ||
|
|
bdd10b09c6 | ||
|
|
a059ebeab6 |
2
COPYING
2
COPYING
@@ -2,7 +2,7 @@ Copyright Notice and Statement for NCSA Hierarchical Data Format (HDF)
|
||||
Software Library and Utilities
|
||||
|
||||
NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities
|
||||
Copyright 1998, 1999, 2000, 2001, 2002, 2003 by the Board of Trustees
|
||||
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the Board of Trustees
|
||||
of the University of Illinois. All rights reserved.
|
||||
|
||||
Contributors: National Center for Supercomputing Applications (NCSA) at the
|
||||
|
||||
447
MANIFEST
447
MANIFEST
@@ -16,8 +16,10 @@
|
||||
./configure
|
||||
./configure.in
|
||||
|
||||
./bin/buildhdf5
|
||||
./bin/checkapi _DO_NOT_DISTRIBUTE_
|
||||
./bin/checkposix _DO_NOT_DISTRIBUTE_
|
||||
./bin/chkcopyright _DO_NOT_DISTRIBUTE_
|
||||
./bin/chkmanifest
|
||||
./bin/config.guess
|
||||
./bin/config.sub
|
||||
@@ -25,7 +27,7 @@
|
||||
./bin/debug-ohdr _DO_NOT_DISTRIBUTE_
|
||||
./bin/dependencies
|
||||
./bin/distdep
|
||||
./bin/errors _DO_NOT_DISTRIBUTE_
|
||||
./bin/errors _DO_NOT_DISTRIBUTE_
|
||||
./bin/h5vers
|
||||
./bin/install-sh
|
||||
./bin/iostats
|
||||
@@ -63,6 +65,7 @@
|
||||
./config/linux-gnuaout
|
||||
./config/linux-gnulibc1
|
||||
./config/linux-gnulibc2
|
||||
./config/powerpc-apple
|
||||
./config/powerpc-ibm-aix4.x
|
||||
./config/powerpc-ibm-aix5.x
|
||||
./config/rs6000-ibm-aix4.x
|
||||
@@ -132,6 +135,8 @@
|
||||
./doc/html/MountingFiles.html
|
||||
./doc/html/NCSAfooterlogo.gif
|
||||
./doc/html/ObjectHeader.txt _DO_NOT_DISTRIBUTE_
|
||||
./doc/html/PDF_RM_body.book _DO_NOT_DISTRIBUTE_
|
||||
./doc/html/PDF_RM_front.book _DO_NOT_DISTRIBUTE_
|
||||
./doc/html/Performance.html
|
||||
./doc/html/PredefDTypes.html
|
||||
./doc/html/Properties.html
|
||||
@@ -149,6 +154,8 @@
|
||||
./doc/html/RM_H5S.html
|
||||
./doc/html/RM_H5T.html
|
||||
./doc/html/RM_H5Z.html
|
||||
./doc/html/RM_Title.html _DO_NOT_DISTRIBUTE_
|
||||
./doc/html/RM_TOC.html _DO_NOT_DISTRIBUTE_
|
||||
./doc/html/Tools.html
|
||||
./doc/html/Version.html
|
||||
./doc/html/chunk1.gif
|
||||
@@ -189,6 +196,7 @@
|
||||
|
||||
./doc/html/TechNotes.html
|
||||
./doc/html/TechNotes/shuffling-algorithm-report.pdf
|
||||
./doc/html/TechNotes/Basic_perform.html
|
||||
./doc/html/TechNotes/BigDataSmMach.html
|
||||
./doc/html/TechNotes/ChStudy_1000x1000.gif
|
||||
./doc/html/TechNotes/ChStudy_250x250.gif
|
||||
@@ -213,6 +221,7 @@
|
||||
./doc/html/TechNotes/NamingScheme.html
|
||||
./doc/html/TechNotes/ObjectHeader.html
|
||||
./doc/html/TechNotes/RawDStorage.html
|
||||
./doc/html/TechNotes/ReservedFileSpace.html
|
||||
./doc/html/TechNotes/SWControls.html
|
||||
./doc/html/TechNotes/SymbolTables.html
|
||||
./doc/html/TechNotes/TestReview.html
|
||||
@@ -400,6 +409,237 @@
|
||||
./doc/html/cpplus/Dependencies
|
||||
./doc/html/cpplus/Makefile.in
|
||||
|
||||
./doc/html/cpplus_RM/Dependencies
|
||||
./doc/html/cpplus_RM/Makefile.in
|
||||
./doc/html/cpplus_RM/H5AbstractDs_8cpp.html
|
||||
./doc/html/cpplus_RM/H5AbstractDs_8h-source.html
|
||||
./doc/html/cpplus_RM/H5AbstractDs_8h.html
|
||||
./doc/html/cpplus_RM/H5Alltypes_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Alltypes_8h.html
|
||||
./doc/html/cpplus_RM/H5AtomType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5AtomType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5AtomType_8h.html
|
||||
./doc/html/cpplus_RM/H5Attribute_8cpp.html
|
||||
./doc/html/cpplus_RM/H5Attribute_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Attribute_8h.html
|
||||
./doc/html/cpplus_RM/H5Classes_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Classes_8h.html
|
||||
./doc/html/cpplus_RM/H5CommonFG_8cpp.html
|
||||
./doc/html/cpplus_RM/H5CommonFG_8h-source.html
|
||||
./doc/html/cpplus_RM/H5CommonFG_8h.html
|
||||
./doc/html/cpplus_RM/H5CompType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5CompType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5CompType_8h.html
|
||||
./doc/html/cpplus_RM/H5CppDoc_8h-source.html
|
||||
./doc/html/cpplus_RM/H5CppDoc_8h.html
|
||||
./doc/html/cpplus_RM/H5Cpp_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Cpp_8h.html
|
||||
./doc/html/cpplus_RM/H5DataSet_8cpp.html
|
||||
./doc/html/cpplus_RM/H5DataSet_8h-source.html
|
||||
./doc/html/cpplus_RM/H5DataSet_8h.html
|
||||
./doc/html/cpplus_RM/H5DataSpace_8cpp.html
|
||||
./doc/html/cpplus_RM/H5DataSpace_8h-source.html
|
||||
./doc/html/cpplus_RM/H5DataSpace_8h.html
|
||||
./doc/html/cpplus_RM/H5DataType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5DataType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5DataType_8h.html
|
||||
./doc/html/cpplus_RM/H5DcreatProp_8cpp.html
|
||||
./doc/html/cpplus_RM/H5DcreatProp_8h-source.html
|
||||
./doc/html/cpplus_RM/H5DcreatProp_8h.html
|
||||
./doc/html/cpplus_RM/H5DxferProp_8cpp.html
|
||||
./doc/html/cpplus_RM/H5DxferProp_8h-source.html
|
||||
./doc/html/cpplus_RM/H5DxferProp_8h.html
|
||||
./doc/html/cpplus_RM/H5EnumType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5EnumType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5EnumType_8h.html
|
||||
./doc/html/cpplus_RM/H5Exception_8cpp.html
|
||||
./doc/html/cpplus_RM/H5Exception_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Exception_8h.html
|
||||
./doc/html/cpplus_RM/H5FaccProp_8cpp.html
|
||||
./doc/html/cpplus_RM/H5FaccProp_8h-source.html
|
||||
./doc/html/cpplus_RM/H5FaccProp_8h.html
|
||||
./doc/html/cpplus_RM/H5FcreatProp_8cpp.html
|
||||
./doc/html/cpplus_RM/H5FcreatProp_8h-source.html
|
||||
./doc/html/cpplus_RM/H5FcreatProp_8h.html
|
||||
./doc/html/cpplus_RM/H5File_8cpp.html
|
||||
./doc/html/cpplus_RM/H5File_8h-source.html
|
||||
./doc/html/cpplus_RM/H5File_8h.html
|
||||
./doc/html/cpplus_RM/H5FloatType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5FloatType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5FloatType_8h.html
|
||||
./doc/html/cpplus_RM/H5Group_8cpp.html
|
||||
./doc/html/cpplus_RM/H5Group_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Group_8h.html
|
||||
./doc/html/cpplus_RM/H5IdComponent_8cpp.html
|
||||
./doc/html/cpplus_RM/H5IdComponent_8h-source.html
|
||||
./doc/html/cpplus_RM/H5IdComponent_8h.html
|
||||
./doc/html/cpplus_RM/H5Idtemplates_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Idtemplates_8h.html
|
||||
./doc/html/cpplus_RM/H5Include_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Include_8h.html
|
||||
./doc/html/cpplus_RM/H5IntType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5IntType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5IntType_8h.html
|
||||
./doc/html/cpplus_RM/H5Library_8cpp.html
|
||||
./doc/html/cpplus_RM/H5Library_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Library_8h.html
|
||||
./doc/html/cpplus_RM/H5Object_8cpp.html
|
||||
./doc/html/cpplus_RM/H5Object_8h-source.html
|
||||
./doc/html/cpplus_RM/H5Object_8h.html
|
||||
./doc/html/cpplus_RM/H5PredType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5PredType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5PredType_8h.html
|
||||
./doc/html/cpplus_RM/H5PropList_8cpp.html
|
||||
./doc/html/cpplus_RM/H5PropList_8h-source.html
|
||||
./doc/html/cpplus_RM/H5PropList_8h.html
|
||||
./doc/html/cpplus_RM/H5RefCounter_8cpp.html
|
||||
./doc/html/cpplus_RM/H5RefCounter_8h-source.html
|
||||
./doc/html/cpplus_RM/H5RefCounter_8h.html
|
||||
./doc/html/cpplus_RM/H5StrType_8cpp.html
|
||||
./doc/html/cpplus_RM/H5StrType_8h-source.html
|
||||
./doc/html/cpplus_RM/H5StrType_8h.html
|
||||
./doc/html/cpplus_RM/NCSAlogo.jpg
|
||||
./doc/html/cpplus_RM/annotated.html
|
||||
./doc/html/cpplus_RM/classH5_1_1AbstractDs-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1AbstractDs.html
|
||||
./doc/html/cpplus_RM/classH5_1_1AbstractDs.png
|
||||
./doc/html/cpplus_RM/classH5_1_1AtomType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1AtomType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1AtomType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1Attribute-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1Attribute.html
|
||||
./doc/html/cpplus_RM/classH5_1_1Attribute.png
|
||||
./doc/html/cpplus_RM/classH5_1_1AttributeIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1AttributeIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1AttributeIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1CommonFG-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1CommonFG.html
|
||||
./doc/html/cpplus_RM/classH5_1_1CommonFG.png
|
||||
./doc/html/cpplus_RM/classH5_1_1CompType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1CompType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1CompType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DSetCreatPropList-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DSetCreatPropList.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DSetCreatPropList.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DSetMemXferPropList-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DSetMemXferPropList.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DSetMemXferPropList.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSet-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSet.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSet.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSetIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSetIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSetIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSpace-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSpace.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSpace.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSpaceIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSpaceIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataSpaceIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DataType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1DataTypeIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataTypeIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1DataTypeIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1EnumType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1EnumType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1EnumType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1Exception-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1Exception.html
|
||||
./doc/html/cpplus_RM/classH5_1_1Exception.png
|
||||
./doc/html/cpplus_RM/classH5_1_1FileAccPropList-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FileAccPropList.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FileAccPropList.png
|
||||
./doc/html/cpplus_RM/classH5_1_1FileCreatPropList-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FileCreatPropList.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FileCreatPropList.png
|
||||
./doc/html/cpplus_RM/classH5_1_1FileIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FileIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FileIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1FloatType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FloatType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1FloatType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1Group-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1Group.html
|
||||
./doc/html/cpplus_RM/classH5_1_1Group.png
|
||||
./doc/html/cpplus_RM/classH5_1_1GroupIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1GroupIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1GroupIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1H5File-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1H5File.html
|
||||
./doc/html/cpplus_RM/classH5_1_1H5File.png
|
||||
./doc/html/cpplus_RM/classH5_1_1H5Library-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1H5Library.html
|
||||
./doc/html/cpplus_RM/classH5_1_1H5Object-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1H5Object.html
|
||||
./doc/html/cpplus_RM/classH5_1_1H5Object.png
|
||||
./doc/html/cpplus_RM/classH5_1_1IdComponent-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1IdComponent.html
|
||||
./doc/html/cpplus_RM/classH5_1_1IdComponent.png
|
||||
./doc/html/cpplus_RM/classH5_1_1IdComponentException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1IdComponentException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1IdComponentException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1IntType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1IntType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1IntType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1LibraryIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1LibraryIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1LibraryIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1PredType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1PredType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1PredType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1PropList-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1PropList.html
|
||||
./doc/html/cpplus_RM/classH5_1_1PropList.png
|
||||
./doc/html/cpplus_RM/classH5_1_1PropListIException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1PropListIException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1PropListIException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1RefCounter-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1RefCounter.html
|
||||
./doc/html/cpplus_RM/classH5_1_1RefCounter_1_1RefCounter.html
|
||||
./doc/html/cpplus_RM/classH5_1_1RefCounter_1_1abc.html
|
||||
./doc/html/cpplus_RM/classH5_1_1ReferenceException-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1ReferenceException.html
|
||||
./doc/html/cpplus_RM/classH5_1_1ReferenceException.png
|
||||
./doc/html/cpplus_RM/classH5_1_1StrType-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1StrType.html
|
||||
./doc/html/cpplus_RM/classH5_1_1StrType.png
|
||||
./doc/html/cpplus_RM/classH5_1_1UserData4Aiterate-members.html
|
||||
./doc/html/cpplus_RM/classH5_1_1UserData4Aiterate.html
|
||||
./doc/html/cpplus_RM/create_8cpp-example.html
|
||||
./doc/html/cpplus_RM/doxygen.css
|
||||
./doc/html/cpplus_RM/doxygen.png
|
||||
./doc/html/cpplus_RM/dsets_8cpp-example.html
|
||||
./doc/html/cpplus_RM/examples.html
|
||||
./doc/html/cpplus_RM/files.html
|
||||
./doc/html/cpplus_RM/functions.html
|
||||
./doc/html/cpplus_RM/functions_func.html
|
||||
./doc/html/cpplus_RM/functions_vars.html
|
||||
./doc/html/cpplus_RM/globals.html
|
||||
./doc/html/cpplus_RM/globals_defs.html
|
||||
./doc/html/cpplus_RM/globals_func.html
|
||||
./doc/html/cpplus_RM/globals_type.html
|
||||
./doc/html/cpplus_RM/globals_vars.html
|
||||
./doc/html/cpplus_RM/header.html
|
||||
./doc/html/cpplus_RM/hierarchy.html
|
||||
./doc/html/cpplus_RM/index.html
|
||||
./doc/html/cpplus_RM/namespaceH5.html
|
||||
./doc/html/cpplus_RM/namespacemembers.html
|
||||
./doc/html/cpplus_RM/namespacemembers_func.html
|
||||
./doc/html/cpplus_RM/namespacemembers_type.html
|
||||
./doc/html/cpplus_RM/namespacemembers_vars.html
|
||||
./doc/html/cpplus_RM/namespaces.html
|
||||
./doc/html/cpplus_RM/namespacestd.html
|
||||
./doc/html/cpplus_RM/writedata_8cpp-example.html
|
||||
|
||||
./doc/html/cpplus_RM/header_files/Dependencies
|
||||
./doc/html/cpplus_RM/header_files/Makefile.in
|
||||
./doc/html/cpplus_RM/header_files/filelist.xml
|
||||
./doc/html/cpplus_RM/header_files/filelist.xml
|
||||
./doc/html/cpplus_RM/header_files/image001.jpg
|
||||
./doc/html/cpplus_RM/header_files/image002.jpg
|
||||
|
||||
./doc/html/ed_libs/Dependencies
|
||||
./doc/html/ed_libs/Footer.lbi
|
||||
./doc/html/ed_libs/Makefile.in
|
||||
@@ -435,18 +675,6 @@
|
||||
./doc/html/fortran/F90Flags.html
|
||||
./doc/html/fortran/F90UserNotes.html
|
||||
./doc/html/fortran/Makefile.in
|
||||
./doc/html/fortran/h5_FORTRAN.html
|
||||
./doc/html/fortran/h5a_FORTRAN.html
|
||||
./doc/html/fortran/h5d_FORTRAN.html
|
||||
./doc/html/fortran/h5e_FORTRAN.html
|
||||
./doc/html/fortran/h5f_FORTRAN.html
|
||||
./doc/html/fortran/h5g_FORTRAN.html
|
||||
./doc/html/fortran/h5i_FORTRAN.html
|
||||
./doc/html/fortran/h5p_FORTRAN.html
|
||||
./doc/html/fortran/h5r_FORTRAN.html
|
||||
./doc/html/fortran/h5s_FORTRAN.html
|
||||
./doc/html/fortran/h5t_FORTRAN.html
|
||||
./doc/html/fortran/h5z_FORTRAN.html
|
||||
|
||||
./doc/html/group_p1.gif
|
||||
./doc/html/group_p1.obj _DO_NOT_DISTRIBUTE_
|
||||
@@ -556,6 +784,7 @@
|
||||
./fortran/config/linux-gnuaout
|
||||
./fortran/config/linux-gnulibc1
|
||||
./fortran/config/linux-gnulibc2
|
||||
./fortran/config/powerpc-apple
|
||||
./fortran/config/powerpc-ibm-aix4.x
|
||||
./fortran/config/powerpc-ibm-aix5.x
|
||||
./fortran/config/rs6000-ibm-aix4.x
|
||||
@@ -582,7 +811,6 @@
|
||||
./fortran/examples/mountexample.f90
|
||||
./fortran/examples/refobjexample.f90
|
||||
./fortran/examples/refregexample.f90
|
||||
./fortran/examples/run_examples.sh
|
||||
./fortran/examples/rwdsetexample.f90
|
||||
./fortran/examples/selectele.f90
|
||||
|
||||
@@ -678,30 +906,27 @@
|
||||
./c++/config/BlankForm
|
||||
./c++/config/commence.in
|
||||
./c++/config/conclude.in
|
||||
./c++/config/dec-osf5.x
|
||||
./c++/config/depend1.in
|
||||
./c++/config/depend2.in
|
||||
./c++/config/depend3.in
|
||||
./c++/config/depend4.in
|
||||
./c++/config/dependN.in
|
||||
./c++/config/freebsd
|
||||
./c++/config/hpux11.00
|
||||
./c++/config/ia64-linux-gnu
|
||||
./c++/config/irix6.x
|
||||
./c++/config/linux-gnu
|
||||
./c++/config/linux-gnulibc1
|
||||
./c++/config/linux-gnulibc2
|
||||
./c++/config/powerpc-ibm-aix
|
||||
./c++/config/rs6000-ibm-aix4.x
|
||||
./c++/config/solaris2.x
|
||||
./c++/config/irix6.x
|
||||
./c++/config/sv1-cray
|
||||
./c++/config/unicos10.0.X
|
||||
./c++/config/unicosmk2.0.6.X
|
||||
|
||||
./c++/examples/Dependencies
|
||||
./c++/examples/Attributes.h5
|
||||
./c++/examples/Group.h5
|
||||
./c++/examples/SDS.h5
|
||||
./c++/examples/SDScompound.h5
|
||||
./c++/examples/SDSextendible.h5
|
||||
./c++/examples/Select.h5
|
||||
./c++/examples/chunks.cpp
|
||||
./c++/examples/compound.cpp
|
||||
./c++/examples/create.cpp
|
||||
@@ -717,6 +942,8 @@
|
||||
./c++/src/H5AbstractDs.cpp
|
||||
./c++/src/H5AbstractDs.h
|
||||
./c++/src/H5Alltypes.h
|
||||
./c++/src/H5ArrayType.cpp
|
||||
./c++/src/H5ArrayType.h
|
||||
./c++/src/H5AtomType.cpp
|
||||
./c++/src/H5AtomType.h
|
||||
./c++/src/H5Attribute.cpp
|
||||
@@ -727,6 +954,7 @@
|
||||
./c++/src/H5CompType.cpp
|
||||
./c++/src/H5CompType.h
|
||||
./c++/src/H5Cpp.h
|
||||
./c++/src/H5CppDoc.h
|
||||
./c++/src/H5DataSet.cpp
|
||||
./c++/src/H5DataSet.h
|
||||
./c++/src/H5DataSpace.cpp
|
||||
@@ -769,8 +997,15 @@
|
||||
./c++/src/H5RefCounter.h
|
||||
./c++/src/H5StrType.cpp
|
||||
./c++/src/H5StrType.h
|
||||
./c++/src/H5VarLenType.cpp
|
||||
./c++/src/H5VarLenType.h
|
||||
./c++/src/Makefile.in
|
||||
./c++/src/cpp_doc_config
|
||||
./c++/src/h5c++.in
|
||||
./c++/src/header.html
|
||||
./c++/src/header_files/filelist.xml
|
||||
./c++/src/header_files/image001.jpg
|
||||
./c++/src/header_files/image002.jpg
|
||||
|
||||
./c++/test/Dependencies
|
||||
./c++/test/Makefile.in
|
||||
@@ -812,6 +1047,7 @@
|
||||
./perform/mpi-perf.c
|
||||
./perform/overhead.c
|
||||
./perform/perf.c
|
||||
./perform/perf_meta.c
|
||||
./perform/pio_engine.c
|
||||
./perform/pio_perf.c
|
||||
./perform/pio_perf.h
|
||||
@@ -824,8 +1060,8 @@
|
||||
./release_docs/INSTALL_VFL
|
||||
./release_docs/INSTALL_parallel
|
||||
./release_docs/INSTALL_Windows.txt
|
||||
./release_docs/INSTALL_Windows_withF90.txt
|
||||
./release_docs/INSTALL_Windows_withcpp.txt
|
||||
./release_docs/INSTALL_Windows_From_Command_Line.txt
|
||||
./release_docs/INSTALL_Windows_Short.txt
|
||||
./release_docs/INSTALL_codewarrior.txt
|
||||
./release_docs/HISTORY.txt
|
||||
./release_docs/RELEASE.txt
|
||||
@@ -846,32 +1082,34 @@
|
||||
./src/H5Bprivate.h
|
||||
./src/H5Bpublic.h
|
||||
./src/H5D.c
|
||||
./src/H5Dcontig.c
|
||||
./src/H5Dcompact.c
|
||||
./src/H5Dio.c
|
||||
./src/H5Distore.c
|
||||
./src/H5Dmpio.c
|
||||
./src/H5Dprivate.h
|
||||
./src/H5Dpublic.h
|
||||
./src/H5Dpkg.h
|
||||
./src/H5Dseq.c
|
||||
./src/H5Dtest.c
|
||||
./src/H5E.c
|
||||
./src/H5Eprivate.h
|
||||
./src/H5Epublic.h
|
||||
./src/H5F.c
|
||||
./src/H5Fcontig.c
|
||||
./src/H5Fcompact.c
|
||||
./src/H5Fistore.c
|
||||
./src/H5Fpkg.h
|
||||
./src/H5Fprivate.h
|
||||
./src/H5Fpublic.h
|
||||
./src/H5Fseq.c
|
||||
./src/H5FD.c
|
||||
./src/H5FDcore.c
|
||||
./src/H5FDcore.h
|
||||
./src/H5FDfamily.c
|
||||
./src/H5FDfamily.h
|
||||
./src/H5FDfphdf5.c
|
||||
./src/H5FDfphdf5.h
|
||||
./src/H5FDgass.c
|
||||
./src/H5FDgass.h
|
||||
./src/H5FDlog.c
|
||||
./src/H5FDlog.h
|
||||
./src/H5FDmpi.c
|
||||
./src/H5FDmpi.h
|
||||
./src/H5FDmpio.c
|
||||
./src/H5FDmpio.h
|
||||
./src/H5FDmpiposix.c
|
||||
@@ -892,11 +1130,6 @@
|
||||
./src/H5FLprivate.h
|
||||
./src/H5FO.c
|
||||
./src/H5FOprivate.h
|
||||
./src/H5FP.c
|
||||
./src/H5FPclient.c
|
||||
./src/H5FPprivate.h
|
||||
./src/H5FPpublic.h
|
||||
./src/H5FPserver.c
|
||||
./src/H5FS.c
|
||||
./src/H5FSprivate.h
|
||||
./src/H5G.c
|
||||
@@ -954,6 +1187,8 @@
|
||||
./src/H5R.c
|
||||
./src/H5Rprivate.h
|
||||
./src/H5Rpublic.h
|
||||
./src/H5RC.c
|
||||
./src/H5RCprivate.h
|
||||
./src/H5RS.c
|
||||
./src/H5RSprivate.h
|
||||
./src/H5S.c
|
||||
@@ -1026,6 +1261,7 @@
|
||||
./test/extend.c
|
||||
./test/external.c
|
||||
./test/file_handle.c
|
||||
./test/filename.c
|
||||
./test/fill_old.h5
|
||||
./test/fillval.c
|
||||
./test/flush1.c
|
||||
@@ -1043,15 +1279,20 @@
|
||||
./test/links.c
|
||||
./test/mount.c
|
||||
./test/mtime.c
|
||||
./test/noencoder.h5
|
||||
./test/ntypes.c
|
||||
./test/ohdr.c
|
||||
./test/reserved.c
|
||||
./test/space_overflow.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_deflate.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_old_array.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_new_array.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_new_fill.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_old_layout.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_old_mtime.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_new_mtime.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_new_super.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_nullspace.c _DO_NOT_DISTRIBUTE_
|
||||
./test/set_extent.c
|
||||
./test/srb_append.c
|
||||
./test/srb_read.c
|
||||
@@ -1063,6 +1304,7 @@
|
||||
./test/tattr.c
|
||||
./test/tbogus.h5
|
||||
./test/tconfig.c
|
||||
./test/testframe.c
|
||||
./test/testhdf5.c
|
||||
./test/testhdf5.h
|
||||
./test/testmeta.c
|
||||
@@ -1072,10 +1314,12 @@
|
||||
./test/th5s.h5
|
||||
./test/theap.c
|
||||
./test/titerate.c
|
||||
./test/tlayouto.h5
|
||||
./test/tmeta.c
|
||||
./test/tmisc.c
|
||||
./test/tmtimen.h5
|
||||
./test/tmtimeo.h5
|
||||
./test/tnullspace.h5
|
||||
./test/ttime.c
|
||||
./test/trefer.c
|
||||
./test/trefstr.c
|
||||
@@ -1091,15 +1335,18 @@
|
||||
./test/tvlstr.c
|
||||
./test/tvltypes.c
|
||||
./test/unlink.c
|
||||
./test/test_filters_be.hdf5
|
||||
./test/test_filters_le.hdf5
|
||||
|
||||
|
||||
./testpar/Dependencies
|
||||
./testpar/Makefile.in
|
||||
./testpar/t_dset.c
|
||||
./testpar/t_file.c
|
||||
./testpar/t_fphdf5.c
|
||||
./testpar/t_mdset.c
|
||||
./testpar/t_mpi.c
|
||||
./testpar/t_ph5basic.c
|
||||
./testpar/t_coll_chunk.c
|
||||
./testpar/testphdf5.c
|
||||
./testpar/testphdf5.h
|
||||
./testpar/testph5.sh.in
|
||||
@@ -1124,7 +1371,8 @@
|
||||
./tools/h5dump/h5dump.c
|
||||
./tools/h5dump/h5dump.h
|
||||
./tools/h5dump/h5dumpgentest.c
|
||||
./tools/h5dump/testh5dump.sh
|
||||
./tools/h5dump/testh5dump.sh.in
|
||||
./tools/h5dump/testh5dumpxml.sh
|
||||
|
||||
./tools/h5import/Dependencies
|
||||
./tools/h5import/Makefile.in
|
||||
@@ -1165,12 +1413,37 @@
|
||||
|
||||
./tools/h5diff/Dependencies
|
||||
./tools/h5diff/Makefile.in
|
||||
./tools/h5diff/h5diff.c
|
||||
./tools/h5diff/h5trav.c
|
||||
./tools/h5diff/h5trav.h
|
||||
./tools/h5diff/h5difftst.c
|
||||
./tools/h5diff/h5diff_main.c
|
||||
./tools/h5diff/testh5diff_attr.c
|
||||
./tools/h5diff/testh5diff_basic.c
|
||||
./tools/h5diff/testh5diff_dset.c
|
||||
./tools/h5diff/testh5diff_main.c
|
||||
./tools/h5diff/testh5diff_util.c
|
||||
./tools/h5diff/testh5diff.h
|
||||
./tools/h5diff/testh5diff.sh
|
||||
|
||||
|
||||
# h5repack sources
|
||||
./tools/h5repack/Dependencies
|
||||
./tools/h5repack/Makefile.in
|
||||
./tools/h5repack/h5repack.sh.in
|
||||
./tools/h5repack/h5repack.c
|
||||
./tools/h5repack/h5repack.h
|
||||
./tools/h5repack/h5repack_copy.c
|
||||
./tools/h5repack/h5repack_filters.c
|
||||
./tools/h5repack/h5repack_layout.c
|
||||
./tools/h5repack/h5repack_list.c
|
||||
./tools/h5repack/h5repack_main.c
|
||||
./tools/h5repack/h5repack_opttable.c
|
||||
./tools/h5repack/h5repack_parse.c
|
||||
./tools/h5repack/h5repack_refs.c
|
||||
./tools/h5repack/h5repack_verify.c
|
||||
./tools/h5repack/testh5repack_attr.c
|
||||
./tools/h5repack/testh5repack_dset.c
|
||||
./tools/h5repack/testh5repack_main.c
|
||||
./tools/h5repack/testh5repack_make.c
|
||||
./tools/h5repack/testh5repack_util.c
|
||||
|
||||
./tools/h5ls/Dependencies
|
||||
./tools/h5ls/Makefile.in
|
||||
./tools/h5ls/h5ls.c
|
||||
@@ -1178,18 +1451,29 @@
|
||||
|
||||
./tools/lib/Dependencies
|
||||
./tools/lib/Makefile.in
|
||||
./tools/lib/h5diff.c
|
||||
./tools/lib/h5diff.h
|
||||
./tools/lib/h5diff_array.c
|
||||
./tools/lib/h5diff_attr.c
|
||||
./tools/lib/h5diff_dset.c
|
||||
./tools/lib/h5diff_util.c
|
||||
./tools/lib/h5trav.c
|
||||
./tools/lib/h5trav.h
|
||||
./tools/lib/h5trav_table.c
|
||||
./tools/lib/h5tools.c
|
||||
./tools/lib/h5tools.h
|
||||
./tools/lib/h5tools_filters.c
|
||||
./tools/lib/h5tools_str.c
|
||||
./tools/lib/h5tools_str.h
|
||||
./tools/lib/h5tools_utils.c
|
||||
./tools/lib/h5tools_utils.h
|
||||
./tools/lib/h5tools_ref.c
|
||||
./tools/lib/h5tools_ref.h
|
||||
./tools/lib/talign.c
|
||||
|
||||
./tools/misc/Dependencies
|
||||
./tools/misc/Makefile.in
|
||||
./tools/misc/h5cc.in
|
||||
./tools/misc/h5createU8.c
|
||||
./tools/misc/h5debug.c
|
||||
./tools/misc/h5import.c
|
||||
./tools/misc/h5redeploy.in
|
||||
@@ -1228,8 +1512,10 @@
|
||||
./tools/testfiles/tcomp-1.ddl
|
||||
./tools/testfiles/tcomp-2.ddl
|
||||
./tools/testfiles/tcomp-3.ddl
|
||||
./tools/testfiles/tcomp-4.ddl
|
||||
./tools/testfiles/tcompound.h5
|
||||
./tools/testfiles/tcompound2.h5
|
||||
./tools/testfiles/tcompound_complex.h5
|
||||
./tools/testfiles/tdatareg.h5
|
||||
./tools/testfiles/tdatareg.ddl
|
||||
./tools/testfiles/tdset-1.ddl
|
||||
@@ -1307,9 +1593,46 @@
|
||||
./tools/testfiles/tvldtypes3.h5
|
||||
./tools/testfiles/tvldtypes4.ddl
|
||||
./tools/testfiles/tvldtypes4.h5
|
||||
./tools/testfiles/tvldtypes5.ddl
|
||||
./tools/testfiles/tvldtypes5.h5
|
||||
./tools/testfiles/tvlstr.h5
|
||||
./tools/testfiles/tvlstr.ddl
|
||||
./tools/testfiles/tattr2.h5
|
||||
./tools/testfiles/tall-2A.ddl
|
||||
./tools/testfiles/tcontents.ddl
|
||||
./tools/testfiles/tfilters.h5
|
||||
./tools/testfiles/tchunked.ddl
|
||||
./tools/testfiles/tcompact.ddl
|
||||
./tools/testfiles/tcontiguos.ddl
|
||||
./tools/testfiles/tdeflate.ddl
|
||||
./tools/testfiles/texternal.ddl
|
||||
./tools/testfiles/tfletcher32.ddl
|
||||
./tools/testfiles/treference.ddl
|
||||
./tools/testfiles/tshuffle.ddl
|
||||
./tools/testfiles/tstring.ddl
|
||||
./tools/testfiles/tszip.ddl
|
||||
./tools/testfiles/tuserfilter.ddl
|
||||
./tools/testfiles/tallfilters.ddl
|
||||
./tools/testfiles/tstringe.ddl
|
||||
./tools/testfiles/tindicesyes.ddl
|
||||
./tools/testfiles/tindicesno.ddl
|
||||
./tools/testfiles/tfcontents1.h5
|
||||
./tools/testfiles/tfcontents2.h5
|
||||
./tools/testfiles/tboot1.ddl
|
||||
./tools/testfiles/tboot2.ddl
|
||||
./tools/testfiles/tperror.ddl
|
||||
./tools/testfiles/tfill.ddl
|
||||
./tools/testfiles/tfvalues.h5
|
||||
./tools/testfiles/tstring2.ddl
|
||||
./tools/testfiles/tstr3.h5
|
||||
./tools/testfiles/taindices.h5
|
||||
./tools/testfiles/test_all.h5
|
||||
./tools/testfiles/test_deflate.h5
|
||||
./tools/testfiles/test_fletcher32.h5
|
||||
./tools/testfiles/test_shuffle.h5
|
||||
./tools/testfiles/test_szip.h5
|
||||
|
||||
|
||||
|
||||
# Expected output from h5ls tests
|
||||
./tools/testfiles/help-1.ls
|
||||
@@ -1340,6 +1663,7 @@
|
||||
./tools/testfiles/tbitfields.h5.xml
|
||||
./tools/testfiles/tcompound.h5.xml
|
||||
./tools/testfiles/tcompound2.h5.xml
|
||||
./tools/testfiles/tcompound_complex.h5.xml
|
||||
./tools/testfiles/tdatareg.h5.xml
|
||||
./tools/testfiles/tdset.h5.xml
|
||||
./tools/testfiles/tdset2.h5.xml
|
||||
@@ -1362,6 +1686,9 @@
|
||||
./tools/testfiles/tname-quot.h5.xml
|
||||
./tools/testfiles/tname-sp.h5
|
||||
./tools/testfiles/tname-sp.h5.xml
|
||||
./tools/testfiles/tnamed_dtype_attr.ddl
|
||||
./tools/testfiles/tnamed_dtype_attr.h5
|
||||
./tools/testfiles/tnamed_dtype_attr.h5.xml
|
||||
./tools/testfiles/tnestedcomp.h5.xml
|
||||
./tools/testfiles/tnodata.h5
|
||||
./tools/testfiles/tnodata.h5.xml
|
||||
@@ -1384,7 +1711,18 @@
|
||||
./tools/testfiles/tvldtypes1.h5.xml
|
||||
./tools/testfiles/tvldtypes2.h5.xml
|
||||
./tools/testfiles/tvldtypes3.h5.xml
|
||||
./tools/testfiles/tvldtypes4.h5.xml
|
||||
./tools/testfiles/tvldtypes5.h5.xml
|
||||
./tools/testfiles/tvlstr.h5.xml
|
||||
./tools/testfiles/tempty-dtd.h5.xml
|
||||
./tools/testfiles/tempty-dtd-uri.h5.xml
|
||||
./tools/testfiles/tempty-nons.h5.xml
|
||||
./tools/testfiles/tempty-nons-uri.h5.xml
|
||||
./tools/testfiles/tempty-ns.h5.xml
|
||||
./tools/testfiles/tempty-dtd-2.h5.xml
|
||||
./tools/testfiles/tempty-nons-2.h5.xml
|
||||
./tools/testfiles/tempty-ns-2.h5.xml
|
||||
./tools/testfiles/tall-2A.h5.xml
|
||||
|
||||
#test files for h5diff
|
||||
./tools/testfiles/file1.h5
|
||||
@@ -1393,6 +1731,8 @@
|
||||
./tools/testfiles/file4.h5
|
||||
./tools/testfiles/file5.h5
|
||||
./tools/testfiles/file6.h5
|
||||
./tools/testfiles/file7.h5
|
||||
./tools/testfiles/file8.h5
|
||||
./tools/testfiles/h5diff_10.txt
|
||||
./tools/testfiles/h5diff_11.txt
|
||||
./tools/testfiles/h5diff_12.txt
|
||||
@@ -1400,24 +1740,14 @@
|
||||
./tools/testfiles/h5diff_14.txt
|
||||
./tools/testfiles/h5diff_15.txt
|
||||
./tools/testfiles/h5diff_16.txt
|
||||
./tools/testfiles/h5diff_17.txt
|
||||
./tools/testfiles/h5diff_18.txt
|
||||
./tools/testfiles/h5diff_20.txt
|
||||
./tools/testfiles/h5diff_21.txt
|
||||
./tools/testfiles/h5diff_22.txt
|
||||
./tools/testfiles/h5diff_23.txt
|
||||
./tools/testfiles/h5diff_24.txt
|
||||
./tools/testfiles/h5diff_25.txt
|
||||
./tools/testfiles/h5diff_30.txt
|
||||
./tools/testfiles/h5diff_31.txt
|
||||
./tools/testfiles/h5diff_32.txt
|
||||
./tools/testfiles/h5diff_33.txt
|
||||
./tools/testfiles/h5diff_34.txt
|
||||
./tools/testfiles/h5diff_35.txt
|
||||
./tools/testfiles/h5diff_36.txt
|
||||
./tools/testfiles/h5diff_37.txt
|
||||
./tools/testfiles/h5diff_38.txt
|
||||
./tools/testfiles/h5diff_40.txt
|
||||
./tools/testfiles/h5diff_41.txt
|
||||
./tools/testfiles/h5diff_42.txt
|
||||
./tools/testfiles/h5diff_50.txt
|
||||
./tools/testfiles/h5diff_51.txt
|
||||
./tools/testfiles/h5diff_52.txt
|
||||
@@ -1456,7 +1786,16 @@
|
||||
./tools/testfiles/h5diff_627.txt
|
||||
./tools/testfiles/h5diff_628.txt
|
||||
./tools/testfiles/h5diff_629.txt
|
||||
./tools/testfiles/h5diff_70.txt
|
||||
./tools/testfiles/h5diff_80.txt
|
||||
|
||||
# h5repack test files
|
||||
./tools/testfiles/test0.h5
|
||||
./tools/testfiles/test1.h5
|
||||
./tools/testfiles/test3.h5
|
||||
./tools/testfiles/test4.h5
|
||||
./tools/testfiles/test5.h5
|
||||
./tools/testfiles/h5repack_info.txt
|
||||
|
||||
# windows
|
||||
./windows/all.zip
|
||||
./windows/all_withf90.zip
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
HDF5 version 1.6.0-pre1 currently under development
|
||||
HDF5 version 1.6.3 released on Wed Sep 22 11:30:11 CDT 2004
|
||||
Please refer to the release_docs/INSTALL file for installation instructions.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
315
bin/buildhdf5
Executable file
315
bin/buildhdf5
Executable file
@@ -0,0 +1,315 @@
|
||||
#!/bin/sh
|
||||
# Build HDF5 library by doing configure, make, and tests.
|
||||
# Usage: See USAGE()
|
||||
# Programmer: Albert Cheng
|
||||
# Creation date: Jul 9, 2003
|
||||
|
||||
# Some handy definitions
|
||||
USAGE()
|
||||
{
|
||||
cat <<EOF
|
||||
Buildhdf5 builds the HDF5 library by running configure, make and make check.
|
||||
It skips the configure part if one has been done already. In effect, one
|
||||
can continue from a previous build.
|
||||
|
||||
Command Syntax
|
||||
==============
|
||||
buildhdf5 [-config] [-gass] [-srcdir dir] config-arguments ...
|
||||
-config: run configure only. [default to do build too]
|
||||
-gass: configure for the GASS driver
|
||||
-help: show this help page
|
||||
-n: no execution, just show commands
|
||||
-srcdir: use dir as the source directory
|
||||
[Note: this is different from --srcdir
|
||||
which will be passed to configure]
|
||||
all other arguments are passed to configure
|
||||
|
||||
|
||||
Configure in place or by srcdir
|
||||
===============================
|
||||
By default, the command looks for the configure command in
|
||||
'.' and then '../hdf5'. When it finds it, it uses it to do
|
||||
the configure part. In effect, if ./configure is found, it
|
||||
does the build in place. If it finds ../hdf5/configure, it
|
||||
does the --srcdir (that is separated source) build. Therefore,
|
||||
if you have the following structure setup, you can run multiple
|
||||
hosts building simultantously using a common source code.
|
||||
hdf5_1.4/hdf5 # holds the source
|
||||
.../arabica # for SunOS 2.7
|
||||
.../arabicapp # for SunOS 2.7 parallel
|
||||
.../burrwhite # for Linux 2.4
|
||||
|
||||
Installing binary
|
||||
=================
|
||||
This command always install the binary in \$PWD/installdir.
|
||||
This allows multiple install testing in the same host if the srcdir
|
||||
configure is used.
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
TIMESTAMP()
|
||||
{
|
||||
echo "=====" "`date`" "====="
|
||||
}
|
||||
|
||||
|
||||
QUIT()
|
||||
{
|
||||
TIMESTAMP
|
||||
}
|
||||
|
||||
|
||||
# Do one step bracketed with time stamps
|
||||
# The '< /dev/null' is needed to prevent some applications like MPI
|
||||
# jobs blocked for reading when they read stdin unnecessary.
|
||||
STEP()
|
||||
{
|
||||
banner="$1"
|
||||
command="$2"
|
||||
resultfile="$3"
|
||||
|
||||
echo "$banner"
|
||||
(TIMESTAMP; nerror=0 ;
|
||||
echo "eval $command"
|
||||
eval $command || nerror=1 ;
|
||||
TIMESTAMP; exit $nerror) < /dev/null >> "$resultfile" 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "error in '$banner'. buildhdf5 aborted."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Try locate the HDF4 library
|
||||
# This is a hack because there is no consistent place to find
|
||||
# the valid HDF library.
|
||||
LOCATE_HDF4()
|
||||
{
|
||||
OS=`uname -s`
|
||||
echo OS=$OS
|
||||
case "$OS" in
|
||||
HP-UX)
|
||||
h4paths="/afs/ncsa/packages/hdf/HPUX_10.20"
|
||||
;;
|
||||
IRIX)
|
||||
h4paths="/afs/ncsa/packages/hdf/4.1r3_irix"
|
||||
;;
|
||||
IRIX64)
|
||||
case "$CC" in
|
||||
*-n32)
|
||||
h4paths="/afs/ncsa/packages/hdf/IRIX64-n32_6.5"
|
||||
;;
|
||||
*)
|
||||
h4paths="/afs/ncsa/packages/hdf/IRIX64_6.5"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
Linux)
|
||||
h4paths="/afs/ncsa/packages/hdf/linux"
|
||||
;;
|
||||
OSF1)
|
||||
h4paths="/afs/ncsa/packages/hdf/OSF1_V4.0"
|
||||
;;
|
||||
*)
|
||||
h4paths="/usr/ncsa /usr/sdt"
|
||||
;;
|
||||
esac
|
||||
echo $h4paths
|
||||
for h4 in $h4paths; do
|
||||
if [ -f $h4/lib/libdf.a -a -f $h4/include/hdf.h ]; then
|
||||
WITH_H4="--with-hdf4=$h4/include,$h4/lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo WITH_H4="$WITH_H4"
|
||||
}
|
||||
|
||||
|
||||
# Try locate the Fortran compiler
|
||||
# This is a hack because there is no consistent fortran compiler name
|
||||
LOCATE_FORTRAN()
|
||||
{
|
||||
OS=`uname -s`
|
||||
echo OS=$OS
|
||||
case "$OS" in
|
||||
IRIX64)
|
||||
case "$CC" in
|
||||
*-n32)
|
||||
gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-n32_nothreads_standard_debug
|
||||
sslpaths=/usr/local/ssl-n32
|
||||
;;
|
||||
*)
|
||||
gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-64_nothreads_standard_debug
|
||||
sslpaths=/usr/local/ssl
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
echo gasspaths=$gasspaths
|
||||
echo $sslpaths=$sslpaths
|
||||
for x in $gasspaths dummy; do
|
||||
if [ $x != dummy -a -f $x/lib/libglobus_gass_cache.a ]; then
|
||||
WITH_GASS="--with-gass=$x/include,$x/lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
for x in $sslpaths dummy; do
|
||||
if [ $x != dummy -a -f $x/lib/libssl.a ]; then
|
||||
WITH_SSL="--with-ssl=$x/lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo WITH_GASS="$WITH_GASS"
|
||||
echo WITH_SSL="$WITH_SSL"
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Try locate the GASS software library
|
||||
# This is a hack because there is no consistent place to find
|
||||
# the valid HDF library.
|
||||
LOCATE_GASS()
|
||||
{
|
||||
OS=`uname -s`
|
||||
echo OS=$OS
|
||||
case "$OS" in
|
||||
IRIX64)
|
||||
case "$CC" in
|
||||
*-n32)
|
||||
gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-n32_nothreads_standard_debug
|
||||
sslpaths=/usr/local/ssl-n32
|
||||
;;
|
||||
*)
|
||||
gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-64_nothreads_standard_debug
|
||||
sslpaths=/usr/local/ssl
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
echo gasspaths=$gasspaths
|
||||
echo $sslpaths=$sslpaths
|
||||
for x in $gasspaths dummy; do
|
||||
if [ $x != dummy -a -f $x/lib/libglobus_gass_cache.a ]; then
|
||||
WITH_GASS="--with-gass=$x/include,$x/lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
for x in $sslpaths dummy; do
|
||||
if [ $x != dummy -a -f $x/lib/libssl.a ]; then
|
||||
WITH_SSL="--with-ssl=$x/lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo WITH_GASS="$WITH_GASS"
|
||||
echo WITH_SSL="$WITH_SSL"
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Configure. Default to do --srcdir.
|
||||
CONFIG()
|
||||
{
|
||||
INSTALLDIR=`pwd`/installdir
|
||||
|
||||
test -d $INSTALLDIR || ( echo mkdir $INSTALLDIR; \
|
||||
test "$NOEXEC" != 'noexec' && mkdir $INSTALLDIR )
|
||||
CMD="$SRCDIR/configure --prefix=$INSTALLDIR $*"
|
||||
echo $CMD
|
||||
if [ "$NOEXEC" != 'noexec' ]; then
|
||||
$CMD
|
||||
else
|
||||
true # set exit code as 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Main body
|
||||
TIMESTAMP
|
||||
trap QUIT 0
|
||||
|
||||
#
|
||||
# setup
|
||||
#
|
||||
MAKE=${MAKE:-'gmake'}
|
||||
export MAKE
|
||||
CONFIGURE="CONFIG"
|
||||
CONFIG_ONLY=no # default is configure and build
|
||||
NOEXEC= # default to execute commands
|
||||
SRCDIRLIST=". ../hdf5" # places to look for configure
|
||||
nerror=0
|
||||
|
||||
# parse some options
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-config)
|
||||
# do configure only
|
||||
CONFIG_ONLY=yes
|
||||
;;
|
||||
-gass)
|
||||
LOCATE_GASS
|
||||
;;
|
||||
-help)
|
||||
USAGE
|
||||
exit 0
|
||||
;;
|
||||
-n)
|
||||
NOEXEC='noexec'
|
||||
;;
|
||||
-srcdir)
|
||||
shift
|
||||
SRCDIRLIST="$1"
|
||||
;;
|
||||
*) # Quit parsing
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Figure out if srcdir is wished.
|
||||
# Make sure we are at the library root level
|
||||
# by checking couple typical files. Not bullet-proof.
|
||||
for SRCDIR in $SRCDIRLIST dummy; do
|
||||
if [ x-$SRCDIR = x-dummy ]; then
|
||||
break
|
||||
fi
|
||||
if [ -d $SRCDIR/src -a -d $SRCDIR/config -a -f $SRCDIR/configure ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ x-$SRCDIR = x-dummy ]; then
|
||||
echo "Could not find the source dir or configure script. Abort."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Configure
|
||||
# no configure if already done.
|
||||
if [ ! -f config.status ]; then
|
||||
CONFIGURE="$CONFIGURE $WITH_SSL $WITH_GASS"
|
||||
STEP "Configure HDF5..." "$CONFIGURE $*" "#config"
|
||||
else
|
||||
STEP "Confiugre Skipped" "echo Confiugre Skipped" "#config"
|
||||
fi
|
||||
|
||||
if [ x-$CONFIG_ONLY = x-yes ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
# Compile
|
||||
STEP "Make HDF5..." "$MAKE" "#make"
|
||||
|
||||
# Tests
|
||||
STEP "Testing HDF5..." "$MAKE check" "#test"
|
||||
|
||||
# all done
|
||||
echo "No Errors encountered"
|
||||
TIMESTAMP
|
||||
288
bin/chkcopyright
Executable file
288
bin/chkcopyright
Executable file
@@ -0,0 +1,288 @@
|
||||
#! /bin/sh
|
||||
##
|
||||
## Copyright by the Board of Trustees of the University of Illinois.
|
||||
## All rights reserved.
|
||||
##
|
||||
## This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
## terms governing use, modification, and redistribution, is contained in
|
||||
## the files COPYING and Copyright.html. COPYING can be found at the root
|
||||
## of the source code distribution tree; Copyright.html can be found at the
|
||||
## root level of an installed copy of the electronic HDF5 document set and
|
||||
## is linked from the top-level documents page. It can also be found at
|
||||
## http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have
|
||||
## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
|
||||
##
|
||||
|
||||
# Check Copyright notice.
|
||||
# Check that all the files have the proper copyright notice.
|
||||
# It goes down directories recursively.
|
||||
#
|
||||
# Programmer: Albert Cheng
|
||||
# Created Data: 2003/07/22
|
||||
|
||||
PROGNAME=$0
|
||||
DIFF="diff"
|
||||
COPYRIGHTFILE=/tmp/copy.$$
|
||||
EXTRACTEDFILE=/tmp/extracted.$$
|
||||
VERBOSE= # default no
|
||||
DIRS=. # default current directory
|
||||
|
||||
|
||||
USAGE()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: $PROGNAME [-h | -help] [-fname name-patter] [-v | -v9] [dir1 dir2 ...]
|
||||
Check copyright notices of files in [dir1 dir2 ...}.
|
||||
Default is to check files in current directory.
|
||||
-h | -help
|
||||
show this page.
|
||||
-fname name-pattern
|
||||
limit to files of name-pattern
|
||||
-v
|
||||
verbose mode
|
||||
-v9
|
||||
highly verbose
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
# Parse Options
|
||||
#
|
||||
PARSE_OPTION()
|
||||
{
|
||||
while test $# -gt 0 ; do
|
||||
case "$1" in
|
||||
-h | -help )
|
||||
USAGE
|
||||
exit 0
|
||||
;;
|
||||
-fname )
|
||||
shift
|
||||
FNAME="$1"
|
||||
;;
|
||||
-v* )
|
||||
VERBOSE=yes
|
||||
if test X$1 = X-v9; then
|
||||
set -x
|
||||
fi
|
||||
;;
|
||||
-* )
|
||||
echo "***Unknown option ($1)"
|
||||
USAGE
|
||||
exit 1
|
||||
;;
|
||||
* )
|
||||
DIRS=$*
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# Check C and C++ source files
|
||||
#
|
||||
C_SOURCE()
|
||||
{
|
||||
f=$1
|
||||
cat > ${COPYRIGHTFILE} << \EOF
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
EOF
|
||||
# Must use stdin for wc to prevent filename from popping up.
|
||||
nlines=`wc -l < ${COPYRIGHTFILE}| tr -d ' '`
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
# show the difference
|
||||
echo ${f}:
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Check Fortran90 source files
|
||||
#
|
||||
FORTRAN_SOURCE()
|
||||
{
|
||||
f=$1
|
||||
cat > ${COPYRIGHTFILE} << \EOF
|
||||
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
! Copyright by the Board of Trustees of the University of Illinois. *
|
||||
! All rights reserved. *
|
||||
! *
|
||||
! This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
! terms governing use, modification, and redistribution, is contained in *
|
||||
! the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
! of the source code distribution tree; Copyright.html can be found at the *
|
||||
! root level of an installed copy of the electronic HDF5 document set and *
|
||||
! is linked from the top-level documents page. It can also be found at *
|
||||
! http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
EOF
|
||||
# Must use stdin for wc to prevent filename from popping up.
|
||||
nlines=`wc -l < ${COPYRIGHTFILE}| tr -d ' '`
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
# show the differences
|
||||
echo ${f}:
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Check HTML Files
|
||||
#
|
||||
HTML_FILE()
|
||||
{
|
||||
f=$1
|
||||
cat > ${COPYRIGHTFILE} << \EOF
|
||||
<!--
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
-->
|
||||
EOF
|
||||
# Must use stdin for wc to prevent filename from popping up.
|
||||
nlines=`wc -l < ${COPYRIGHTFILE}| tr -d ' '`
|
||||
sed -n -e '/^<!--$/,/^ -->$/p' < $f | head -${nlines} > ${EXTRACTEDFILE}
|
||||
$DIFF ${EXTRACTEDFILE} ${COPYRIGHTFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
# show the differences
|
||||
echo ${f}:
|
||||
$DIFF ${EXTRACTEDFILE} ${COPYRIGHTFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Check Shell script files
|
||||
#
|
||||
SHELL_FILE()
|
||||
{
|
||||
f=$1
|
||||
cat > ${COPYRIGHTFILE} << \EOF
|
||||
#! /bin/sh
|
||||
##
|
||||
## Copyright by the Board of Trustees of the University of Illinois.
|
||||
## All rights reserved.
|
||||
##
|
||||
## This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
## terms governing use, modification, and redistribution, is contained in
|
||||
## the files COPYING and Copyright.html. COPYING can be found at the root
|
||||
## of the source code distribution tree; Copyright.html can be found at the
|
||||
## root level of an installed copy of the electronic HDF5 document set and
|
||||
## is linked from the top-level documents page. It can also be found at
|
||||
## http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have
|
||||
## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
|
||||
##
|
||||
EOF
|
||||
# Must use stdin for wc to prevent filename from popping up.
|
||||
nlines=`wc -l < ${COPYRIGHTFILE}| tr -d ' '`
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
# show the differences
|
||||
echo ${f}:
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Check Makefile
|
||||
#
|
||||
MAKE_FILE()
|
||||
{
|
||||
f=$1
|
||||
cat > ${COPYRIGHTFILE} << \EOF
|
||||
##
|
||||
## Copyright by the Board of Trustees of the University of Illinois.
|
||||
## All rights reserved.
|
||||
##
|
||||
## This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
## terms governing use, modification, and redistribution, is contained in
|
||||
## the files COPYING and Copyright.html. COPYING can be found at the root
|
||||
## of the source code distribution tree; Copyright.html can be found at the
|
||||
## root level of an installed copy of the electronic HDF5 document set and
|
||||
## is linked from the top-level documents page. It can also be found at
|
||||
## http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have
|
||||
## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
|
||||
##
|
||||
EOF
|
||||
# Must use stdin for wc to prevent filename from popping up.
|
||||
nlines=`wc -l < ${COPYRIGHTFILE}| tr -d ' '`
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE} >/dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
# show the differences
|
||||
echo ${f}:
|
||||
head -${nlines} $f | $DIFF - ${COPYRIGHTFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Main body
|
||||
|
||||
PARSE_OPTION "$@"
|
||||
|
||||
# use find to list all those file names and process them
|
||||
# one by one.
|
||||
(
|
||||
if test -z "$FNAME" ; then
|
||||
find $DIRS -type f -print
|
||||
else
|
||||
find $DIRS -type f -name "${FNAME}" -print
|
||||
fi
|
||||
) |
|
||||
while read file; do
|
||||
if test X-$VERBOSE = X-yes; then
|
||||
echo checking ${file}...
|
||||
fi
|
||||
case ${file} in
|
||||
*.c | *.h | *.cpp )
|
||||
C_SOURCE ${file}
|
||||
;;
|
||||
*.f90 )
|
||||
FORTRAN_SOURCE ${file}
|
||||
;;
|
||||
*.htm | *.html )
|
||||
HTML_FILE ${file}
|
||||
;;
|
||||
*.sh | *.sh.in )
|
||||
SHELL_FILE ${file}
|
||||
;;
|
||||
*Makefile | *Makefile.in )
|
||||
MAKE_FILE ${file}
|
||||
;;
|
||||
*CVS/* )
|
||||
# Skip
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
echo "Unknown file type (${file})"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Cleanup
|
||||
rm -f ${EXTRACTEDFILE} ${COPYRIGHTFILE}
|
||||
587
bin/config.guess
vendored
587
bin/config.guess
vendored
@@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2001-09-04'
|
||||
timestamp='2004-03-03'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -24,8 +24,9 @@ timestamp='2001-09-04'
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
# Originally written by Per Bothner <per@bothner.com>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
@@ -87,30 +88,42 @@ if test $# != 0; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'exit 1' 1 2 15
|
||||
|
||||
dummy=dummy-$$
|
||||
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
|
||||
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
|
||||
# compiler to aid in system detection is discouraged as it requires
|
||||
# temporary files to be created and, as you can see below, it is a
|
||||
# headache to deal with in a portable fashion.
|
||||
|
||||
# CC_FOR_BUILD -- compiler used by this script.
|
||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
||||
# use `HOST_CC' if defined, but it is deprecated.
|
||||
|
||||
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||
,,) echo "int dummy(){}" > $dummy.c ;
|
||||
for c in cc gcc c89 ; do
|
||||
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
|
||||
if test $? = 0 ; then
|
||||
# Portable tmp directory creation inspired by the Autoconf team.
|
||||
|
||||
set_cc_for_build='
|
||||
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
dummy=$tmp/dummy ;
|
||||
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
||||
case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||
,,) echo "int x;" > $dummy.c ;
|
||||
for c in cc gcc c89 c99 ; do
|
||||
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
|
||||
CC_FOR_BUILD="$c"; break ;
|
||||
fi ;
|
||||
done ;
|
||||
rm -f $dummy.c $dummy.o $dummy.rel ;
|
||||
if test x"$CC_FOR_BUILD" = x ; then
|
||||
CC_FOR_BUILD=no_compiler_found ;
|
||||
fi
|
||||
;;
|
||||
,,*) CC_FOR_BUILD=$CC ;;
|
||||
,*,*) CC_FOR_BUILD=$HOST_CC ;;
|
||||
esac'
|
||||
esac ;'
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 1994-08-24)
|
||||
@@ -127,29 +140,30 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:NetBSD:*:*)
|
||||
# Netbsd (nbsd) targets should (where applicable) match one or
|
||||
# NetBSD (nbsd) targets should (where applicable) match one or
|
||||
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
||||
# switched to ELF, *-*-netbsd* would select the old
|
||||
# object file format. This provides both forward
|
||||
# compatibility and a consistent mechanism for selecting the
|
||||
# object file format.
|
||||
# Determine the machine/vendor (is the vendor relevant).
|
||||
case "${UNAME_MACHINE}" in
|
||||
amiga) machine=m68k-unknown ;;
|
||||
arm32) machine=arm-unknown ;;
|
||||
atari*) machine=m68k-atari ;;
|
||||
sun3*) machine=m68k-sun ;;
|
||||
mac68k) machine=m68k-apple ;;
|
||||
macppc) machine=powerpc-apple ;;
|
||||
hp3[0-9][05]) machine=m68k-hp ;;
|
||||
ibmrt|romp-ibm) machine=romp-ibm ;;
|
||||
*) machine=${UNAME_MACHINE}-unknown ;;
|
||||
#
|
||||
# Note: NetBSD doesn't particularly care about the vendor
|
||||
# portion of the name. We always set it to "unknown".
|
||||
sysctl="sysctl -n hw.machine_arch"
|
||||
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
|
||||
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
|
||||
case "${UNAME_MACHINE_ARCH}" in
|
||||
armeb) machine=armeb-unknown ;;
|
||||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
# to ELF recently, or will in the future.
|
||||
case "${UNAME_MACHINE}" in
|
||||
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
|
||||
case "${UNAME_MACHINE_ARCH}" in
|
||||
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
||||
eval $set_cc_for_build
|
||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep __ELF__ >/dev/null
|
||||
@@ -166,74 +180,135 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
;;
|
||||
esac
|
||||
# The OS release
|
||||
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
# Debian GNU/NetBSD machines have a different userland, and
|
||||
# thus, need a distinct triplet. However, they do not need
|
||||
# kernel version information, so it can be replaced with a
|
||||
# suitable tag, in the style of linux-gnu.
|
||||
case "${UNAME_VERSION}" in
|
||||
Debian*)
|
||||
release='-gnu'
|
||||
;;
|
||||
*)
|
||||
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
;;
|
||||
esac
|
||||
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
|
||||
# contains redundant information, the shorter form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit 0 ;;
|
||||
amd64:OpenBSD:*:*)
|
||||
echo x86_64-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
cats:OpenBSD:*:*)
|
||||
echo arm-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
macppc:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvmeppc:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pegasos:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sgi:OpenBSD:*:*)
|
||||
echo mipseb-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:ekkoBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:MirBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
case $UNAME_RELEASE in
|
||||
*4.0)
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
fi
|
||||
;;
|
||||
*5.*)
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
;;
|
||||
esac
|
||||
# According to Compaq, /usr/sbin/psrinfo has been available on
|
||||
# OSF/1 and Tru64 systems produced since 1995. I hope that
|
||||
# covers most systems running today. This code pipes the CPU
|
||||
# types through head -n 1, so we only detect the type of CPU 0.
|
||||
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
|
||||
case "$ALPHA_CPU_TYPE" in
|
||||
"EV4 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV4.5 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"LCA4 (21066/21068)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV5 (21164)")
|
||||
UNAME_MACHINE="alphaev5" ;;
|
||||
"EV5.6 (21164A)")
|
||||
UNAME_MACHINE="alphaev56" ;;
|
||||
"EV5.6 (21164PC)")
|
||||
UNAME_MACHINE="alphapca56" ;;
|
||||
"EV5.7 (21164PC)")
|
||||
UNAME_MACHINE="alphapca57" ;;
|
||||
"EV6 (21264)")
|
||||
UNAME_MACHINE="alphaev6" ;;
|
||||
"EV6.7 (21264A)")
|
||||
UNAME_MACHINE="alphaev67" ;;
|
||||
"EV6.8CB (21264C)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8AL (21264B)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8CX (21264D)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.9A (21264/EV69A)")
|
||||
UNAME_MACHINE="alphaev69" ;;
|
||||
"EV7 (21364)")
|
||||
UNAME_MACHINE="alphaev7" ;;
|
||||
"EV7.9 (21364A)")
|
||||
UNAME_MACHINE="alphaev79" ;;
|
||||
esac
|
||||
# A Pn.n version is a patched version.
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
cat <<EOF >$dummy.s
|
||||
.data
|
||||
\$Lformat:
|
||||
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
|
||||
|
||||
.text
|
||||
.globl main
|
||||
.align 4
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,16,\$26,0
|
||||
ldgp \$29,0(\$27)
|
||||
.prologue 1
|
||||
.long 0x47e03d80 # implver \$0
|
||||
lda \$2,-1
|
||||
.long 0x47e20c21 # amask \$2,\$1
|
||||
lda \$16,\$Lformat
|
||||
mov \$0,\$17
|
||||
not \$1,\$18
|
||||
jsr \$26,printf
|
||||
ldgp \$29,0(\$26)
|
||||
mov 0,\$16
|
||||
jsr \$26,exit
|
||||
.end main
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
case `./$dummy` in
|
||||
0-0)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
1-0)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
1-1)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
1-101)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
2-303)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
2-307)
|
||||
UNAME_MACHINE="alphaev67"
|
||||
;;
|
||||
2-1307)
|
||||
UNAME_MACHINE="alphaev68"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit 0 ;;
|
||||
Alpha*:OpenVMS:*:*)
|
||||
echo alpha-hp-vms
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
@@ -247,33 +322,18 @@ EOF
|
||||
Amiga*:UNIX_System_V:4.0:*)
|
||||
echo m68k-unknown-sysv4
|
||||
exit 0;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:[Aa]miga[Oo][Ss]:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-amigaos
|
||||
exit 0 ;;
|
||||
arc64:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hkmips:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sgi:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
*:[Mm]orph[Oo][Ss]:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-morphos
|
||||
exit 0 ;;
|
||||
*:OS/390:*:*)
|
||||
echo i370-ibm-openedition
|
||||
exit 0 ;;
|
||||
*:OS400:*:*)
|
||||
echo powerpc-ibm-os400
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
@@ -291,6 +351,13 @@ EOF
|
||||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
DRS?6000:unix:4.0:6*)
|
||||
echo sparc-icl-nx6
|
||||
exit 0 ;;
|
||||
DRS?6000:UNIX_SV:4.2*:7*)
|
||||
case `/usr/bin/uname -p` in
|
||||
sparc) echo sparc-icl-nx7 && exit 0 ;;
|
||||
esac ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
@@ -319,7 +386,7 @@ EOF
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun*:*:4.2BSD:*)
|
||||
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
|
||||
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
|
||||
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
|
||||
case "`/bin/arch`" in
|
||||
sun3)
|
||||
@@ -333,12 +400,6 @@ EOF
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:NetBSD:*)
|
||||
echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
# The situation for MiNT is a little confusing. The machine name
|
||||
# can be virtually everything (everything which is not
|
||||
# "atarist" or "atariste" at least should have a processor
|
||||
@@ -365,17 +426,8 @@ EOF
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
m68k:machten:*:*)
|
||||
echo m68k-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
@@ -415,15 +467,20 @@ EOF
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy \
|
||||
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c \
|
||||
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& exit 0
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Motorola:PowerMAX_OS:*:*)
|
||||
echo powerpc-motorola-powermax
|
||||
exit 0 ;;
|
||||
Motorola:*:4.3:PL8-*)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
echo powerpc-harris-powerunix
|
||||
exit 0 ;;
|
||||
@@ -496,8 +553,7 @@ EOF
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
@@ -506,7 +562,7 @@ EOF
|
||||
fi
|
||||
exit 0 ;;
|
||||
*:AIX:*:[45])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
else
|
||||
@@ -546,10 +602,8 @@ EOF
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/[678][0-9][0-9])
|
||||
case "${HPUX_REV}" in
|
||||
11.[0-9][0-9])
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
@@ -558,13 +612,13 @@ EOF
|
||||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
|
||||
esac ;;
|
||||
esac
|
||||
fi ;;
|
||||
esac
|
||||
if [ "${HP_ARCH}" = "" ]; then
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
fi
|
||||
if [ "${HP_ARCH}" = "" ]; then
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
@@ -597,11 +651,21 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
|
||||
rm -f $dummy.c $dummy
|
||||
fi ;;
|
||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
test -z "$HP_ARCH" && HP_ARCH=hppa
|
||||
fi ;;
|
||||
esac
|
||||
if [ ${HP_ARCH} = "hppa2.0w" ]
|
||||
then
|
||||
# avoid double evaluation of $set_cc_for_build
|
||||
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
|
||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
|
||||
then
|
||||
HP_ARCH="hppa2.0w"
|
||||
else
|
||||
HP_ARCH="hppa64"
|
||||
fi
|
||||
fi
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
ia64:HP-UX:*:*)
|
||||
@@ -635,8 +699,7 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
@@ -664,9 +727,6 @@ EOF
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
hppa*:OpenBSD:*:*)
|
||||
echo hppa-unknown-openbsd
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
@@ -685,9 +745,6 @@ EOF
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:*:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
@@ -700,26 +757,25 @@ EOF
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*T3D:*:*:*)
|
||||
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*T3E:*:*:*)
|
||||
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*SV1:*:*:*)
|
||||
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
*:UNICOS/mp:*:*)
|
||||
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
|
||||
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
5000:UNIX_System_V:4.*:*)
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
@@ -731,10 +787,21 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
# Determine whether the default compiler uses glibc.
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
|
||||
# FreeBSD's kernel, but not the complete OS.
|
||||
case ${LIBC} in gnu) kernel_only='k' ;; esac
|
||||
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
@@ -745,11 +812,17 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit 0 ;;
|
||||
x86:Interix*:[34]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
exit 0 ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit 0 ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
# UNAME_MACHINE based on the output of uname instead of i386?
|
||||
echo i386-pc-interix
|
||||
echo i586-pc-interix
|
||||
exit 0 ;;
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
@@ -761,25 +834,65 @@ EOF
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
exit 0 ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit 0 ;;
|
||||
arm*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux-gnu
|
||||
exit 0 ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
mips:Linux:*:*)
|
||||
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
|
||||
big) echo mips-unknown-linux-gnu && exit 0 ;;
|
||||
little) echo mipsel-unknown-linux-gnu && exit 0 ;;
|
||||
esac
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips
|
||||
#undef mipsel
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mipsel
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips64
|
||||
#undef mips64el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mips64el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips64
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
||||
;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
@@ -815,6 +928,9 @@ EOF
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit 0 ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
@@ -828,7 +944,8 @@ EOF
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
ld_supported_targets=`cd /; ld --help 2>&1 \
|
||||
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||
| sed -ne '/supported targets:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported targets: *//
|
||||
@@ -840,7 +957,7 @@ EOF
|
||||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit 0 ;;
|
||||
exit 0 ;;
|
||||
coff-i386)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
|
||||
exit 0 ;;
|
||||
@@ -852,32 +969,31 @@ EOF
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
eval $set_cc_for_build
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
#ifdef __cplusplus
|
||||
#include <stdio.h> /* for printf() prototype */
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
printf ("%s-pc-linux-gnu\n", argv[1]);
|
||||
# else
|
||||
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
# else
|
||||
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
#else
|
||||
printf ("%s-pc-linux-gnuaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#ifdef __INTEL_COMPILER
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
|
||||
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
|
||||
;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
@@ -894,6 +1010,26 @@ EOF
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
echo ${UNAME_MACHINE}-pc-os2-emx
|
||||
exit 0 ;;
|
||||
i*86:XTS-300:*:STOP)
|
||||
echo ${UNAME_MACHINE}-unknown-stop
|
||||
exit 0 ;;
|
||||
i*86:atheos:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-atheos
|
||||
exit 0 ;;
|
||||
i*86:syllable:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-syllable
|
||||
exit 0 ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i*86:*DOS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
|
||||
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
@@ -915,22 +1051,19 @@ EOF
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
|
||||
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
|
||||
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
i*86:*DOS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# Left here for compatibility:
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
@@ -954,9 +1087,15 @@ EOF
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
mc68k:UNIX:SYSTEM5:3.51m)
|
||||
echo m68k-convergent-sysv
|
||||
exit 0 ;;
|
||||
M680?0:D-NIX:5.3:*)
|
||||
echo m68k-diab-dnix
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
||||
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
@@ -973,9 +1112,6 @@ EOF
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -1047,6 +1183,9 @@ EOF
|
||||
SX-5:SUPER-UX:*:*)
|
||||
echo sx5-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -1054,18 +1193,24 @@ EOF
|
||||
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Darwin:*:*)
|
||||
echo `uname -p`-apple-darwin${UNAME_RELEASE}
|
||||
case `uname -p` in
|
||||
*86) UNAME_PROCESSOR=i686 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
if test "${UNAME_MACHINE}" = "x86pc"; then
|
||||
UNAME_PROCESSOR=`uname -p`
|
||||
if test "$UNAME_PROCESSOR" = "x86"; then
|
||||
UNAME_PROCESSOR=i386
|
||||
UNAME_MACHINE=pc
|
||||
fi
|
||||
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
|
||||
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit 0 ;;
|
||||
NSR-[KW]:NONSTOP_KERNEL:*:*)
|
||||
NSR-?:NONSTOP_KERNEL:*:*)
|
||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:NonStop-UX:*:*)
|
||||
@@ -1088,11 +1233,6 @@ EOF
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unknown-plan9
|
||||
exit 0 ;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
echo ${UNAME_MACHINE}-pc-os2-emx
|
||||
exit 0 ;;
|
||||
*:TOPS-10:*:*)
|
||||
echo pdp10-unknown-tops10
|
||||
exit 0 ;;
|
||||
@@ -1111,11 +1251,11 @@ EOF
|
||||
*:ITS:*:*)
|
||||
echo pdp10-unknown-its
|
||||
exit 0 ;;
|
||||
i*86:XTS-300:*:STOP)
|
||||
echo ${UNAME_MACHINE}-unknown-stop
|
||||
SEI:*:*:SEIUX)
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i*86:atheos:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-atheos
|
||||
*:DragonFly:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
@@ -1237,8 +1377,7 @@ main ()
|
||||
}
|
||||
EOF
|
||||
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
|
||||
352
bin/config.sub
vendored
352
bin/config.sub
vendored
@@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2001-09-07'
|
||||
timestamp='2004-02-23'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -29,7 +29,8 @@ timestamp='2001-09-07'
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
@@ -117,7 +118,8 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
|
||||
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@@ -226,32 +228,46 @@ case $basic_machine in
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dsp16xx \
|
||||
| fr30 \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
|
||||
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
|
||||
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
|
||||
| mipsisa32 \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| msp430 \
|
||||
| ns16k | ns32k \
|
||||
| openrisc \
|
||||
| openrisc | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| s390 | s390x \
|
||||
| sh | sh[34] | sh[34]eb | shbe | shle \
|
||||
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| stormy16 | strongarm \
|
||||
| tahoe | thumb | tic80 | tron \
|
||||
| v850 \
|
||||
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xscale \
|
||||
| x86 | xscale | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
@@ -278,38 +294,56 @@ case $basic_machine in
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alphapca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armv*-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c54x-* \
|
||||
| clipper-* | cray2-* | cydra-* \
|
||||
| d10v-* | d30v-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* \
|
||||
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
|
||||
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
|
||||
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| msp430-* \
|
||||
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| s390-* | s390x-* \
|
||||
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
|
||||
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
|
||||
| v850-* | vax-* \
|
||||
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
|
||||
| xtensa-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
@@ -329,6 +363,9 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
abacus)
|
||||
basic_machine=abacus-unknown
|
||||
;;
|
||||
adobe68k)
|
||||
basic_machine=m68010-adobe
|
||||
os=-scout
|
||||
@@ -343,6 +380,12 @@ case $basic_machine in
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amd64)
|
||||
basic_machine=x86_64-pc
|
||||
;;
|
||||
amd64-*)
|
||||
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
@@ -374,6 +417,10 @@ case $basic_machine in
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
@@ -394,17 +441,13 @@ case $basic_machine in
|
||||
basic_machine=c38-convex
|
||||
os=-bsd
|
||||
;;
|
||||
cray | ymp)
|
||||
basic_machine=ymp-cray
|
||||
cray | j90)
|
||||
basic_machine=j90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cray2)
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[cjt]90)
|
||||
basic_machine=${basic_machine}-cray
|
||||
os=-unicos
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
@@ -412,12 +455,24 @@ case $basic_machine in
|
||||
cris | cris-* | etrax*)
|
||||
basic_machine=cris-axis
|
||||
;;
|
||||
crx)
|
||||
basic_machine=crx-unknown
|
||||
os=-elf
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||
basic_machine=mips-dec
|
||||
;;
|
||||
decsystem10* | dec10*)
|
||||
basic_machine=pdp10-dec
|
||||
os=-tops10
|
||||
;;
|
||||
decsystem20* | dec20*)
|
||||
basic_machine=pdp10-dec
|
||||
os=-tops20
|
||||
;;
|
||||
delta | 3300 | motorola-3300 | motorola-delta \
|
||||
| 3300-motorola | delta-motorola)
|
||||
basic_machine=m68k-motorola
|
||||
@@ -598,14 +653,6 @@ case $basic_machine in
|
||||
basic_machine=m68k-atari
|
||||
os=-mint
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
@@ -620,6 +667,10 @@ case $basic_machine in
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
morphos)
|
||||
basic_machine=powerpc-unknown
|
||||
os=-morphos
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
@@ -692,6 +743,10 @@ case $basic_machine in
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
nv1)
|
||||
basic_machine=nv1-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
@@ -699,6 +754,14 @@ case $basic_machine in
|
||||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
;;
|
||||
or32 | or32-*)
|
||||
basic_machine=or32-unknown
|
||||
os=-coff
|
||||
;;
|
||||
os400)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-os400
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
@@ -721,49 +784,55 @@ case $basic_machine in
|
||||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexgen)
|
||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | 6x86 | athlon)
|
||||
pentiumpro | p6 | 6x86 | athlon | athlon_*)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
pentiumii | pentium2 | pentiumiii | pentium3)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
|
||||
pentium4)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium4-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
;;
|
||||
;;
|
||||
ppc64le-* | powerpc64little-*)
|
||||
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
@@ -784,10 +853,26 @@ case $basic_machine in
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
s390 | s390-*)
|
||||
basic_machine=s390-ibm
|
||||
;;
|
||||
s390x | s390x-*)
|
||||
basic_machine=s390x-ibm
|
||||
;;
|
||||
sa29200)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sb1)
|
||||
basic_machine=mipsisa64sb1-unknown
|
||||
;;
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
@@ -795,7 +880,10 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sparclite-wrs)
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparclite-wrs | simso-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
@@ -862,22 +950,42 @@ case $basic_machine in
|
||||
os=-dynix
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=t3e-cray
|
||||
basic_machine=alphaev5-cray
|
||||
os=-unicos
|
||||
;;
|
||||
t90)
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
tx39el)
|
||||
basic_machine=mipstx39el-unknown
|
||||
;;
|
||||
toad1)
|
||||
basic_machine=pdp10-xkl
|
||||
os=-tops20
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
tpf)
|
||||
basic_machine=s390x-ibm
|
||||
os=-tpf
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
@@ -899,8 +1007,8 @@ case $basic_machine in
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
@@ -921,17 +1029,13 @@ case $basic_machine in
|
||||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
windows32)
|
||||
basic_machine=i386-pc
|
||||
os=-windows32-msvcrt
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
xps | xps100)
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
z8k-*-coff)
|
||||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
@@ -952,13 +1056,6 @@ case $basic_machine in
|
||||
op60c)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
mips)
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
else
|
||||
basic_machine=mips-mips
|
||||
fi
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
@@ -978,13 +1075,16 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4 | sh3eb | sh4eb)
|
||||
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
@@ -999,10 +1099,6 @@ case $basic_machine in
|
||||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*-unknown)
|
||||
# Make sure to match an already-canonicalized machine name.
|
||||
;;
|
||||
@@ -1058,17 +1154,20 @@ case $os in
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos*)
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@@ -1080,8 +1179,10 @@ case $os in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-nto-qnx*)
|
||||
;;
|
||||
-nto*)
|
||||
os=-nto-qnx
|
||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
@@ -1090,6 +1191,9 @@ case $os in
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux-dietlibc)
|
||||
os=-linux-dietlibc
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
@@ -1102,6 +1206,9 @@ case $os in
|
||||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-os400*)
|
||||
os=-os400
|
||||
;;
|
||||
-wince*)
|
||||
os=-wince
|
||||
;;
|
||||
@@ -1120,14 +1227,23 @@ case $os in
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-atheos*)
|
||||
os=-atheos
|
||||
;;
|
||||
-syllable*)
|
||||
os=-syllable
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-nova*)
|
||||
os=-rtmk-nova
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
os=-nextstep2
|
||||
;;
|
||||
-nsk*)
|
||||
os=-nsk
|
||||
@@ -1139,6 +1255,9 @@ case $os in
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-tpf*)
|
||||
os=-tpf
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
@@ -1166,8 +1285,14 @@ case $os in
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
@@ -1200,10 +1325,14 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
;;
|
||||
pdp11-*)
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
@@ -1230,6 +1359,9 @@ case $basic_machine in
|
||||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
@@ -1293,19 +1425,19 @@ case $basic_machine in
|
||||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
@@ -1374,10 +1506,16 @@ case $basic_machine in
|
||||
-mvs* | -opened*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-os400*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxsim* | -vxworks*)
|
||||
-tpf*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-vxsim* | -vxworks* | -windiss*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
|
||||
@@ -24,6 +24,14 @@ while ($_ = shift @ARGV) {
|
||||
$srcdir =~ s/\./\\\./g;
|
||||
} elsif (/^--top_srcdir=([^ \t\n]*)/) {
|
||||
$top_srcdir = $1;
|
||||
|
||||
# Trim off the path name if we're interested in the previous path.
|
||||
if ($top_srcdir =~ /\/fortran\/\.\.$/) {
|
||||
$top_srcdir =~ s/\/fortran\/\.\.$//;
|
||||
} elsif ($top_srcdir =~ /\/c\+\+\/\.\.$/) {
|
||||
$top_srcdir =~ s/\/c\+\+\/\.\.$//;
|
||||
}
|
||||
|
||||
$top_srcdir =~ s/\./\\\./g;
|
||||
} elsif (/^--top_builddir=([^ \t\n]*)/) {
|
||||
$top_builddir = $1;
|
||||
@@ -46,4 +54,7 @@ while (<DEPEND>) {
|
||||
print NEW $_;
|
||||
}
|
||||
|
||||
close(DEPEND);
|
||||
close(NEW);
|
||||
|
||||
`mv $new_depend_file $depend_file`;
|
||||
|
||||
82
bin/release
82
bin/release
@@ -39,12 +39,67 @@
|
||||
# Moved the MANIFEST checking to a separate command file so that
|
||||
# it can be invoked individually.
|
||||
|
||||
# Function definitions
|
||||
#
|
||||
# Print Usage page
|
||||
USAGE()
|
||||
{
|
||||
cat << EOF
|
||||
Usage: $0 [--nocheck] [-d <dir>] [-h] <methods> ...
|
||||
-d DIR The name of the directory where the releas(es) should be
|
||||
placed. By default, the directory is ./releases
|
||||
|
||||
--nocheck Ignore errors in MANIFEST file.
|
||||
|
||||
--private Make a private release with today's date in version information.
|
||||
|
||||
The other command-line options are the names of the programs to use
|
||||
for compressing the resulting tar archive (if none are given then
|
||||
"tar" is assumed):
|
||||
|
||||
tar -- use tar and don't do any compressing.
|
||||
compress -- use compress and append ".Z" to the output name.
|
||||
gzip -- use gzip with "-9" and append ".gz" to the output name.
|
||||
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
|
||||
|
||||
Examples:
|
||||
|
||||
$ release
|
||||
releases/hdf5-1.0.38.tar
|
||||
|
||||
$ release gzip
|
||||
releases/hdf5-1.0.38.tar.gz
|
||||
|
||||
$ release -d /tmp tar compress gzip bzip2
|
||||
/tmp/hdf5-1.0.38.tar
|
||||
/tmp/hdf5-1.0.38.tar.Z
|
||||
/tmp/hdf5-1.0.38.tar.gz
|
||||
/tmp/hdf5-1.0.38.tar.bz2
|
||||
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
# Defaults
|
||||
DEST=releases
|
||||
VERS=`perl bin/h5vers`
|
||||
VERS_OLD=
|
||||
test "$VERS" || exit 1
|
||||
verbose=yes
|
||||
check=yes
|
||||
today=`date +%Y%m%d`
|
||||
pmode='no'
|
||||
|
||||
# Restore previous Version information
|
||||
RESTORE_VERSION()
|
||||
{
|
||||
if [ X-${VERS_OLD} != X- ]; then
|
||||
echo restoring version information back to $VERS_OLD
|
||||
bin/h5vers -s $VERS_OLD
|
||||
VERS_OLD=
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Command-line arguments
|
||||
while [ -n "$1" ]; do
|
||||
@@ -58,8 +113,16 @@ while [ -n "$1" ]; do
|
||||
--nocheck)
|
||||
check=no
|
||||
;;
|
||||
-h)
|
||||
USAGE
|
||||
exit 0
|
||||
;;
|
||||
--private)
|
||||
pmode=yes
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown switch: $arg" 1>&2
|
||||
USAGE
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
@@ -73,6 +136,17 @@ if [ "X$methods" = "X" ]; then
|
||||
methods=tar
|
||||
fi
|
||||
|
||||
# setup restoration in case of abort.
|
||||
trap RESTORE_VERSION 0
|
||||
|
||||
if [ X$pmode = Xyes ]; then
|
||||
VERS_OLD=$VERS
|
||||
# Set version information to m.n.r-of$today.
|
||||
# (h5vers does not correctly handle just m.n.r-$today.)
|
||||
VERS=`echo $VERS | sed -e s/-.*//`-of$today
|
||||
echo Private release of $VERS
|
||||
bin/h5vers -s $VERS
|
||||
fi
|
||||
|
||||
test "$verbose" && echo "Releasing hdf5-$VERS to $DEST" 1>&2
|
||||
if [ ! -d $DEST ]; then
|
||||
@@ -80,6 +154,7 @@ if [ ! -d $DEST ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Check the validity of the MANIFEST file.
|
||||
bin/chkmanifest || fail=yes
|
||||
if [ "X$fail" = "Xyes" ]; then
|
||||
@@ -145,4 +220,11 @@ test -f ../Makefile.x && mv ../Makefile.x Makefile
|
||||
rm -f $MANIFEST
|
||||
rm -f ../hdf5-$VERS
|
||||
rm -f ../x.tar
|
||||
|
||||
# Restore OLD version information, then no need for trap.
|
||||
if [ X$pmode = Xyes ]; then
|
||||
RESTORE_VERSION
|
||||
trap 0
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
150
bin/runtest
150
bin/runtest
@@ -33,6 +33,7 @@
|
||||
DEBUGMODE=""
|
||||
test -n "$DEBUGMODE" && echo "******** DEBUGMODE is $DEBUGMODE ************"
|
||||
WHEREAMI='pwd'
|
||||
CMD=
|
||||
|
||||
# the name of this program
|
||||
PROGNAME="bin/runtest $DEBUGMODE"
|
||||
@@ -112,7 +113,7 @@ REPORT_RESULT()
|
||||
{
|
||||
if [ $retcode -eq 0 ]; then
|
||||
if [ $skiptest = yes ]; then
|
||||
PRINT "SKIPPED ${HOSTNAME}: $TEST_TYPE" | tee -a $PASSEDLOG
|
||||
PRINT "SKIPPED ${HOSTNAME}: $TEST_TYPE" | tee -a $SKIPPEDLOG
|
||||
else
|
||||
PRINT "PASSED ${HOSTNAME}: $TEST_TYPE" | tee -a $PASSEDLOG
|
||||
fi
|
||||
@@ -153,13 +154,17 @@ PRINT_TRAILER()
|
||||
CHECK_RSH()
|
||||
{
|
||||
# Figure out how to use ping command in this host.
|
||||
# Some hosts use "ping host count", some use "ping -c count host"
|
||||
# Test "ping -c ..." style first because some '-c' machines treat
|
||||
# the command 'ping localhost 3' means to ping host '3'.
|
||||
# Some hosts use "ping host count", some use "ping -c count host".
|
||||
# Test "ping -c 3 -w 5" since it has timeout feature.
|
||||
# Test "ping -c ..." style before "ping host 3" because some machines
|
||||
# that recognize -c treat 'ping localhost 3' as to ping host '3'.
|
||||
if [ -z "$PING" ]; then
|
||||
if ping -c 3 -w 5 localhost >/dev/null 2>&1; then
|
||||
PING='ping -c 3 -w 5'
|
||||
PINGCOUNT=
|
||||
elif ping -c 3 localhost >/dev/null 2>&1; then
|
||||
PING='ping -c 3'
|
||||
PINGCOUNT=
|
||||
elif ping localhost 3 >/dev/null 2>&1; then
|
||||
PING=ping
|
||||
PINGCOUNT=3
|
||||
@@ -257,7 +262,7 @@ WAITTILL()
|
||||
RUNSNAPTEST()
|
||||
{
|
||||
SNAPCMD_OPT="$STANDARD_OPT" # snapshot test option
|
||||
SRCDIRNAME=""
|
||||
SRCDIRNAME=${HOSTNAME}
|
||||
# restore CC, PATH in case they were changed in the last test.
|
||||
CC="$CC_SAVED"
|
||||
PATH=$PATH_SAVED
|
||||
@@ -293,35 +298,44 @@ RUNSNAPTEST()
|
||||
SNAPCMD_OPT="$SNAPCMD_OPT $1 $2"
|
||||
shift
|
||||
;;
|
||||
op-snapshot)
|
||||
# option for snapshot
|
||||
shift
|
||||
SNAPCMD_OPT="$SNAPCMD_OPT $1"
|
||||
;;
|
||||
setenv)
|
||||
# set environment variable
|
||||
# pass them along to snapshot set environment variable
|
||||
shift
|
||||
eval $1="$2"
|
||||
export $1
|
||||
SNAPCMD_OPT="$SNAPCMD_OPT setenv $1 $2"
|
||||
shift
|
||||
;;
|
||||
setenv2)
|
||||
# set environment variable with 2 values
|
||||
# a kludge now--the extra single quotes are needed
|
||||
# else eval complains.
|
||||
setenvN)
|
||||
# set environment variable with $1 values
|
||||
# e.g., setenvN 3 x a b c is same as setenv x="a b c".
|
||||
# pass them along to snapshot set environment variable
|
||||
shift
|
||||
eval $1="'$2 $3'"
|
||||
export $1
|
||||
shift; shift
|
||||
;;
|
||||
setenv3)
|
||||
# set environment variable with 3 values
|
||||
# a kludge now--the extra single quotes are needed
|
||||
# else eval complains.
|
||||
envN=$1
|
||||
shift
|
||||
eval $1="'$2 $3 $4'"
|
||||
export $1
|
||||
shift; shift; shift
|
||||
envname=$1
|
||||
SNAPCMD_OPT="$SNAPCMD_OPT setenvN $envN $envname"
|
||||
envalue=
|
||||
while test $envN -gt 0; do
|
||||
shift
|
||||
envalue="$envalue $1"
|
||||
envN=`expr $envN - 1`
|
||||
done
|
||||
SNAPCMD_OPT="$SNAPCMD_OPT $envalue"
|
||||
;;
|
||||
skip)
|
||||
# skip this test
|
||||
skiptest=yes
|
||||
;;
|
||||
srcdirname)
|
||||
# Use this before using parallel and -n32 since this overrides
|
||||
# the others.
|
||||
shift
|
||||
SRCDIRNAME=$1
|
||||
;;
|
||||
*) # unknown test
|
||||
PRINT "$0: unknown type of test ($1)"
|
||||
retcode=1
|
||||
@@ -353,7 +367,7 @@ RUNSNAPTEST()
|
||||
|
||||
# Setup log file name to save test output
|
||||
THIS_MINUTE=`date +%H%M`
|
||||
LOGFILE=${LOGBASENAME}${SRCDIRNAME}_${TODAY}_${THIS_MINUTE}
|
||||
LOGFILE=${LOGBASENAME}/${SRCDIRNAME}_${TODAY}_${THIS_MINUTE}
|
||||
PRINT "Running snapshot with output saved in"
|
||||
PRINT " $LOGFILE"
|
||||
(date; PRINT Hostname=$HOSTNAME) >> $LOGFILE
|
||||
@@ -390,9 +404,16 @@ RUNSNAPTEST()
|
||||
# -n32 -n32 mode. Apply to 64/32 bit OS such as IRIX64.
|
||||
# parallel parallel mode.
|
||||
# op-configure <option> configure option
|
||||
# op-snapshot <option> snapshot option
|
||||
# --* configure option
|
||||
# setenv <name> <value> set environment variable <name> to <value>
|
||||
# Pass along to snapshot
|
||||
# setenvN <N> <name> <value> ...
|
||||
# set environment variable with <N> values
|
||||
# e.g., setenvN 3 x a b c is same as setenv x="a b c".
|
||||
# Pass along to snapshot.
|
||||
# skip skip this test
|
||||
# srcdirname <name> use <name> as the build-directory.
|
||||
SNAPTEST_CONFIG_PARSE()
|
||||
{
|
||||
while read x y ; do
|
||||
@@ -461,6 +482,8 @@ Usage: runtest [-h] [-debug] [-r<version>] [-all] [-nocvs] [-nodiff] [<host> ...
|
||||
do not do cvs commands
|
||||
-nodiff
|
||||
do not do diff commands
|
||||
-setup
|
||||
setup the directory structure for snapshot test
|
||||
-configname <name>
|
||||
use <name> as hostname in the parsing of the snaptest configure file
|
||||
<host>
|
||||
@@ -473,6 +496,21 @@ EOF
|
||||
}
|
||||
|
||||
|
||||
# Verify if directory ($1) exists. If not, create it.
|
||||
CHECK_DIR()
|
||||
{
|
||||
dir=$1
|
||||
if test ! -e $1; then
|
||||
echo mkdir $1
|
||||
mkdir $1
|
||||
errcode=$?
|
||||
elif test ! -d $1; then
|
||||
echo $1 is not a directory
|
||||
errcode=1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#################################
|
||||
# Main
|
||||
#################################
|
||||
@@ -511,18 +549,22 @@ while [ $# -gt 0 ]; do
|
||||
TESTHOST=-all
|
||||
;;
|
||||
-nocvs)
|
||||
# do not do cvs commands
|
||||
# do not do cvs commands.
|
||||
NOCVS=nocvs
|
||||
;;
|
||||
-nodiff)
|
||||
# do not do diff commands
|
||||
# do not do diff commands.
|
||||
NODIFF=nodiff
|
||||
;;
|
||||
-configname)
|
||||
# use <name> as hostname in the parsing of the snaptest configure file
|
||||
# use <name> as hostname in the parsing of the snaptest configure file.
|
||||
shift
|
||||
CONFIGNAME=$1
|
||||
;;
|
||||
-setup)
|
||||
# setup the directory structure for snapshot test.
|
||||
CMD=setup
|
||||
;;
|
||||
-*) # Unknow option
|
||||
PRINT "Unknown option ($1)"
|
||||
USAGE
|
||||
@@ -553,24 +595,56 @@ fi
|
||||
#################################
|
||||
# Setup snapshot test directories
|
||||
#################################
|
||||
BASEDIR=${HOME}/snapshots-${H5VERSION}
|
||||
# initial processing of setup option if requested
|
||||
if test x-$CMD = x-setup; then
|
||||
CHECK_DIR $BASEDIR
|
||||
test $errcode -ne 0 && exit 1
|
||||
elif [ ! -d ${BASEDIR} ]; then
|
||||
echo "BASEDIR ($BASEDIR) does not exist"
|
||||
exit 1
|
||||
fi
|
||||
# Show the real physical path rather than the symbolic path
|
||||
SNAPYARD=`cd $HOME/snapshots-${H5VERSION} && /bin/pwd`
|
||||
SNAPYARD=`cd $BASEDIR && /bin/pwd`
|
||||
# Log file basename
|
||||
LOGBASENAME=${SNAPYARD}/log/${HOSTNAME}
|
||||
PASSEDLOG=${SNAPYARD}/log/PASSED_LOG_${TODAY}
|
||||
FAILEDLOG=${SNAPYARD}/log/FAILED_LOG_${TODAY}
|
||||
TIMELOG=${SNAPYARD}/log/TIME_LOG_${TODAY}
|
||||
CVSLOG=${SNAPYARD}/log/CVS_LOG_${TODAY}
|
||||
CVSLOG_LOCK=${SNAPYARD}/log/CVS_LOG_LOCK_${TODAY}
|
||||
DIFFLOG=${SNAPYARD}/log/DIFF_LOG_${TODAY}
|
||||
# Snap Test Configuration file
|
||||
LOGDIR=${SNAPYARD}/log
|
||||
LOGBASENAME=${LOGDIR}
|
||||
PASSEDLOG=${LOGDIR}/PASSED_LOG_${TODAY}
|
||||
FAILEDLOG=${LOGDIR}/FAILED_LOG_${TODAY}
|
||||
SKIPPEDLOG=${LOGDIR}/SKIPPED_LOG_${TODAY}
|
||||
TIMELOG=${LOGDIR}/TIME_LOG_${TODAY}
|
||||
CVSLOG=${LOGDIR}/CVS_LOG_${TODAY}
|
||||
CVSLOG_LOCK=${LOGDIR}/CVS_LOG_LOCK_${TODAY}
|
||||
DIFFLOG=${LOGDIR}/DIFF_LOG_${TODAY}
|
||||
# Snap Test hosts and Configuration files
|
||||
ALLHOSTSFILE=${SNAPYARD}/allhostfile
|
||||
SNAPTESTCFG=${SNAPYARD}/snaptest.cfg
|
||||
|
||||
# more processing of setup option if requested
|
||||
if test x-$CMD = x-setup; then
|
||||
CHECK_DIR $LOGDIR
|
||||
test $errcode -ne 0 && exit 1
|
||||
CHECK_DIR $LOGDIR/OLD
|
||||
test $errcode -ne 0 && exit 1
|
||||
CHECK_DIR $SNAPYARD/TestDir
|
||||
test $errcode -ne 0 && exit 1
|
||||
# create empty test hosts or configure files if non-existing
|
||||
for f in $ALLHOSTSFILE $SNAPTESTCFG; do
|
||||
if test ! -f $f; then
|
||||
echo Creating $f
|
||||
touch $f
|
||||
fi
|
||||
done
|
||||
# create or update the current source.
|
||||
echo update current source
|
||||
$SNAPSHOT checkout
|
||||
# setup completed. Exit.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#################################
|
||||
# Setup test host(s)
|
||||
#################################
|
||||
ALLHOSTSFILE=${SNAPYARD}/allhostfile
|
||||
if [ "$TESTHOST" = -all ]; then
|
||||
if [ -f $ALLHOSTSFILE ]; then
|
||||
TESTHOST=`sed -e s/#.*// $ALLHOSTSFILE`
|
||||
@@ -654,7 +728,7 @@ if [ -z "$NODIFF" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# we can use the version of script in SNAPYARD/current now
|
||||
# we can use the version of script in SNAPYARD/current now.
|
||||
# Don't do the diff any more.
|
||||
PROGNAME="$SNAPYARD/current/$PROGNAME -nodiff"
|
||||
|
||||
|
||||
42
bin/snapshot
42
bin/snapshot
@@ -86,6 +86,31 @@ while [ $# -gt 0 ] ; do
|
||||
cmdtest="test"
|
||||
cmd=""
|
||||
;;
|
||||
setenv)
|
||||
# set environment variable
|
||||
shift
|
||||
eval $1="$2"
|
||||
export $1
|
||||
shift
|
||||
;;
|
||||
setenvN)
|
||||
# set environment variable with $1 values
|
||||
# e.g., setenvN 3 x a b c is same as setenv x="a b c".
|
||||
# a kludge now--the extra single quotes are needed
|
||||
# else eval complains.
|
||||
shift
|
||||
envN=$1
|
||||
shift
|
||||
envname=$1
|
||||
envalue=
|
||||
while test $envN -gt 0; do
|
||||
shift
|
||||
envalue="$envalue $1"
|
||||
envN=`expr $envN - 1`
|
||||
done
|
||||
eval $envname="'$envalue'"
|
||||
export $envname
|
||||
;;
|
||||
srcdir)
|
||||
#use srcdir option for test
|
||||
srcdir="yes"
|
||||
@@ -174,6 +199,11 @@ Usage: $PROGNAME [all] [checkout] [diff] [test] [srcdir] [release] [help]
|
||||
release: Run release
|
||||
clean: Run make clean
|
||||
distclean:Run make distclean
|
||||
setenv <name> <value>:
|
||||
Set environment variable <name> to <value>.
|
||||
setenvN <N> <name> <value> ...:
|
||||
Set environment variable with <N> values.
|
||||
E.g., setenvN 3 x a b c is same as setenv x="a b c".
|
||||
srcdir: Use srcdir option (does not imply other commands)
|
||||
"snapshot srcdir" is equivalent to "snapshot srcdir all"
|
||||
"snapshot srcdir checkout" is equivalent to "snapshot checkout"
|
||||
@@ -217,6 +247,11 @@ else
|
||||
fi
|
||||
|
||||
BASEDIR=${HOME}/snapshots-${H5VERSION}
|
||||
if [ ! -d ${BASEDIR} ]; then
|
||||
echo "BASEDIR ($BASEDIR) does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CURRENT=${BASEDIR}/current
|
||||
PREVIOUS=${BASEDIR}/previous
|
||||
HOSTNAME=`hostname | cut -f1 -d.` # no domain part
|
||||
@@ -238,11 +273,6 @@ done
|
||||
#=============================
|
||||
if [ "$cmd" = "all" -o -n "$cmdcheckout" ]; then
|
||||
TIMESTAMP "checkout"
|
||||
# Create a working directory. Hopefully one is left over from last
|
||||
# time that still has the contents of the previous release. But if
|
||||
# not, just create one and assume that a snapshot is necessary.
|
||||
test -d ${BASEDIR} || mkdir -p ${BASEDIR} || exit 1
|
||||
|
||||
# If there is a Makefile in ${CURRENT}, the last test done in it
|
||||
# has not been distclean'ed. They would interfere with other
|
||||
# --srcdir build since make considers the files in ${CURRENT}
|
||||
@@ -259,7 +289,7 @@ if [ "$cmd" = "all" -o -n "$cmdcheckout" ]; then
|
||||
exit 1
|
||||
fi
|
||||
# Check out the current version from CVS
|
||||
cvs -Q co -d ${CURRENT} ${CVSVERSION} hdf5 || exit 1
|
||||
(cd $BASEDIR; cvs -Q co -P -d current ${CVSVERSION} hdf5 ) || exit 1
|
||||
fi # Do CVS checkout
|
||||
|
||||
|
||||
|
||||
@@ -3,4 +3,6 @@
|
||||
# latest revision of that branch. If set to "hdf5", it uses the main
|
||||
# version.
|
||||
# H5VER tells runtest which version to run
|
||||
H5VERSION=hdf5
|
||||
H5VERSION=hdf5_1_6
|
||||
H5VER="-r1.6"
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ $Source = "";
|
||||
#
|
||||
%TypeString = ("haddr_t" => "a",
|
||||
"hbool_t" => "b",
|
||||
"htri_t" => "b",
|
||||
"double" => "d",
|
||||
"H5D_alloc_time_t" => "Da",
|
||||
"H5D_fill_time_t" => "Df",
|
||||
@@ -53,6 +52,7 @@ $Source = "";
|
||||
"H5S_class_t" => "Sc",
|
||||
"H5S_seloper_t" => "Ss",
|
||||
"H5S_sel_type" => "St",
|
||||
"htri_t" => "t",
|
||||
"H5T_cset_t", => "Tc",
|
||||
"H5T_direction_t", => "Td",
|
||||
"H5T_norm_t" => "Tn",
|
||||
@@ -63,6 +63,7 @@ $Source = "";
|
||||
"H5T_class_t" => "Tt",
|
||||
"H5T_str_t" => "Tz",
|
||||
"void*" => "x",
|
||||
"void**" => "x",
|
||||
"FILE*" => "x",
|
||||
"H5A_operator_t" => "x",
|
||||
"H5D_operator_t" => "x",
|
||||
|
||||
29
c++/config/dec-osf5.x
Executable file
29
c++/config/dec-osf5.x
Executable file
@@ -0,0 +1,29 @@
|
||||
|
||||
if test -z "$CXX"; then
|
||||
CXX=cxx
|
||||
CXX_BASENAME=cxx
|
||||
fi
|
||||
|
||||
|
||||
case $CXX_BASENAME in
|
||||
g++)
|
||||
CXXFLAGS="$CXXFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CXXFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CXXFLAGS="-O3 -fomit-frame-pointer"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CXXFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
CXXFLAGS="$CXXFLAGS -tlocal -D__USE_STD_IOSTREAM "
|
||||
DEBUG_CXXFLAGS="-g"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CXXFLAGS="-O"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CXXFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
||||
|
||||
20
c++/config/freebsd
Normal file
20
c++/config/freebsd
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# Special setup to use pthread support if enable-threadsafe is on.
|
||||
# Works with static executable only.
|
||||
if test "X-" != "X-$enable_threadsafe"; then
|
||||
CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
# enable_static_exec=yes
|
||||
fi
|
||||
@@ -11,14 +11,24 @@ if test -z "$CXX"; then
|
||||
CXX_BASENAME=aCC
|
||||
fi
|
||||
|
||||
if test -z "$cxx_flags_set"; then
|
||||
# +Z for PIC, +A for using archived libraries
|
||||
CXXFLAGS="+Z +A"
|
||||
CFLAGS="-g +O2"
|
||||
case "$CXX" in
|
||||
aCC)
|
||||
# +Z for PIC, +A for using archived libraries
|
||||
CXXFLAGS="$CXXFLAGS +Z +A"
|
||||
CFLAGS="$CFLAGS -g +O2"
|
||||
DEBUG_CXXFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CXXFLAGS="-O -s"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CPPFLAGS=
|
||||
cxx_flags_set=yes
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
CXXFLAGS="$CXXFLAGS"
|
||||
CFLAGS="$CFLAGS"
|
||||
DEBUG_CXXFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CXXFLAGS=
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
||||
|
||||
30
c++/config/ia64-linux-gnu
Executable file
30
c++/config/ia64-linux-gnu
Executable file
@@ -0,0 +1,30 @@
|
||||
|
||||
if test -z "$CXX"; then
|
||||
CXX=ecc
|
||||
CXX_BASENAME=ecc
|
||||
fi
|
||||
|
||||
|
||||
case $CXX_BASENAME in
|
||||
g++)
|
||||
CXXFLAGS="$CXXFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CXXFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CXXFLAGS="-O3 -fomit-frame-pointer"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CXXFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
# Default to C99 standard.
|
||||
CXXFLAGS="${CXXFLAGS:--std=c99}"
|
||||
DEBUG_CXXFLAGS="-g -w2 -Wall"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CXXFLAGS="" #Default optimization O2 is used
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CXXFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -16,7 +16,7 @@ fi
|
||||
if test -z "$cxx_flags_set"; then
|
||||
# -LANG:std required for std use; -ptused causes templates used to be
|
||||
# instantiated
|
||||
CPPFLAGS="-LANG:std -ptused"
|
||||
CPPFLAGS="$CPPFLAGS -LANG:std -ptused"
|
||||
|
||||
# libCio is a default library, since libtool before 1.5 doesn't fully
|
||||
# support C++ yet, default libraries must be explicitly specified.
|
||||
|
||||
@@ -25,14 +25,14 @@ cxx_vers_patch=`echo $cxx_version | cut -f3 -d.`
|
||||
# Specify the "-features=tmplife" if the compiler can handle this...
|
||||
if test -n "$cxx_version"; then
|
||||
if test $cxx_vers_major -ge 5 -a $cxx_vers_minor -ge 3 -o $cxx_vers_major -gt 5; then
|
||||
CXXFLAGS="-features=tmplife"
|
||||
CXXFLAGS="$CXXFLAGS -features=tmplife"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Try solaris native compiler flags
|
||||
if test -z "$cxx_flags_set"; then
|
||||
CXXFLAGS="$CXXFLAGS -instances=global"
|
||||
CPPFLAGS="-LANG:std"
|
||||
CPPFLAGS="$CPPFLAGS -LANG:std"
|
||||
LIBS="$LIBS -lsocket"
|
||||
DEBUG_CXXFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
84
c++/configure
vendored
84
c++/configure
vendored
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# From configure.in Id: configure.in.
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.53 for HDF5 C++ 1.6.0-pre1.
|
||||
# Generated by GNU Autoconf 2.53 for HDF5 C++ 1.6.3.
|
||||
#
|
||||
# Report bugs to <hdfhelp@ncsa.uiuc.edu>.
|
||||
#
|
||||
@@ -416,8 +416,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='HDF5 C++'
|
||||
PACKAGE_TARNAME='hdf5-c--'
|
||||
PACKAGE_VERSION='1.6.0-pre1'
|
||||
PACKAGE_STRING='HDF5 C++ 1.6.0-pre1'
|
||||
PACKAGE_VERSION='1.6.3'
|
||||
PACKAGE_STRING='HDF5 C++ 1.6.3'
|
||||
PACKAGE_BUGREPORT='hdfhelp@ncsa.uiuc.edu'
|
||||
|
||||
ac_unique_file="src/H5Library.cpp"
|
||||
@@ -934,7 +934,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures HDF5 C++ 1.6.0-pre1 to adapt to many kinds of systems.
|
||||
\`configure' configures HDF5 C++ 1.6.3 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -995,7 +995,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of HDF5 C++ 1.6.0-pre1:";;
|
||||
short | recursive ) echo "Configuration of HDF5 C++ 1.6.3:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1101,7 +1101,7 @@ fi
|
||||
test -n "$ac_init_help" && exit 0
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
HDF5 C++ configure 1.6.0-pre1
|
||||
HDF5 C++ configure 1.6.3
|
||||
generated by GNU Autoconf 2.53
|
||||
|
||||
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
|
||||
@@ -1116,7 +1116,7 @@ cat >&5 <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by HDF5 C++ $as_me 1.6.0-pre1, which was
|
||||
It was created by HDF5 C++ $as_me 1.6.3, which was
|
||||
generated by GNU Autoconf 2.53. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -10017,7 +10017,7 @@ _ASBOX
|
||||
} >&5
|
||||
cat >&5 <<_CSEOF
|
||||
|
||||
This file was extended by HDF5 C++ $as_me 1.6.0-pre1, which was
|
||||
This file was extended by HDF5 C++ $as_me 1.6.3, which was
|
||||
generated by GNU Autoconf 2.53. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -10071,7 +10071,7 @@ _ACEOF
|
||||
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
HDF5 C++ config.status 1.6.0-pre1
|
||||
HDF5 C++ config.status 1.6.3
|
||||
configured by $0, generated by GNU Autoconf 2.53,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
@@ -10527,3 +10527,69 @@ no_create=$saved_no_create
|
||||
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
|
||||
|
||||
chmod 755 src/h5c++
|
||||
|
||||
if test -z "$ECHO_N" -o -z "$ECHO_C"; then
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
||||
ECHO_N=''
|
||||
ECHO_C='
|
||||
'
|
||||
else
|
||||
ECHO_N=-n
|
||||
ECHO_C=''
|
||||
fi
|
||||
else
|
||||
ECHO_N=''
|
||||
ECHO_C='\c'
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT_PLAIN() {
|
||||
echo $ECHO_N "$1$ECHO_C"
|
||||
echo $ECHO_N "$1$ECHO_C" 1>>src/libhdf5.settings
|
||||
}
|
||||
|
||||
PRINT_N() {
|
||||
echo $ECHO_N "$1: $ECHO_C"
|
||||
echo $ECHO_N "$1: $ECHO_C" 1>>src/libhdf5.settings
|
||||
}
|
||||
|
||||
PRINT() {
|
||||
echo "$1"
|
||||
echo "$1" 1>>src/libhdf5.settings
|
||||
}
|
||||
|
||||
IF_YES_NO() {
|
||||
if test $# -lt 1; then
|
||||
PRINT "No"
|
||||
return
|
||||
else
|
||||
while test $# -gt 0; do
|
||||
if test "$1" != "yes"; then
|
||||
PRINT "No"
|
||||
return
|
||||
fi
|
||||
shift
|
||||
done
|
||||
fi
|
||||
PRINT "Yes"
|
||||
}
|
||||
|
||||
IF_ENABLED_DISABLED() {
|
||||
if test "$1" = "yes"; then
|
||||
PRINT "Enabled"
|
||||
else
|
||||
PRINT "Disabled"
|
||||
fi
|
||||
}
|
||||
|
||||
PRINT "C++ Configure Summary"
|
||||
PRINT "Compiling Options:"
|
||||
|
||||
PRINT_N " C++ Compiler"
|
||||
PRINT "$CXX"
|
||||
|
||||
PRINT_N " CXXFLAGS"
|
||||
PRINT "$CXXFLAGS"
|
||||
|
||||
PRINT "Features:"
|
||||
|
||||
@@ -27,7 +27,7 @@ dnl
|
||||
dnl NOTE: Don't forget to change the version number here when we do a
|
||||
dnl release!!!
|
||||
dnl
|
||||
AC_INIT([HDF5 C++], [1.6.0-pre1], [hdfhelp@ncsa.uiuc.edu])
|
||||
AC_INIT([HDF5 C++], [1.6.3], [hdfhelp@ncsa.uiuc.edu])
|
||||
AC_CONFIG_SRCDIR([src/H5Library.cpp])
|
||||
AC_CONFIG_AUX_DIR([../bin])
|
||||
|
||||
@@ -810,3 +810,75 @@ dnl Finally the makefiles
|
||||
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
|
||||
|
||||
chmod 755 src/h5c++
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Print out a summary of what we are going to build.
|
||||
dnl
|
||||
if test -z "$ECHO_N" -o -z "$ECHO_C"; then
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
||||
ECHO_N=''
|
||||
ECHO_C='
|
||||
'
|
||||
else
|
||||
ECHO_N=-n
|
||||
ECHO_C=''
|
||||
fi
|
||||
else
|
||||
ECHO_N=''
|
||||
ECHO_C='\c'
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT_PLAIN() {
|
||||
echo $ECHO_N "$1$ECHO_C"
|
||||
echo $ECHO_N "$1$ECHO_C" 1>>src/libhdf5.settings
|
||||
}
|
||||
|
||||
PRINT_N() {
|
||||
echo $ECHO_N "$1: $ECHO_C"
|
||||
echo $ECHO_N "$1: $ECHO_C" 1>>src/libhdf5.settings
|
||||
}
|
||||
|
||||
PRINT() {
|
||||
echo "$1"
|
||||
echo "$1" 1>>src/libhdf5.settings
|
||||
}
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Print "Yes" if all arguments are "yes", otherwise "No"
|
||||
dnl
|
||||
IF_YES_NO() {
|
||||
if test $# -lt 1; then
|
||||
PRINT "No"
|
||||
return
|
||||
else
|
||||
while test $# -gt 0; do
|
||||
if test "$1" != "yes"; then
|
||||
PRINT "No"
|
||||
return
|
||||
fi
|
||||
shift
|
||||
done
|
||||
fi
|
||||
PRINT "Yes"
|
||||
}
|
||||
|
||||
IF_ENABLED_DISABLED() {
|
||||
if test "$1" = "yes"; then
|
||||
PRINT "Enabled"
|
||||
else
|
||||
PRINT "Disabled"
|
||||
fi
|
||||
}
|
||||
|
||||
PRINT "C++ Configure Summary"
|
||||
PRINT "Compiling Options:"
|
||||
|
||||
PRINT_N " C++ Compiler"
|
||||
PRINT "$CXX"
|
||||
|
||||
PRINT_N " CXXFLAGS"
|
||||
PRINT "$CXXFLAGS"
|
||||
|
||||
PRINT "Features:"
|
||||
|
||||
@@ -32,12 +32,11 @@ hdf5_builddir=$(top_builddir)/src
|
||||
## List all source files here. The list of object files will be
|
||||
## created by replacing the `.cpp' with a `.lo'. This list is necessary
|
||||
## for building automatic dependencies.
|
||||
TEST_SRC=compound.cpp h5group.cpp create.cpp readdata.cpp chunks.cpp \
|
||||
extend_ds.cpp writedata.cpp
|
||||
TEST_SRC=create.cpp readdata.cpp writedata.cpp compound.cpp extend_ds.cpp \
|
||||
chunks.cpp h5group.cpp
|
||||
TEST_OBJ=$(TEST_SRC:.cpp=.lo)
|
||||
|
||||
H5_FILES=Attributes.h5 SDScompound.h5 Select.h5 SDSextendible.h5 Group.h5 SDS.h5
|
||||
EXAMPLE_PROGS=$(TEST_SRC) $(H5_FILES)
|
||||
EXAMPLE_PROGS=$(TEST_SRC)
|
||||
|
||||
## These are the programs that `make all' or `make tests' will build and which
|
||||
## `make check' will run. List them in the order they should be run.
|
||||
@@ -47,7 +46,7 @@ TEST_PROGS=$(TEST_SRC:.cpp=)
|
||||
|
||||
## These are the files that `make clean' (and derivatives) will remove from
|
||||
## this directory.
|
||||
CLEAN=
|
||||
CLEAN=*.h5
|
||||
|
||||
## How to build the programs... they all depend on the Fortran & C hdf5 libraries
|
||||
$(TEST_PROGS): $(LIB) $(LIBHDF5)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -71,6 +71,12 @@ int main (void)
|
||||
hsize_t chunk_dims[2] ={2, 5};
|
||||
cparms.setChunk( RANK, chunk_dims );
|
||||
|
||||
/*
|
||||
* Set fill value for the dataset
|
||||
*/
|
||||
int fill_val = 0;
|
||||
cparms.setFillValue( PredType::NATIVE_INT, &fill_val);
|
||||
|
||||
/*
|
||||
* Create a new dataset within the file using cparms
|
||||
* creation properties.
|
||||
|
||||
@@ -21,29 +21,49 @@
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5Alltypes.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs default constructor
|
||||
///\brief Default constructor
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AbstractDs::AbstractDs() : H5Object() {}
|
||||
|
||||
// Constructor that takes an id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs default constructor
|
||||
///\brief Creates an AbstractDs instance using an existing id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AbstractDs::AbstractDs( const hid_t ds_id ) : H5Object( ds_id ) {}
|
||||
|
||||
// Copy constructor: makes copy of the original object; simply invokes
|
||||
// base-class copy constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original AbstractDs object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {}
|
||||
|
||||
// Returns the class of the datatype that is used by this dataset
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs::getTypeClass
|
||||
///\brief Returns the class of the datatype that is used by this
|
||||
/// object, which can be a dataset or an attribute.
|
||||
///\return Datatype class identifier
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_class_t AbstractDs::getTypeClass() const
|
||||
{
|
||||
// Gets the datatype used by this dataset or attribute.
|
||||
// p_getType calls either H5Dget_type or H5Aget_type depending on
|
||||
// p_get_type calls either H5Dget_type or H5Aget_type depending on
|
||||
// which object invokes getTypeClass
|
||||
DataType datatype( p_getType());
|
||||
DataType datatype(p_get_type());
|
||||
|
||||
// Gets the class of the datatype and validate it before returning
|
||||
H5T_class_t type_class = H5Tget_class( datatype.getId());
|
||||
@@ -52,97 +72,105 @@ H5T_class_t AbstractDs::getTypeClass() const
|
||||
else
|
||||
{
|
||||
throw DataTypeIException("AbstractDs::getTypeClass",
|
||||
"H5Tget_class returns something different than H5T_NO_CLASS");
|
||||
"H5Tget_class returns H5T_NO_CLASS");
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the generic datatype of this abstract dataset which
|
||||
// can be a dataset or an attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs::getDataType
|
||||
///\brief Returns the generic datatype of this abstract dataset, which
|
||||
/// can be a dataset or an attribute.
|
||||
///\return DataType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType AbstractDs::getDataType() const
|
||||
{
|
||||
// Gets the id of the datatype used by this dataset or attribute.
|
||||
// p_getType calls either H5Dget_type or H5Aget_type depending on
|
||||
// p_get_type calls either H5Dget_type or H5Aget_type depending on
|
||||
// which object invokes getTypeClass
|
||||
hid_t datatype_id = p_getType(); // returned value is already validated
|
||||
hid_t datatype_id = p_get_type(); // returned value is already validated
|
||||
|
||||
// Create and return the DataType object
|
||||
DataType datatype( datatype_id );
|
||||
return( datatype );
|
||||
}
|
||||
|
||||
// Returns the enumeration datatype of this abstract dataset which
|
||||
// can be a dataset or an attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs::getEnumType
|
||||
///\brief Returns the enumeration datatype of this abstract dataset which
|
||||
/// can be a dataset or an attribute.
|
||||
///\return EnumType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType AbstractDs::getEnumType() const
|
||||
{
|
||||
EnumType enumtype( p_getType());
|
||||
return( enumtype );
|
||||
EnumType enumtype(p_get_type());
|
||||
return(enumtype);
|
||||
}
|
||||
|
||||
// Returns the compound datatype of this abstract dataset which
|
||||
// can be a dataset or an attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs::getCompType
|
||||
///\brief Returns the compound datatype of this abstract dataset which
|
||||
/// can be a dataset or an attribute.
|
||||
///\return CompType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType AbstractDs::getCompType() const
|
||||
{
|
||||
CompType comptype( p_getType());
|
||||
return( comptype );
|
||||
CompType comptype(p_get_type());
|
||||
return(comptype);
|
||||
}
|
||||
|
||||
// Returns the integer datatype of this abstract dataset which
|
||||
// can be a dataset or an attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs::getIntType
|
||||
///\brief Returns the integer datatype of this abstract dataset which
|
||||
/// can be a dataset or an attribute.
|
||||
///\return IntType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType AbstractDs::getIntType() const
|
||||
{
|
||||
IntType inttype( p_getType());
|
||||
return( inttype );
|
||||
IntType inttype(p_get_type());
|
||||
return(inttype);
|
||||
}
|
||||
|
||||
// Returns the floating-point datatype of this abstract dataset which
|
||||
// can be a dataset or an attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs::getFloatType
|
||||
///\brief Returns the floating-point datatype of this abstract dataset,
|
||||
/// which can be a dataset or an attribute.
|
||||
///\return FloatType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType AbstractDs::getFloatType() const
|
||||
{
|
||||
FloatType floatype( p_getType());
|
||||
return( floatype );
|
||||
FloatType floatype(p_get_type());
|
||||
return(floatype);
|
||||
}
|
||||
|
||||
// Returns the string datatype of this abstract dataset which
|
||||
// can be a dataset or an attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs::getStrType
|
||||
///\brief Returns the string datatype of this abstract dataset which
|
||||
/// can be a dataset or an attribute.
|
||||
///\return StrType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType AbstractDs::getStrType() const
|
||||
{
|
||||
StrType strtype( p_getType());
|
||||
return( strtype );
|
||||
StrType strtype(p_get_type());
|
||||
return(strtype);
|
||||
}
|
||||
|
||||
/* This version of getDataType is older style. New style above doesn't
|
||||
use overloading. Remove it when knowing for sure that the other way
|
||||
is prefered
|
||||
// Gets the specific datatype of this abstract dataset which can be a
|
||||
// dataset or an attribute. Several overloaded getDataType's below
|
||||
// are for specific sub-datatypes.
|
||||
void AbstractDs::getDataType( EnumType& enumtype ) const
|
||||
{
|
||||
enumtype.setId( p_getType());
|
||||
}
|
||||
|
||||
void AbstractDs::getDataType( CompType& comptype ) const
|
||||
{
|
||||
comptype.setId( p_getType());
|
||||
}
|
||||
|
||||
void AbstractDs::getDataType( IntType& inttype ) const
|
||||
{
|
||||
inttype.setId( p_getType());
|
||||
}
|
||||
|
||||
void AbstractDs::getDataType( FloatType& floatype ) const
|
||||
{
|
||||
floatype.setId( p_getType());
|
||||
}
|
||||
|
||||
void AbstractDs::getDataType( StrType& strtype ) const
|
||||
{
|
||||
strtype.setId( p_getType());
|
||||
}
|
||||
end of old style of getDataType */
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AbstractDs destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AbstractDs::~AbstractDs() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -26,13 +26,6 @@ namespace H5 {
|
||||
#endif
|
||||
class H5_DLLCPP AbstractDs : public H5Object {
|
||||
public:
|
||||
// Gets the dataspace of this abstract dataset - pure virtual
|
||||
virtual DataSpace getSpace() const = 0;
|
||||
|
||||
// Gets the class of the datatype that is used by this abstract
|
||||
// dataset
|
||||
H5T_class_t getTypeClass() const;
|
||||
|
||||
// Gets a copy the datatype of that this abstract dataset uses.
|
||||
// Note that this datatype is a generic one and can only be accessed
|
||||
// via generic member functions, i.e., member functions belong
|
||||
@@ -47,6 +40,13 @@ class H5_DLLCPP AbstractDs : public H5Object {
|
||||
FloatType getFloatType() const;
|
||||
StrType getStrType() const;
|
||||
|
||||
// Gets the dataspace of this abstract dataset - pure virtual
|
||||
virtual DataSpace getSpace() const = 0;
|
||||
|
||||
// Gets the class of the datatype that is used by this abstract
|
||||
// dataset
|
||||
H5T_class_t getTypeClass() const;
|
||||
|
||||
// Copy constructor
|
||||
AbstractDs( const AbstractDs& original );
|
||||
|
||||
@@ -61,7 +61,7 @@ class H5_DLLCPP AbstractDs : public H5Object {
|
||||
|
||||
private:
|
||||
// This member function is implemented by DataSet and Attribute
|
||||
virtual hid_t p_getType() const = 0;
|
||||
virtual hid_t p_get_type() const = 0;
|
||||
|
||||
// This member function is implemented by DataSet and Attribute
|
||||
virtual void p_close() const = 0;
|
||||
|
||||
@@ -24,3 +24,5 @@
|
||||
#include "H5FloatType.h"
|
||||
#include "H5StrType.h"
|
||||
#include "H5CompType.h"
|
||||
#include "H5ArrayType.h"
|
||||
#include "H5VarLenType.h"
|
||||
|
||||
173
c++/src/H5ArrayType.cpp
Normal file
173
c++/src/H5ArrayType.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5RefCounter.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5ArrayType.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ArrayType default constructor
|
||||
///\brief Default constructor: Creates a stub ArrayType
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType::ArrayType() : DataType()
|
||||
{
|
||||
// Initialize members
|
||||
rank = -1;
|
||||
dimensions = NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ArrayType overloaded constructor
|
||||
///\brief Creates an ArrayType object using an existing id.
|
||||
///\param existing_id - IN: Id of an existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id )
|
||||
{
|
||||
// Get the rank of the existing array and store it in this array
|
||||
rank = H5Tget_array_ndims(existing_id);
|
||||
if (rank < 0)
|
||||
{
|
||||
throw DataTypeIException("ArrayType overloaded constructor", "H5Tget_array_ndims failed");
|
||||
}
|
||||
|
||||
// Get the dimensions of the existing array and store it in this array
|
||||
dimensions = new hsize_t[rank];
|
||||
//hsize_t rdims2[H5S_MAX_RANK];
|
||||
int ret_value = H5Tget_array_dims(id, dimensions, NULL);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ArrayType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original ArrayType object.
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType::ArrayType( const ArrayType& original ) : DataType( original )
|
||||
{
|
||||
rank = original.rank;
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = original.dimensions[i];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ArrayType overloaded constructor
|
||||
///\brief Creates a new array data type based on the specified
|
||||
/// \a base_type.
|
||||
///\param base_type - IN: Existing datatype
|
||||
///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK]
|
||||
///\param dims - IN: Size of each array dimension
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType()
|
||||
{
|
||||
hid_t new_type_id = H5Tarray_create(base_type.getId(), ndims, dims, NULL);
|
||||
if (new_type_id <= 0)
|
||||
{
|
||||
throw DataTypeIException("ArrayType constructor", "H5Tarray_create failed");
|
||||
}
|
||||
id = new_type_id;
|
||||
rank = ndims;
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = dims[i];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ArrayType::getArrayNDims
|
||||
///\brief Returns the number of dimensions for an array datatype.
|
||||
///\return Number of dimensions
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
int ArrayType::getArrayNDims()
|
||||
{
|
||||
// If the array's rank has not been stored, i.e. rank is init to -1,
|
||||
// retrieve it via the C API
|
||||
if (rank < 0)
|
||||
{
|
||||
rank = H5Tget_array_ndims(id);
|
||||
if (rank < 0)
|
||||
{
|
||||
throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed");
|
||||
}
|
||||
}
|
||||
return(rank);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ArrayType::getArrayDims
|
||||
///\brief Retrieves the size of all dimensions of an array datatype.
|
||||
///\param dims - OUT: Sizes of dimensions
|
||||
///\return Number of dimensions
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
int ArrayType::getArrayDims(hsize_t* dims)
|
||||
{
|
||||
// if the array's dimensions have not been stored, retrieve them via C API
|
||||
if (dimensions == NULL)
|
||||
{
|
||||
int ndims = H5Tget_array_dims(id, dims, NULL);
|
||||
if (ndims < 0)
|
||||
{
|
||||
throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims failed");
|
||||
}
|
||||
// store the array's info in memory
|
||||
rank = ndims;
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = dims[i];
|
||||
}
|
||||
// otherwise, simply copy what's in 'dimensions' to 'dims'
|
||||
for (int i = 0; i < rank; i++)
|
||||
dims[i] = dimensions[i];
|
||||
return(rank);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ArrayType destructor
|
||||
///\brief Properly terminates access to this array datatype.
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType::~ArrayType()
|
||||
{
|
||||
// Free allocated memory
|
||||
if (dimensions != NULL)
|
||||
delete [] dimensions;
|
||||
}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
#endif
|
||||
57
c++/src/H5ArrayType.h
Normal file
57
c++/src/H5ArrayType.h
Normal file
@@ -0,0 +1,57 @@
|
||||
// C++ informative line for the emacs editor: -*- C++ -*-
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class ArrayType inherits from DataType and provides wrappers for the
|
||||
// HDF5 C's Array Datatypes.
|
||||
|
||||
#ifndef _H5ArrayType_H
|
||||
#define _H5ArrayType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
class H5_DLLCPP ArrayType : public DataType {
|
||||
public:
|
||||
// Constructor that creates a new array data type based on the
|
||||
// specified base type.
|
||||
ArrayType(const DataType& base_type, int ndims, const hsize_t* dims);
|
||||
|
||||
// Returns the number of dimensions of this array datatype.
|
||||
int getArrayNDims();
|
||||
|
||||
// Returns the sizes of dimensions of this array datatype.
|
||||
int getArrayDims(hsize_t* dims);
|
||||
|
||||
// Copy constructor - makes copy of the original object
|
||||
ArrayType( const ArrayType& original );
|
||||
|
||||
// Default destructor
|
||||
virtual ~ArrayType();
|
||||
|
||||
protected:
|
||||
// Default constructor
|
||||
ArrayType();
|
||||
|
||||
// Constructor that takes an existing id
|
||||
ArrayType( const hid_t existing_id );
|
||||
|
||||
private:
|
||||
int rank; // Rank of the array
|
||||
hsize_t* dimensions; // Sizes of the array dimensions
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5AtomType.h"
|
||||
|
||||
@@ -27,16 +29,38 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType default constructor [protected]
|
||||
// Purpose Default constructor: creates a stub atomic datatype.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AtomType::AtomType() : DataType() {}
|
||||
|
||||
// Constructor that takes an existing id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType overloaded constructor [protected]
|
||||
// Purpose Creates an AtomType object using an existing id.
|
||||
// Parameter existing_id - IN: Id of an existing datatype
|
||||
// Exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Copy constructor: makes a copy of the original AtomType object.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original AtomType object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AtomType::AtomType( const AtomType& original ) : DataType( original ) {}
|
||||
|
||||
// Sets the total size for an atomic datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::setSize
|
||||
///\brief Sets the total size for an atomic datatype.
|
||||
///\param size - IN: Size to set
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::setSize( size_t size ) const
|
||||
{
|
||||
// Call C routine H5Tset_size to set the total size
|
||||
@@ -47,7 +71,17 @@ void AtomType::setSize( size_t size ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the byte order of an atomic datatype. Inheritance class???
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::getOrder
|
||||
///\brief Returns the byte order of an atomic datatype.
|
||||
///\param order_string - OUT: Text description of the returned byte order
|
||||
///\return Byte order, which can be:
|
||||
/// \li \c H5T_ORDER_LE
|
||||
/// \li \c H5T_ORDER_BE
|
||||
/// \li \c H5T_ORDER_VAX
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_order_t AtomType::getOrder( string& order_string ) const
|
||||
{
|
||||
// Call C routine to get the byte ordering
|
||||
@@ -68,7 +102,16 @@ H5T_order_t AtomType::getOrder( string& order_string ) const
|
||||
return( type_order );
|
||||
}
|
||||
|
||||
// Sets the byte ordering of an atomic datatype. Inheritance class???
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::setOrder
|
||||
///\brief Sets the byte ordering of an atomic datatype.
|
||||
///\param order - IN: Byte ordering constant, which can be:
|
||||
/// \li \c H5T_ORDER_LE
|
||||
/// \li \c H5T_ORDER_BE
|
||||
/// \li \c H5T_ORDER_VAX
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::setOrder( H5T_order_t order ) const
|
||||
{
|
||||
// Call C routine to set the byte ordering
|
||||
@@ -79,7 +122,17 @@ void AtomType::setOrder( H5T_order_t order ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the precision of an atomic datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::getPrecision
|
||||
///\brief Returns the precision of an atomic datatype.
|
||||
///\return Number of significant bits
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// The precision is the number of significant bits which,
|
||||
/// unless padding is present, is 8 times larger than the
|
||||
/// value returned by \c DataType::getSize().
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
size_t AtomType::getPrecision() const
|
||||
{
|
||||
size_t num_signi_bits = H5Tget_precision( id ); // C routine
|
||||
@@ -93,7 +146,16 @@ size_t AtomType::getPrecision() const
|
||||
return( num_signi_bits );
|
||||
}
|
||||
|
||||
// Sets the precision of an atomic datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::setPrecision
|
||||
///\brief Sets the precision of an atomic datatype.
|
||||
///\param precision - IN: Number of bits of precision
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For information, please see C layer Reference Manuat at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetPrecision
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::setPrecision( size_t precision ) const
|
||||
{
|
||||
// Call C routine to set the datatype precision
|
||||
@@ -104,10 +166,20 @@ void AtomType::setPrecision( size_t precision ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the bit offset of the first significant bit.
|
||||
// 12/05/00: due to C API change
|
||||
// - return type changed from size_t to int
|
||||
// - offset = -1 when failure occurs vs. 0
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::getOffset
|
||||
///\brief Retrieves the bit offset of the first significant bit.
|
||||
///\return Offset value
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For information, please see C layer Reference Manuat at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-GetOffset
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// 12/05/00: due to C API change
|
||||
// - return type changed from size_t to int
|
||||
// - offset = -1 when failure occurs vs. 0
|
||||
//--------------------------------------------------------------------------
|
||||
int AtomType::getOffset() const
|
||||
{
|
||||
int offset = H5Tget_offset( id ); // C routine
|
||||
@@ -121,7 +193,16 @@ int AtomType::getOffset() const
|
||||
return( offset );
|
||||
}
|
||||
|
||||
// Sets the bit offset of the first significant bit.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::setOffset
|
||||
///\brief Sets the bit offset of the first significant bit.
|
||||
///\param offset - IN: Offset of first significant bit
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For information, please see C layer Reference Manuat at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetOffset
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::setOffset( size_t offset ) const
|
||||
{
|
||||
// Call C routine to set the bit offset
|
||||
@@ -132,30 +213,58 @@ void AtomType::setOffset( size_t offset ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the padding type of the least and most-significant bit padding.
|
||||
// these two are for Opaque type
|
||||
//void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const
|
||||
//{
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::getPad
|
||||
///\brief Retrieves the padding type of the least and most-significant
|
||||
/// bit padding.
|
||||
///\param lsb - OUT: Least-significant bit padding type
|
||||
///\param msb - OUT: Most-significant bit padding type
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// Possible values for \a lsb and \a msb include:
|
||||
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
|
||||
/// \li \c H5T_PAD_ONE (1) - Set background to ones.
|
||||
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const
|
||||
{
|
||||
// Call C routine to get the padding type
|
||||
//herr_t ret_value = H5Tget_pad( id, &lsb, &msb );
|
||||
//if( ret_value < 0 )
|
||||
//{
|
||||
//throw DataTypeIException("AtomType::getPad", "H5Tget_pad failed");
|
||||
//}
|
||||
//}
|
||||
herr_t ret_value = H5Tget_pad( id, &lsb, &msb );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw DataTypeIException("AtomType::getPad", "H5Tget_pad failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the least and most-significant bits padding types
|
||||
//void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const
|
||||
//{
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::getPad
|
||||
///\brief Sets the least and most-significant bits padding types.
|
||||
///\param lsb - IN: Least-significant bit padding type
|
||||
///\param msb - IN: Most-significant bit padding type
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// Valid values for \a lsb and \a msb include:
|
||||
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
|
||||
/// \li \c H5T_PAD_ONE (1) - Set background to ones.
|
||||
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const
|
||||
{
|
||||
// Call C routine to set the padding type
|
||||
//herr_t ret_value = H5Tset_pad( id, lsb, msb );
|
||||
//if( ret_value < 0 )
|
||||
//{
|
||||
//throw DataTypeIException("AtomType::setPad", "H5Tset_pad failed");
|
||||
//}
|
||||
//}
|
||||
herr_t ret_value = H5Tset_pad( id, lsb, msb );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw DataTypeIException("AtomType::setPad", "H5Tset_pad failed");
|
||||
}
|
||||
}
|
||||
|
||||
// This destructor terminates access to the datatype; it calls ~DataType
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AtomType::~AtomType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -26,21 +26,12 @@ namespace H5 {
|
||||
#endif
|
||||
class H5_DLLCPP AtomType : public DataType {
|
||||
public:
|
||||
// Sets the total size for an atomic datatype.
|
||||
void setSize( size_t size ) const;
|
||||
|
||||
// Returns the byte order of an atomic datatype.
|
||||
H5T_order_t getOrder( string& order_string ) const;
|
||||
|
||||
// Sets the byte ordering of an atomic datatype.
|
||||
void setOrder( H5T_order_t order ) const;
|
||||
|
||||
// Returns the precision of an atomic datatype.
|
||||
size_t getPrecision() const;
|
||||
|
||||
// Sets the precision of an atomic datatype.
|
||||
void setPrecision( size_t precision ) const;
|
||||
|
||||
// Retrieves the bit offset of the first significant bit.
|
||||
// 12/05/00 - changed return type to int from size_t - C API
|
||||
int getOffset() const;
|
||||
@@ -48,12 +39,20 @@ class H5_DLLCPP AtomType : public DataType {
|
||||
// Sets the bit offset of the first significant bit.
|
||||
void setOffset( size_t offset ) const;
|
||||
|
||||
// The followings will go into Opaque type when completed
|
||||
// Retrieves the padding type of the least and most-significant bit padding.
|
||||
// void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const;
|
||||
void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const;
|
||||
|
||||
// Sets the least and most-significant bits padding types
|
||||
// void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const;
|
||||
void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const;
|
||||
|
||||
// Returns the precision of an atomic datatype.
|
||||
size_t getPrecision() const;
|
||||
|
||||
// Sets the precision of an atomic datatype.
|
||||
void setPrecision( size_t precision ) const;
|
||||
|
||||
// Sets the total size for an atomic datatype.
|
||||
void setSize( size_t size ) const;
|
||||
|
||||
// Copy constructor - makes copy of the original object
|
||||
AtomType( const AtomType& original );
|
||||
@@ -62,11 +61,13 @@ class H5_DLLCPP AtomType : public DataType {
|
||||
virtual ~AtomType();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Default constructor
|
||||
AtomType();
|
||||
|
||||
// Constructor that takes an existing id
|
||||
AtomType( const hid_t existing_id );
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "H5Object.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5Attribute.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DataSpace.h"
|
||||
|
||||
@@ -35,14 +37,39 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Copy constructor: makes a copy of the original object; simply invokes
|
||||
// the base class copy constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute default constructor
|
||||
///\brief Default constructor: Creates a stub attribute
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute::Attribute() : AbstractDs() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original Attribute object.
|
||||
///\param original - IN: Original Attribute object to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute::Attribute( const Attribute& original ) : AbstractDs( original ) {}
|
||||
|
||||
// Creates a copy of an existing attribute using an id
|
||||
Attribute::Attribute( const hid_t attr_id ) : AbstractDs( attr_id ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute overloaded constructor
|
||||
///\brief Creates an Attribute object using the id of an existing
|
||||
/// attribute.
|
||||
///\param existing_id - IN: Id of an existing attribute
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute::Attribute(const hid_t existing_id) : AbstractDs(existing_id) {}
|
||||
|
||||
// Writes data to this attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::write
|
||||
///\brief Writes data to this attribute.
|
||||
///\param mem_type - IN: Attribute datatype (in memory)
|
||||
///\param buf - IN: Data to be written
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::write( const DataType& mem_type, const void *buf ) const
|
||||
{
|
||||
herr_t ret_value = H5Awrite( id, mem_type.getId(), buf );
|
||||
@@ -52,6 +79,15 @@ void Attribute::write( const DataType& mem_type, const void *buf ) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::write
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It writes a \a std::string to this attribute.
|
||||
///\param mem_type - IN: Attribute datatype (in memory)
|
||||
///\param strg - IN: Data to be written
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Apr, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::write( const DataType& mem_type, const string& strg ) const
|
||||
{
|
||||
// Convert string to C-string
|
||||
@@ -65,7 +101,32 @@ void Attribute::write( const DataType& mem_type, const string& strg ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Reads data from this attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::read
|
||||
///\brief Reads data from this attribute.
|
||||
///\param mem_type - IN: Attribute datatype (in memory)
|
||||
///\param buf - OUT: Buffer for read data
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::read( const DataType& mem_type, void *buf ) const
|
||||
{
|
||||
herr_t ret_value = H5Aread( id, mem_type.getId(), buf );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "H5Aread failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::read
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It reads a \a std::string from this attribute.
|
||||
///\param mem_type - IN: Attribute datatype (in memory)
|
||||
///\param strg - IN: Buffer for read string
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Apr, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::read( const DataType& mem_type, string& strg ) const
|
||||
{
|
||||
size_t size = mem_type.getSize();
|
||||
@@ -79,17 +140,13 @@ void Attribute::read( const DataType& mem_type, string& strg ) const
|
||||
delete strg_C;
|
||||
}
|
||||
|
||||
// Reads data from this attribute.
|
||||
void Attribute::read( const DataType& mem_type, void *buf ) const
|
||||
{
|
||||
herr_t ret_value = H5Aread( id, mem_type.getId(), buf );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "H5Aread failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Gets a copy of the dataspace for this attribute.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getSpace
|
||||
///\brief Gets a copy of the dataspace for this attribute.
|
||||
///\return Dataspace instance
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace Attribute::getSpace() const
|
||||
{
|
||||
// Calls C function H5Aget_space to get the id of the dataspace
|
||||
@@ -107,11 +164,16 @@ DataSpace Attribute::getSpace() const
|
||||
}
|
||||
}
|
||||
|
||||
// This private member function calls the C API to get the generic datatype
|
||||
// of the datatype that is used by this attribute. This function is used
|
||||
// by the overloaded functions getDataType defined in AbstractDs for the
|
||||
// generic datatype and specific sub-types.
|
||||
hid_t Attribute::p_getType() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::p_get_type (private)
|
||||
// Purpose Gets the datatype of this attribute.
|
||||
// Return Id of the datatype
|
||||
// Exception H5::AttributeIException
|
||||
// Description
|
||||
// This private function is used in AbstractDs.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t Attribute::p_get_type() const
|
||||
{
|
||||
hid_t type_id = H5Aget_type( id );
|
||||
if( type_id > 0 )
|
||||
@@ -122,7 +184,15 @@ hid_t Attribute::p_getType() const
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the name of this attribute, returning its length.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief Gets the name of this attribute, returning its length.
|
||||
///\param buf_size - IN: Desired length of the name
|
||||
///\param attr_name - OUT: Buffer for the name string
|
||||
///\return Length of the attribute name
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Nov, 2001
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const
|
||||
{
|
||||
char* name_C = new char[buf_size+1]; // temporary C-string for C API
|
||||
@@ -135,13 +205,22 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const
|
||||
{
|
||||
throw AttributeIException("Attribute::getName", "H5Aget_name failed");
|
||||
}
|
||||
// otherwise, convert the C string attribute name and return
|
||||
// otherwise, convert the C attribute name and return
|
||||
attr_name = name_C;
|
||||
delete name_C;
|
||||
return( name_size );
|
||||
}
|
||||
|
||||
// Gets the name of this attribute, returning the name, not the length.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it returns the
|
||||
/// attribute's name, not the length.
|
||||
///\return Name of the attribute
|
||||
///\param buf_size - IN: Desired length of the name
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string Attribute::getName( size_t buf_size ) const
|
||||
{
|
||||
string attr_name;
|
||||
@@ -150,8 +229,45 @@ string Attribute::getName( size_t buf_size ) const
|
||||
// let caller catch exception if any
|
||||
}
|
||||
|
||||
// This private function calls the C API H5Aclose to close this attribute.
|
||||
// Used by the IdComponent::reset.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above functions in that it doesn't take
|
||||
/// any arguments and returns the attribute's name.
|
||||
///\return Name of the attribute
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
string Attribute::getName() const
|
||||
{
|
||||
// Try with 256 characters for the name first, if the name's length
|
||||
// returned is more than that then, read the name again with the
|
||||
// appropriate space allocation
|
||||
char* name_C = new char[256]; // temporary C-string for C API
|
||||
ssize_t name_size = H5Aget_name(id, 255, name_C);
|
||||
|
||||
string attr_name;
|
||||
if (name_size >= 256)
|
||||
name_size = getName(name_size, attr_name);
|
||||
|
||||
// otherwise, convert the C attribute name and return
|
||||
else
|
||||
attr_name = name_C;
|
||||
|
||||
delete name_C;
|
||||
return( attr_name );
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::p_close (private)
|
||||
// Purpose: Closes this attribute.
|
||||
// Exception H5::AttributeIException
|
||||
// Description
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer. - May, 2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::p_close() const
|
||||
{
|
||||
herr_t ret_value = H5Aclose( id );
|
||||
@@ -160,17 +276,18 @@ void Attribute::p_close() const
|
||||
throw AttributeIException(0, "H5Aclose failed");
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// The destructor of this instance calls IdComponent::reset to
|
||||
// reset its identifier - no longer true
|
||||
// Older compilers (baldric) don't support template member functions
|
||||
// and IdComponent::reset is one; so at this time, the resetId is not
|
||||
// a member function so it can be template to work around that problem.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute destructor
|
||||
///\brief Properly terminates access to this attribute.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute::~Attribute()
|
||||
{
|
||||
// The attribute id will be closed properly
|
||||
try {
|
||||
resetIdComponent( this ); }
|
||||
resetIdComponent(this); }
|
||||
catch (Exception close_error) { // thrown by p_close
|
||||
cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl;
|
||||
}
|
||||
|
||||
@@ -22,26 +22,21 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP Attribute : public AbstractDs {
|
||||
public:
|
||||
// Writes data to this attribute.
|
||||
void write(const DataType& mem_type, const void *buf ) const;
|
||||
void write(const DataType& mem_type, const string& strg ) const;
|
||||
// Gets the name of this attribute.
|
||||
ssize_t getName( size_t buf_size, string& attr_name ) const;
|
||||
string getName( size_t buf_size ) const; // returns name, not its length
|
||||
string getName() const; // returns name, no argument
|
||||
|
||||
// Gets a copy of the dataspace for this attribute.
|
||||
virtual DataSpace getSpace() const;
|
||||
|
||||
// Reads data from this attribute.
|
||||
void read( const DataType& mem_type, void *buf ) const;
|
||||
void read( const DataType& mem_type, string& strg ) const;
|
||||
|
||||
// Gets a copy of the dataspace for this attribute.
|
||||
virtual DataSpace getSpace() const;
|
||||
|
||||
// Gets the name of this attribute.
|
||||
ssize_t getName( size_t buf_size, string& attr_name ) const;
|
||||
string getName( size_t buf_size ) const; // returns name, not its length
|
||||
|
||||
// do not inherit iterateAttrs from H5Object
|
||||
int iterateAttrs() { return 0; }
|
||||
|
||||
// Used by the API to appropriately close a attribute
|
||||
virtual void p_close() const;
|
||||
// Writes data to this attribute.
|
||||
void write(const DataType& mem_type, const void *buf ) const;
|
||||
void write(const DataType& mem_type, const string& strg ) const;
|
||||
|
||||
// Creates a copy of an existing attribute using the attribute id
|
||||
Attribute( const hid_t attr_id );
|
||||
@@ -49,6 +44,12 @@ class H5_DLLCPP Attribute : public AbstractDs {
|
||||
// Copy constructor: makes a copy of an existing Attribute object.
|
||||
Attribute( const Attribute& original );
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Used by the API to appropriately close an attribute
|
||||
virtual void p_close() const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Destructor: properly terminates access to this attribute.
|
||||
virtual ~Attribute();
|
||||
|
||||
private:
|
||||
@@ -56,7 +57,13 @@ class H5_DLLCPP Attribute : public AbstractDs {
|
||||
// getTypeClass and various API functions getXxxType
|
||||
// defined in AbstractDs for generic datatype and specific
|
||||
// sub-types
|
||||
virtual hid_t p_getType() const;
|
||||
virtual hid_t p_get_type() const;
|
||||
|
||||
// do not inherit iterateAttrs from H5Object
|
||||
int iterateAttrs() { return 0; }
|
||||
|
||||
// Default constructor
|
||||
Attribute();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
||||
@@ -49,12 +49,22 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Creates a new group at this location which can be a file or another group.
|
||||
Group CommonFG::createGroup( const string& name, size_t size_hint ) const
|
||||
{
|
||||
return( createGroup( name.c_str(), size_hint ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::createGroup
|
||||
///\brief Creates a new group at this location which can be a file
|
||||
/// or another group.
|
||||
///\param name - IN: Name of the group to create
|
||||
///\param size_hint - IN: Indicates the number of bytes to reserve for
|
||||
/// the names that will appear in the group
|
||||
///\return Group instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
///\par Description
|
||||
/// The optional \a size_hint specifies how much file space to
|
||||
/// reserve for storing the names that will appear in this new
|
||||
/// group. If a non-positive value is provided for the \a size_hint
|
||||
/// then a default size is chosen.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group CommonFG::createGroup( const char* name, size_t size_hint ) const
|
||||
{
|
||||
// Call C routine H5Gcreate to create the named group, giving the
|
||||
@@ -72,11 +82,27 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const
|
||||
return( group );
|
||||
}
|
||||
|
||||
// Opens an existing group in a location which can be a file or another group
|
||||
Group CommonFG::openGroup( const string& name ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::createGroup
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group CommonFG::createGroup( const string& name, size_t size_hint ) const
|
||||
{
|
||||
return( openGroup( name.c_str() ));
|
||||
return( createGroup( name.c_str(), size_hint ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openGroup
|
||||
///\brief Opens an existing group in a location which can be a file
|
||||
/// or another group.
|
||||
///\param name - IN: Name of the group to open
|
||||
///\return Group instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group CommonFG::openGroup( const char* name ) const
|
||||
{
|
||||
// Call C routine H5Gopen to open the named group, giving the
|
||||
@@ -94,11 +120,29 @@ Group CommonFG::openGroup( const char* name ) const
|
||||
return( group );
|
||||
}
|
||||
|
||||
// Creates a new dataset at this location.
|
||||
DataSet CommonFG::createDataSet( const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openGroup
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group CommonFG::openGroup( const string& name ) const
|
||||
{
|
||||
return( createDataSet( name.c_str(), data_type, data_space, create_plist ));
|
||||
return( openGroup( name.c_str() ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::createDataSet
|
||||
///\brief Creates a new dataset at this location.
|
||||
///\param name - IN: Name of the dataset to create
|
||||
///\param data_type - IN: Datatype of the dataset
|
||||
///\param data_space - IN: Dataspace for the dataset
|
||||
///\param create_plist - IN: Creation properly list for the dataset
|
||||
///\return DataSet instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
@@ -120,11 +164,26 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
|
||||
return( dataset );
|
||||
}
|
||||
|
||||
// Opens an existing dataset at this location.
|
||||
DataSet CommonFG::openDataSet( const string& name ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::createDataSet
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet CommonFG::createDataSet( const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const
|
||||
{
|
||||
return( openDataSet( name.c_str() ));
|
||||
return( createDataSet( name.c_str(), data_type, data_space, create_plist ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openDataSet
|
||||
///\brief Opens an existing dataset at this location.
|
||||
///\param name - IN: Name of the dataset to open
|
||||
///\return DataSet instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet CommonFG::openDataSet( const char* name ) const
|
||||
{
|
||||
// Call C function H5Dopen to open the specified dataset, giving
|
||||
@@ -142,12 +201,34 @@ DataSet CommonFG::openDataSet( const char* name ) const
|
||||
return( dataset );
|
||||
}
|
||||
|
||||
// Creates a link of the specified type from new_name to current_name;
|
||||
// both names are interpreted relative to the specified location id
|
||||
void CommonFG::link( H5G_link_t link_type, const string& curr_name, const string& new_name ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openDataSet
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet CommonFG::openDataSet( const string& name ) const
|
||||
{
|
||||
link( link_type, curr_name.c_str(), new_name.c_str() );
|
||||
return( openDataSet( name.c_str() ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::link
|
||||
///\brief Creates a link of the specified type from \a new_name to
|
||||
/// \a curr_name.
|
||||
///\param link_type - IN: Link type; possible values are
|
||||
/// \li \c H5G_LINK_HARD
|
||||
/// \li \c H5G_LINK_SOFT
|
||||
///\param curr_name - IN: Name of the existing object if link is a hard
|
||||
/// link; can be anything for the soft link
|
||||
///\param new_name - IN: New name for the object
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
///\par Description
|
||||
/// Note that both names are interpreted relative to the
|
||||
/// specified location.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* new_name ) const
|
||||
{
|
||||
herr_t ret_value = H5Glink( getLocId(), link_type, curr_name, new_name );
|
||||
@@ -157,11 +238,25 @@ void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* ne
|
||||
}
|
||||
}
|
||||
|
||||
// Removes the specified name at this location.
|
||||
void CommonFG::unlink( const string& name ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::link
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a curr_name and \a new_name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::link( H5G_link_t link_type, const string& curr_name, const string& new_name ) const
|
||||
{
|
||||
unlink( name.c_str() );
|
||||
link( link_type, curr_name.c_str(), new_name.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::unlink
|
||||
///\brief Removes the specified name at this location.
|
||||
///\param name - IN: Name of the object to be removed
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::unlink( const char* name ) const
|
||||
{
|
||||
herr_t ret_value = H5Gunlink( getLocId(), name );
|
||||
@@ -171,11 +266,26 @@ void CommonFG::unlink( const char* name ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Renames an object at this location.
|
||||
void CommonFG::move( const string& src, const string& dst ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::unlink
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::unlink( const string& name ) const
|
||||
{
|
||||
move( src.c_str(), dst.c_str() );
|
||||
unlink( name.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::move
|
||||
///\brief Renames an object at this location.
|
||||
///\param src - IN: Object's original name
|
||||
///\param dst - IN: Object's new name
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::move( const char* src, const char* dst ) const
|
||||
{
|
||||
herr_t ret_value = H5Gmove( getLocId(), src, dst );
|
||||
@@ -185,11 +295,27 @@ void CommonFG::move( const char* src, const char* dst ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns information about an object
|
||||
void CommonFG::getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::move
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a src and \a dst.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::move( const string& src, const string& dst ) const
|
||||
{
|
||||
getObjinfo( name.c_str(), follow_link, statbuf );
|
||||
move( src.c_str(), dst.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjinfo
|
||||
///\brief Returns information about an object.
|
||||
///\param name - IN: Name of the object
|
||||
///\param follow_link - IN: Link flag
|
||||
///\param statbuf - OUT: Buffer to return information about the object
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const
|
||||
{
|
||||
herr_t ret_value = H5Gget_objinfo( getLocId(), name, follow_link, &statbuf );
|
||||
@@ -199,11 +325,27 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the name of the object that the symbolic link points to.
|
||||
string CommonFG::getLinkval( const string& name, size_t size ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjinfo
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const
|
||||
{
|
||||
return( getLinkval( name.c_str(), size ));
|
||||
getObjinfo( name.c_str(), follow_link, statbuf );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getLinkval
|
||||
///\brief Returns the name of the object that the symbolic link points to.
|
||||
///\param name - IN: Symbolic link to the object
|
||||
///\param size - IN: Maximum number of characters of value to be returned
|
||||
///\return Name of the object
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string CommonFG::getLinkval( const char* name, size_t size ) const
|
||||
{
|
||||
char* value_C = new char[size+1]; // temporary C-string for C API
|
||||
@@ -218,11 +360,33 @@ string CommonFG::getLinkval( const char* name, size_t size ) const
|
||||
return( value );
|
||||
}
|
||||
|
||||
// Sets the comment for an object specified by its name
|
||||
void CommonFG::setComment( const string& name, const string& comment ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getLinkval
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string CommonFG::getLinkval( const string& name, size_t size ) const
|
||||
{
|
||||
setComment( name.c_str(), comment.c_str() );
|
||||
return( getLinkval( name.c_str(), size ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::setComment
|
||||
///\brief Sets or resets the comment for an object specified by its name.
|
||||
///\param name - IN: Name of the object
|
||||
///\param comment - IN: New comment
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
///\par Description
|
||||
/// If \a comment is an empty string or a null pointer, the comment
|
||||
/// message is removed from the object.
|
||||
/// Comments should be relatively short, null-terminated, ASCII
|
||||
/// strings. They can be attached to any object that has an
|
||||
/// object header, e.g., data sets, groups, named data types,
|
||||
/// and data spaces, but not symbolic links.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::setComment( const char* name, const char* comment ) const
|
||||
{
|
||||
herr_t ret_value = H5Gset_comment( getLocId(), name, comment );
|
||||
@@ -232,11 +396,27 @@ void CommonFG::setComment( const char* name, const char* comment ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves comment for specified object
|
||||
string CommonFG::getComment( const string& name, size_t bufsize ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::setComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name and \a comment.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::setComment( const string& name, const string& comment ) const
|
||||
{
|
||||
return( getComment( name.c_str(), bufsize ));
|
||||
setComment( name.c_str(), comment.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getComment
|
||||
///\brief Retrieves comment for the specified object.
|
||||
///\param name - IN: Name of the object
|
||||
///\param bufsize - IN: Length of the comment to retrieve
|
||||
///\return Comment string
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string CommonFG::getComment( const char* name, size_t bufsize ) const
|
||||
{
|
||||
// temporary C-string for the object's comment
|
||||
@@ -254,11 +434,27 @@ string CommonFG::getComment( const char* name, size_t bufsize ) const
|
||||
return( comment );
|
||||
}
|
||||
|
||||
// Mounts the file 'child' onto this group
|
||||
void CommonFG::mount( const string& name, H5File& child, PropList& plist ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string CommonFG::getComment( const string& name, size_t bufsize ) const
|
||||
{
|
||||
mount( name.c_str(), child, plist );
|
||||
return( getComment( name.c_str(), bufsize ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::mount
|
||||
///\brief Mounts the file \a child onto this group.
|
||||
///\param name - IN: Name of the group
|
||||
///\param child - IN: File to mount
|
||||
///\param plist - IN: Property list to use
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
@@ -275,11 +471,25 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Unmounts the file named 'name' from this parent group
|
||||
void CommonFG::unmount( const string& name ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::mount
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::mount( const string& name, H5File& child, PropList& plist ) const
|
||||
{
|
||||
unmount( name.c_str() );
|
||||
mount( name.c_str(), child, plist );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::unmount
|
||||
///\brief Unmounts the specified file.
|
||||
///\param name - IN: Name of the file to unmount
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::unmount( const char* name ) const
|
||||
{
|
||||
// Call C routine H5Fmount to do the mouting
|
||||
@@ -292,10 +502,30 @@ void CommonFG::unmount( const char* name ) const
|
||||
}
|
||||
}
|
||||
|
||||
// This private member function calls the C API H5Topen to open the
|
||||
// named datatype and returns the datatype's identifier. The function
|
||||
// is used by the functions openXxxType's below for opening the sub-types
|
||||
hid_t CommonFG::p_openDataType( const char* name ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::unmount
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::unmount( const string& name ) const
|
||||
{
|
||||
unmount( name.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::p_open_data_type (private)
|
||||
// Purpose Opens the named datatype and returns the datatype's identifier.
|
||||
// Return Id of the datatype
|
||||
// Exception H5::FileIException or H5::GroupIException
|
||||
// Description
|
||||
// This private function is used by the member functions
|
||||
// CommonFG::openXxxType, where Xxx indicates the specific
|
||||
// datatypes.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t CommonFG::p_open_data_type( const char* name ) const
|
||||
{
|
||||
// Call C function H5Topen to open the named datatype in this group,
|
||||
// giving either the file or group id
|
||||
@@ -313,80 +543,178 @@ hid_t CommonFG::p_openDataType( const char* name ) const
|
||||
|
||||
//
|
||||
// The following member functions use the private function
|
||||
// p_openDataType to open a named datatype in this location
|
||||
// p_open_data_type to open a named datatype in this location
|
||||
//
|
||||
|
||||
// Opens the named generic datatype in this group.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openDataType
|
||||
///\brief Opens the named generic datatype at this location.
|
||||
///\param name - IN: Name of the datatype to open
|
||||
///\return DataType instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType CommonFG::openDataType( const char* name ) const
|
||||
{
|
||||
DataType data_type(p_open_data_type(name));
|
||||
return( data_type );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openDataType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType CommonFG::openDataType( const string& name ) const
|
||||
{
|
||||
return( openDataType( name.c_str()) );
|
||||
}
|
||||
DataType CommonFG::openDataType( const char* name ) const
|
||||
{
|
||||
DataType data_type( p_openDataType( name ));
|
||||
return( data_type );
|
||||
}
|
||||
|
||||
// Opens the named enumeration datatype in this group.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openEnumType
|
||||
///\brief Opens the named enumeration datatype at this location.
|
||||
///\param name - IN: Name of the enumeration datatype to open
|
||||
///\return EnumType instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType CommonFG::openEnumType( const char* name ) const
|
||||
{
|
||||
EnumType enum_type(p_open_data_type(name));
|
||||
return(enum_type);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openEnumType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType CommonFG::openEnumType( const string& name ) const
|
||||
{
|
||||
return( openEnumType( name.c_str()) );
|
||||
}
|
||||
EnumType CommonFG::openEnumType( const char* name ) const
|
||||
{
|
||||
EnumType enum_type( p_openDataType( name ));
|
||||
return( enum_type );
|
||||
}
|
||||
|
||||
// Opens the named compound datatype in this group.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openCompType
|
||||
///\brief Opens the named compound datatype at this location.
|
||||
///\param name - IN: Name of the compound datatype to open
|
||||
///\return CompType instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType CommonFG::openCompType( const char* name ) const
|
||||
{
|
||||
CompType comp_type(p_open_data_type(name));
|
||||
return(comp_type);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openCompType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType CommonFG::openCompType( const string& name ) const
|
||||
{
|
||||
return( openCompType( name.c_str()) );
|
||||
}
|
||||
CompType CommonFG::openCompType( const char* name ) const
|
||||
{
|
||||
CompType comp_type( p_openDataType( name ));
|
||||
return( comp_type );
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openIntType
|
||||
///\brief Opens the named integer datatype at this location.
|
||||
///\param name - IN: Name of the integer datatype to open
|
||||
///\return IntType instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType CommonFG::openIntType( const char* name ) const
|
||||
{
|
||||
IntType int_type(p_open_data_type(name));
|
||||
return(int_type);
|
||||
}
|
||||
|
||||
// Opens the named integer datatype in this group.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openIntType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType CommonFG::openIntType( const string& name ) const
|
||||
{
|
||||
return( openIntType( name.c_str()) );
|
||||
}
|
||||
IntType CommonFG::openIntType( const char* name ) const
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openFloatType
|
||||
///\brief Opens the named floating-point datatype at this location.
|
||||
///\param name - IN: Name of the floating-point datatype to open
|
||||
///\return FloatType instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType CommonFG::openFloatType( const char* name ) const
|
||||
{
|
||||
IntType int_type( p_openDataType( name ));
|
||||
return( int_type );
|
||||
FloatType float_type(p_open_data_type(name));
|
||||
return(float_type);
|
||||
}
|
||||
|
||||
// Opens the named floating-point datatype in this group.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openFloatType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType CommonFG::openFloatType( const string& name ) const
|
||||
{
|
||||
return( openFloatType( name.c_str()) );
|
||||
}
|
||||
FloatType CommonFG::openFloatType( const char* name ) const
|
||||
{
|
||||
FloatType float_type( p_openDataType( name ));
|
||||
return( float_type );
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openStrType
|
||||
///\brief Opens the named string datatype at this location.
|
||||
///\param name - IN: Name of the string datatype to open
|
||||
///\return StrType instance
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType CommonFG::openStrType( const char* name ) const
|
||||
{
|
||||
StrType str_type(p_open_data_type(name));
|
||||
return(str_type);
|
||||
}
|
||||
|
||||
// Opens the named string datatype of this group
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::openStrType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType CommonFG::openStrType( const string& name ) const
|
||||
{
|
||||
return( openStrType( name.c_str()) );
|
||||
}
|
||||
StrType CommonFG::openStrType( const char* name ) const
|
||||
{
|
||||
StrType str_type( p_openDataType( name ));
|
||||
return( str_type );
|
||||
}
|
||||
|
||||
// Iterates a user's function over the entries of a group.
|
||||
int CommonFG::iterateElems( const string& name, int *idx, H5G_iterate_t op , void* op_data )
|
||||
{
|
||||
return( iterateElems( name.c_str(), idx, op, op_data ));
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::iterateElems
|
||||
///\brief Iterates a user's function over the entries of a group.
|
||||
///\param name - IN : Name of group to iterate over
|
||||
///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices
|
||||
///\param op - IN : User's function to operate on each entry
|
||||
///\param op_data - IN/OUT: Data associated with the operation
|
||||
///\return The return value of the first operator that returns non-zero,
|
||||
/// or zero if all members were processed with no operator
|
||||
/// returning non-zero.
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* op_data )
|
||||
{
|
||||
int ret_value = H5Giterate( getLocId(), name, idx, op, op_data );
|
||||
@@ -397,14 +725,127 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void*
|
||||
return( ret_value );
|
||||
}
|
||||
|
||||
CommonFG::CommonFG()
|
||||
{ // do nothing
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::iterateElems
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int CommonFG::iterateElems( const string& name, int *idx, H5G_iterate_t op , void* op_data )
|
||||
{
|
||||
return( iterateElems( name.c_str(), idx, op, op_data ));
|
||||
}
|
||||
|
||||
CommonFG::~CommonFG()
|
||||
{ // do nothing
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getNumObjs
|
||||
///\brief Returns the number of objects in this group.
|
||||
///\return Number of objects
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - January, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t CommonFG::getNumObjs() const
|
||||
{
|
||||
hsize_t num_objs;
|
||||
herr_t ret_value = H5Gget_num_objs(getLocId(), &num_objs);
|
||||
if(ret_value < 0)
|
||||
{
|
||||
throwException("getNumObjs", "H5Gget_num_objs failed");
|
||||
}
|
||||
return (num_objs);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjnameByIdx
|
||||
///\brief Retrieves the name of an object in this group, given the
|
||||
/// object's index.
|
||||
///\param idx - IN: Transient index of the object
|
||||
///\param name - IN/OUT: Retrieved name of the object
|
||||
///\param size - IN: Length to retrieve
|
||||
///\return Actual size of the object name or 0, if object has no name
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
///\par Description
|
||||
/// The value of idx can be any nonnegative number less than the
|
||||
/// total number of objects in the group, which is returned by
|
||||
/// the function \c CommonFG::getNumObjs. Note that this is a
|
||||
/// transient index; thus, an object may have a different index
|
||||
/// each time the group is opened.
|
||||
// Programmer Binh-Minh Ribler - January, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t CommonFG::getObjnameByIdx(hsize_t idx, string& name, size_t size) const
|
||||
{
|
||||
char* name_C = new char[size];
|
||||
ssize_t name_len = H5Gget_objname_by_idx(getLocId(), idx, name_C, size);
|
||||
if(name_len < 0)
|
||||
{
|
||||
throwException("getObjnameByIdx", "H5Gget_objname_by_idx failed");
|
||||
}
|
||||
name = string( name_C );
|
||||
delete [] name_C;
|
||||
return (name_len);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjTypeByIdx
|
||||
///\brief Returns the type of an object in this group, given the
|
||||
/// object's index.
|
||||
///\param idx - IN: Transient index of the object
|
||||
///\return Object type
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - January, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx);
|
||||
if (obj_type == H5G_UNKNOWN)
|
||||
{
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
return (obj_type);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjTypeByIdx
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function because it also provides
|
||||
/// the returned object type in text.
|
||||
///\param idx - IN: Transient index of the object
|
||||
///\param type_name - IN: Object type in text
|
||||
///\return Object type
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - January, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, string& type_name) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx);
|
||||
switch (obj_type)
|
||||
{
|
||||
case H5G_LINK: type_name = string("symbolic link"); break;
|
||||
case H5G_GROUP: type_name = string("group"); break;
|
||||
case H5G_DATASET: type_name = string("dataset"); break;
|
||||
case H5G_TYPE: type_name = string("datatype"); break;
|
||||
case H5G_UNKNOWN:
|
||||
default:
|
||||
{
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
}
|
||||
return (obj_type);
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG default constructor
|
||||
///\brief Default constructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CommonFG::CommonFG() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CommonFG::~CommonFG() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -28,102 +28,119 @@ class Group;
|
||||
class H5File;
|
||||
class H5_DLLCPP CommonFG {
|
||||
public:
|
||||
// Creates a new group at this location which can be a file or another group.
|
||||
Group createGroup( const string& name, size_t size_hint = 0 ) const;
|
||||
Group createGroup( const char* name, size_t size_hint = 0 ) const;
|
||||
// Creates a new group at this location which can be a file
|
||||
// or another group.
|
||||
Group createGroup(const char* name, size_t size_hint = 0) const;
|
||||
Group createGroup(const string& name, size_t size_hint = 0) const;
|
||||
|
||||
// Opens an existing group in a location which can be a file or another group
|
||||
Group openGroup( const string& name ) const;
|
||||
Group openGroup( const char* name ) const;
|
||||
// Opens an existing group in a location which can be a file
|
||||
// or another group.
|
||||
Group openGroup(const char* name) const;
|
||||
Group openGroup(const string& name) const;
|
||||
|
||||
// Creates a new dataset at this location.
|
||||
DataSet createDataSet( const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT ) const;
|
||||
DataSet createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT ) const;
|
||||
DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
|
||||
DataSet createDataSet(const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
|
||||
|
||||
// Opens an existing dataset at this location.
|
||||
DataSet openDataSet( const string& name ) const;
|
||||
DataSet openDataSet( const char* name ) const;
|
||||
DataSet openDataSet(const char* name) const;
|
||||
DataSet openDataSet(const string& name) const;
|
||||
|
||||
// Creates a link of the specified type from new_name to current_name;
|
||||
// both names are interpreted relative to the specified location id
|
||||
void link( H5G_link_t link_type, const string& curr_name, const string& new_name ) const;
|
||||
void link( H5G_link_t link_type, const char* curr_name, const char* new_name ) const;
|
||||
// Retrieves comment for the HDF5 object specified by its name.
|
||||
string getComment(const char* name, size_t bufsize) const;
|
||||
string getComment(const string& name, size_t bufsize) const;
|
||||
|
||||
// Removes the specified name at this location.
|
||||
void unlink( const string& name ) const;
|
||||
void unlink( const char* name ) const;
|
||||
// Sets the comment for an HDF5 object specified by its name.
|
||||
void setComment(const char* name, const char* comment) const;
|
||||
void setComment(const string& name, const string& comment) const;
|
||||
|
||||
// Get id of the location, either group or file - pure virtual so
|
||||
// the subclass can get the correct id
|
||||
virtual hid_t getLocId() const = 0;
|
||||
// Returns the name of the HDF5 object that the symbolic link points to.
|
||||
string getLinkval(const char* name, size_t size) const;
|
||||
string getLinkval(const string& name, size_t size) const;
|
||||
|
||||
// Renames an object at this location.
|
||||
void move( const string& src, const string& dst ) const;
|
||||
void move( const char* src, const char* dst ) const;
|
||||
// Returns the number of objects in this group.
|
||||
hsize_t getNumObjs() const;
|
||||
|
||||
// Returns information about an HDF5 object, given by its name,
|
||||
// at this location.
|
||||
void getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const;
|
||||
void getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const;
|
||||
void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
|
||||
void getObjinfo(const string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
|
||||
|
||||
// Returns the name of the HDF5 object that the symbolic link points to.
|
||||
string getLinkval( const string& name, size_t size ) const;
|
||||
string getLinkval( const char* name, size_t size ) const;
|
||||
// Retrieves the name of an object in this group, given the
|
||||
// object's index.
|
||||
ssize_t getObjnameByIdx(hsize_t idx, string& name, size_t size) const;
|
||||
|
||||
// Sets the comment for an HDF5 object specified by its name
|
||||
void setComment( const string& name, const string& comment ) const;
|
||||
void setComment( const char* name, const char* comment ) const;
|
||||
|
||||
// Retrieves comment for the HDF5 object specified by its name
|
||||
string getComment( const string& name, size_t bufsize ) const;
|
||||
string getComment( const char* name, size_t bufsize ) const;
|
||||
|
||||
// Mounts the file 'child' onto this location
|
||||
void mount( const string& name, H5File& child, PropList& plist ) const;
|
||||
void mount( const char* name, H5File& child, PropList& plist) const;
|
||||
|
||||
// Unmounts the file named 'name' from this parent location
|
||||
void unmount( const string& name ) const;
|
||||
void unmount( const char* name ) const;
|
||||
// Returns the type of an object in this group, given the
|
||||
// object's index.
|
||||
H5G_obj_t getObjTypeByIdx(hsize_t idx) const;
|
||||
H5G_obj_t getObjTypeByIdx(hsize_t idx, string& type_name) const;
|
||||
|
||||
// Iterates over the elements of this group - not implemented in
|
||||
// C++ style yet
|
||||
int iterateElems( const string& name, int *idx, H5G_iterate_t op, void *op_data );
|
||||
int iterateElems( const char* name, int *idx, H5G_iterate_t op, void *op_data );
|
||||
// C++ style yet.
|
||||
int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data);
|
||||
int iterateElems(const string& name, int *idx, H5G_iterate_t op, void *op_data);
|
||||
|
||||
// Opens a generic named datatype in this location
|
||||
DataType openDataType( const string& name ) const;
|
||||
DataType openDataType( const char* name ) const;
|
||||
// Creates a link of the specified type from new_name to current_name;
|
||||
// both names are interpreted relative to the specified location id.
|
||||
void link(H5G_link_t link_type, const char* curr_name, const char* new_name) const;
|
||||
void link(H5G_link_t link_type, const string& curr_name, const string& new_name) const;
|
||||
|
||||
// Opens a named enumeration datatype in this location
|
||||
EnumType openEnumType( const string& name ) const;
|
||||
EnumType openEnumType( const char* name ) const;
|
||||
// Removes the specified name at this location.
|
||||
void unlink(const char* name) const;
|
||||
void unlink(const string& name) const;
|
||||
|
||||
// Opens a named compound datatype in this location
|
||||
CompType openCompType( const string& name ) const;
|
||||
CompType openCompType( const char* name ) const;
|
||||
// Mounts the file 'child' onto this location.
|
||||
void mount(const char* name, H5File& child, PropList& plist) const;
|
||||
void mount(const string& name, H5File& child, PropList& plist) const;
|
||||
|
||||
// Opens a named integer datatype in this location
|
||||
IntType openIntType( const string& name ) const;
|
||||
IntType openIntType( const char* name ) const;
|
||||
// Unmounts the file named 'name' from this parent location.
|
||||
void unmount(const char* name) const;
|
||||
void unmount(const string& name) const;
|
||||
|
||||
// Opens a named floating-point datatype in this location
|
||||
FloatType openFloatType( const string& name ) const;
|
||||
FloatType openFloatType( const char* name ) const;
|
||||
// Renames an object at this location.
|
||||
void move(const char* src, const char* dst) const;
|
||||
void move(const string& src, const string& dst) const;
|
||||
|
||||
// Opens a named string datatype in this location
|
||||
StrType openStrType( const string& name ) const;
|
||||
StrType openStrType( const char* name ) const;
|
||||
// Opens a generic named datatype in this location.
|
||||
DataType openDataType(const char* name) const;
|
||||
DataType openDataType(const string& name) const;
|
||||
|
||||
// for H5File and Group to throw appropriate exception
|
||||
virtual void throwException(const string& func_name, const string& msg) const = 0;
|
||||
// Opens a named enumeration datatype in this location.
|
||||
EnumType openEnumType(const char* name) const;
|
||||
EnumType openEnumType(const string& name) const;
|
||||
|
||||
// Opens a named compound datatype in this location.
|
||||
CompType openCompType(const char* name) const;
|
||||
CompType openCompType(const string& name) const;
|
||||
|
||||
// Opens a named integer datatype in this location.
|
||||
IntType openIntType(const char* name) const;
|
||||
IntType openIntType(const string& name) const;
|
||||
|
||||
// Opens a named floating-point datatype in this location.
|
||||
FloatType openFloatType(const char* name) const;
|
||||
FloatType openFloatType(const string& name) const;
|
||||
|
||||
// Opens a named string datatype in this location.
|
||||
StrType openStrType(const char* name) const;
|
||||
StrType openStrType(const string& name) const;
|
||||
|
||||
/// For subclasses, H5File and Group, to return the correct
|
||||
/// object id, i.e. file or group id.
|
||||
virtual hid_t getLocId() const = 0;
|
||||
|
||||
/// For subclasses, H5File and Group, to throw appropriate exception.
|
||||
virtual void throwException(const string func_name, const string msg) const = 0;
|
||||
|
||||
// Default constructor.
|
||||
CommonFG();
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~CommonFG();
|
||||
|
||||
private:
|
||||
// Common code for member functions openXxxType
|
||||
hid_t p_openDataType( const char* name ) const;
|
||||
hid_t p_open_data_type(const char* name) const;
|
||||
|
||||
}; // end of CommonFG declaration
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5Alltypes.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5DxferProp.h"
|
||||
@@ -31,19 +33,49 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Creates a new compound datatype
|
||||
CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {}
|
||||
|
||||
// Creates a compound datatype using an existing id
|
||||
CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {}
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType default constructor
|
||||
///\brief Default constructor: Creates a stub compound datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType::CompType() : DataType() {}
|
||||
|
||||
// Copy constructor: makes copy of the original CompType object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType copy constructor
|
||||
///\brief Copy constructor: makes copy of the original CompType object
|
||||
///\param original - IN: Original CompType instance
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType::CompType( const CompType& original ) : DataType( original ) {}
|
||||
|
||||
// Gets the compound datatype of the specified dataset - reimplement this
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType overloaded constructor
|
||||
///\brief Creates a CompType object using the id of an existing datatype.
|
||||
///\param existing_id - IN: Id of an existing compound datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType overloaded constructor
|
||||
///\brief Creates an empty compound datatype given a size, in bytes.
|
||||
///\param size - IN: Number of bytes in the datatype to create
|
||||
///\exception H5::DataTypeIException
|
||||
// Description
|
||||
// The DataType constructor calls the C API H5Tcreate to create
|
||||
// the compound datatype.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType overloaded constructor
|
||||
///\brief Gets the compound datatype of the specified dataset.
|
||||
///\param dataset - IN: Dataset that this enum datatype associates with
|
||||
///\return CompType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType::CompType( const DataSet& dataset ) : DataType()
|
||||
{
|
||||
// Calls C function H5Dget_type to get the id of the datatype
|
||||
@@ -56,7 +88,13 @@ CompType::CompType( const DataSet& dataset ) : DataType()
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the number of members in this compound datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getNmembers
|
||||
///\brief Returns the number of members in this compound datatype.
|
||||
///\return Number of members
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int CompType::getNmembers() const
|
||||
{
|
||||
int num_members = H5Tget_nmembers( id );
|
||||
@@ -68,7 +106,14 @@ int CompType::getNmembers() const
|
||||
return( num_members );
|
||||
}
|
||||
|
||||
// Retrieves the name of a member of this compound datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberName
|
||||
///\brief Returns the name of a member in this compound datatype.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return Name of member
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string CompType::getMemberName( int member_num ) const
|
||||
{
|
||||
char* member_name_C = H5Tget_member_name( id, member_num );
|
||||
@@ -82,20 +127,18 @@ string CompType::getMemberName( int member_num ) const
|
||||
return( member_name ); // return the member name string
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: getMemberIndex
|
||||
*
|
||||
* Purpose: Returns the index of a member in a compound data type.
|
||||
* Members are stored in no particular order with numbers 0
|
||||
* through N-1, where N is the value returned by the member
|
||||
* function getNmembers.
|
||||
*
|
||||
* Return: Success: index of the member if exists.
|
||||
* Failure: DataTypeIException
|
||||
*
|
||||
* BMR - May 16, 2002
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberIndex
|
||||
///\brief Returns the index of a member in this compound datatype.
|
||||
///\param name - IN: Name of the member
|
||||
///\return Index of member
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// Members are stored in no particular order with numbers 0
|
||||
/// through N-1, where N is the value returned by the member
|
||||
/// function \c CompType::getNmembers.
|
||||
// Programmer Binh-Minh Ribler - May 16, 2002
|
||||
//--------------------------------------------------------------------------
|
||||
int CompType::getMemberIndex(const char* name) const
|
||||
{
|
||||
int member_index = H5Tget_member_index(id, name);
|
||||
@@ -111,29 +154,25 @@ int CompType::getMemberIndex(const string& name) const
|
||||
return(getMemberIndex(name.c_str()));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: getMemberOffset
|
||||
*
|
||||
* Purpose: Returns the byte offset of the beginning of a member with
|
||||
* respect to the beginning of the compound data type datum.
|
||||
* Members are stored in no particular order with numbers 0
|
||||
* through N-1, where N is the value returned by the member
|
||||
* function getNmembers.
|
||||
*
|
||||
* Return: Success: Byte offset.
|
||||
* Failure: Quincey: for now, 0 is not a failure
|
||||
*
|
||||
* BMR - 2000
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberOffset
|
||||
///\brief Returns the byte offset of the beginning of a member with
|
||||
/// respect to the beginning of the compound data type datum.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return Byte offset
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Description
|
||||
/// Members are stored in no particular order with numbers 0
|
||||
/// through N-1, where N is the value returned by the member
|
||||
/// function \c CompType::getNmembers.
|
||||
//
|
||||
// Note that byte offset being returned as 0 doesn't indicate
|
||||
// a failure. (According to Quincey)
|
||||
//--------------------------------------------------------------------------
|
||||
size_t CompType::getMemberOffset( int member_num ) const
|
||||
{
|
||||
size_t offset = H5Tget_member_offset( id, member_num );
|
||||
//if( offset == 0 )
|
||||
//{
|
||||
//throw DataTypeIException("CompType::getMemberOffset",
|
||||
//"H5Tget_member_offset failed");
|
||||
//}
|
||||
return( offset );
|
||||
}
|
||||
|
||||
@@ -145,7 +184,14 @@ int CompType::getMemberDims( int member_num, size_t* dims, int* perm ) const
|
||||
// will complain
|
||||
}
|
||||
|
||||
// Gets the type class of the specified member.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberClass
|
||||
///\brief Gets the type class of the specified member.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return Type class of the member
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_class_t CompType::getMemberClass( int member_num ) const
|
||||
{
|
||||
// get the member datatype first
|
||||
@@ -170,7 +216,7 @@ H5T_class_t CompType::getMemberClass( int member_num ) const
|
||||
// of the specified member. It provides the id to construct appropriate
|
||||
// sub-types in the functions getMemberXxxType below, where Xxx indicates
|
||||
// the sub-types.
|
||||
hid_t CompType::p_getMemberType( int member_num ) const
|
||||
hid_t CompType::p_get_member_type(int member_num) const
|
||||
{
|
||||
// get the id of the specified member first
|
||||
hid_t member_type_id = H5Tget_member_type( id, member_num );
|
||||
@@ -178,82 +224,144 @@ hid_t CompType::p_getMemberType( int member_num ) const
|
||||
return( member_type_id );
|
||||
else
|
||||
{
|
||||
// p_getMemberType is private, use caller's function name for api
|
||||
// p_get_member_type is private, use caller's function name for api
|
||||
throw DataTypeIException("CompType::getMemberDataType",
|
||||
"H5Tget_member_type failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the datatype of the specified member in this compound datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberDataType
|
||||
///\brief Returns the generic datatype of the specified member in this
|
||||
/// compound datatype.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return DataType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType CompType::getMemberDataType( int member_num ) const
|
||||
{
|
||||
DataType datatype( p_getMemberType( member_num ));
|
||||
return( datatype );
|
||||
DataType datatype(p_get_member_type(member_num));
|
||||
return(datatype);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberDataType
|
||||
///\brief Returns the enumeration datatype of the specified member in
|
||||
/// this compound datatype.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return EnumType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType CompType::getMemberEnumType( int member_num ) const
|
||||
{
|
||||
EnumType enumtype( p_getMemberType( member_num ));
|
||||
return( enumtype );
|
||||
EnumType enumtype(p_get_member_type(member_num));
|
||||
return(enumtype);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberDataType
|
||||
///\brief Returns the compound datatype of the specified member in this
|
||||
/// compound datatype.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return CompType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType CompType::getMemberCompType( int member_num ) const
|
||||
{
|
||||
CompType comptype( p_getMemberType( member_num ));
|
||||
return( comptype );
|
||||
CompType comptype(p_get_member_type(member_num));
|
||||
return(comptype);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberDataType
|
||||
///\brief Returns the integer datatype of the specified member in this
|
||||
/// compound datatype.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return IntType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType CompType::getMemberIntType( int member_num ) const
|
||||
{
|
||||
IntType inttype( p_getMemberType( member_num ));
|
||||
return( inttype );
|
||||
IntType inttype(p_get_member_type(member_num));
|
||||
return(inttype);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberDataType
|
||||
///\brief Returns the floating-point datatype of the specified member
|
||||
/// in this compound datatype.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return FloatType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType CompType::getMemberFloatType( int member_num ) const
|
||||
{
|
||||
FloatType floatype( p_getMemberType( member_num ));
|
||||
return( floatype );
|
||||
FloatType floatype(p_get_member_type(member_num));
|
||||
return(floatype);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::getMemberDataType
|
||||
///\brief Returns the string datatype of the specified member in this
|
||||
/// compound datatype.
|
||||
///\param member_num - IN: Zero-based index of the member
|
||||
///\return StrType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType CompType::getMemberStrType( int member_num ) const
|
||||
{
|
||||
StrType strtype( p_getMemberType( member_num ));
|
||||
return( strtype );
|
||||
}
|
||||
StrType strtype(p_get_member_type(member_num));
|
||||
return(strtype);
|
||||
}
|
||||
|
||||
/* old style of getMemberType - using overloads; new style above
|
||||
returns the appropriate datatypes but has different named functions.
|
||||
In the old style, a datatype must be passed into the function.
|
||||
May, 2004: These should be reconsidered to provide more convenience.
|
||||
// Returns the datatype of the specified member in this compound datatype.
|
||||
// Several overloading of getMemberType are for different datatypes
|
||||
void CompType::getMemberType( int member_num, EnumType& enumtype ) const
|
||||
{
|
||||
p_getMemberType( member_num, enumtype );
|
||||
p_get_member_type(member_num, enumtype);
|
||||
}
|
||||
|
||||
void CompType::getMemberType( int member_num, CompType& comptype ) const
|
||||
{
|
||||
p_getMemberType( member_num, comptype );
|
||||
p_get_member_type(member_num, comptype);
|
||||
}
|
||||
|
||||
void CompType::getMemberType( int member_num, IntType& inttype ) const
|
||||
{
|
||||
p_getMemberType( member_num, inttype );
|
||||
p_get_member_type(member_num, inttype);
|
||||
}
|
||||
|
||||
void CompType::getMemberType( int member_num, FloatType& floatype ) const
|
||||
{
|
||||
p_getMemberType( member_num, floatype );
|
||||
p_get_member_type(member_num, floatype);
|
||||
}
|
||||
|
||||
void CompType::getMemberType( int member_num, StrType& strtype ) const
|
||||
{
|
||||
p_getMemberType( member_num, strtype );
|
||||
p_get_member_type(member_num, strtype);
|
||||
}
|
||||
// end of overloading of getMemberType
|
||||
*/
|
||||
|
||||
// Adds a new member to a compound datatype
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::insertMember
|
||||
///\brief Inserts a new member to this compound datatype.
|
||||
///\param name - IN: Name of the new member
|
||||
///\param offset - IN: Offset in memory structure of the field to insert
|
||||
///\param new_member - IN: New member to be inserted
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CompType::insertMember( const string& name, size_t offset, const DataType& new_member ) const
|
||||
{
|
||||
// Convert string to C-string
|
||||
@@ -270,7 +378,12 @@ void CompType::insertMember( const string& name, size_t offset, const DataType&
|
||||
}
|
||||
}
|
||||
|
||||
// Recursively removes padding from within a compound datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::pack
|
||||
///\brief Recursively removes padding from within a compound datatype.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CompType::pack() const
|
||||
{
|
||||
// Calls C routine H5Tpack to remove padding
|
||||
@@ -281,7 +394,11 @@ void CompType::pack() const
|
||||
}
|
||||
}
|
||||
|
||||
// This destructor just invokes the base-class' destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType destructor
|
||||
///\brief Properly terminates access to this compound datatype.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType::~CompType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -31,11 +31,13 @@ class H5_DLLCPP CompType : public DataType {
|
||||
// Gets the compound datatype of the specified dataset
|
||||
CompType( const DataSet& dataset ); // H5Dget_type
|
||||
|
||||
// Returns the number of members in this compound datatype.
|
||||
int getNmembers() const;
|
||||
// Returns the type class of the specified member of this compound
|
||||
// datatype. It provides to the user a way of knowing what type
|
||||
// to create another datatype of the same class
|
||||
H5T_class_t getMemberClass( int member_num ) const;
|
||||
|
||||
// Returns the name of a member of this compound datatype.
|
||||
string getMemberName( int member_num ) const;
|
||||
// Returns the dimensionality of the specified member.
|
||||
int getMemberDims( int member_num, size_t* dims, int* perm ) const;
|
||||
|
||||
// Returns the index of a member in this compound data type.
|
||||
int getMemberIndex(const char* name) const;
|
||||
@@ -44,13 +46,12 @@ class H5_DLLCPP CompType : public DataType {
|
||||
// Returns the offset of a member of this compound datatype.
|
||||
size_t getMemberOffset( int memb_no ) const;
|
||||
|
||||
// Returns the dimensionality of the specified member.
|
||||
int getMemberDims( int member_num, size_t* dims, int* perm ) const;
|
||||
// Returns the name of a member of this compound datatype.
|
||||
string getMemberName( int member_num ) const;
|
||||
|
||||
// Returns the type class of the specified member of this compound
|
||||
// datatype. It provides to the user a way of knowing what type
|
||||
// to create another datatype of the same class
|
||||
H5T_class_t getMemberClass( int member_num ) const;
|
||||
// Returns the compound datatype of the specified member in
|
||||
// this compound datatype.
|
||||
CompType getMemberCompType( int member_num ) const;
|
||||
|
||||
// Returns the generic datatype of the specified member in
|
||||
// this compound datatype.
|
||||
@@ -60,10 +61,6 @@ class H5_DLLCPP CompType : public DataType {
|
||||
// this compound datatype.
|
||||
EnumType getMemberEnumType( int member_num ) const;
|
||||
|
||||
// Returns the compound datatype of the specified member in
|
||||
// this compound datatype.
|
||||
CompType getMemberCompType( int member_num ) const;
|
||||
|
||||
// Returns the integer datatype of the specified member in
|
||||
// this compound datatype.
|
||||
IntType getMemberIntType( int member_num ) const;
|
||||
@@ -76,6 +73,9 @@ class H5_DLLCPP CompType : public DataType {
|
||||
// this compound datatype.
|
||||
StrType getMemberStrType( int member_num ) const;
|
||||
|
||||
// Returns the number of members in this compound datatype.
|
||||
int getNmembers() const;
|
||||
|
||||
// Adds a new member to this compound datatype.
|
||||
void insertMember( const string& name, size_t offset, const DataType& new_member ) const;
|
||||
|
||||
@@ -91,12 +91,13 @@ class H5_DLLCPP CompType : public DataType {
|
||||
// Copy constructor - makes a copy of original object
|
||||
CompType( const CompType& original );
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~CompType();
|
||||
|
||||
private:
|
||||
// Contains common code that is used by the member functions
|
||||
// getMemberXxxType
|
||||
hid_t p_getMemberType( int member_num ) const;
|
||||
hid_t p_get_member_type(int member_num) const;
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
#include "H5Object.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5Attribute.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DxferProp.h"
|
||||
#include "H5FaccProp.h"
|
||||
#include "H5FcreatProp.h"
|
||||
@@ -37,8 +38,9 @@
|
||||
#include "H5FloatType.h"
|
||||
#include "H5StrType.h"
|
||||
#include "H5CompType.h"
|
||||
#include "H5ArrayType.h"
|
||||
#include "H5VarLenType.h"
|
||||
#include "H5DataSet.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5Group.h"
|
||||
#include "H5File.h"
|
||||
#include "H5Library.h"
|
||||
|
||||
90
c++/src/H5CppDoc.h
Normal file
90
c++/src/H5CppDoc.h
Normal file
@@ -0,0 +1,90 @@
|
||||
// C++ informative line for the emacs editor: -*- C++ -*-
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5CPPDOC_H
|
||||
#define _H5CPPDOC_H
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// The following section will be used to generate the 'Mainpage'
|
||||
// and the 'Examples' for the RM.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/*! \mainpage notitle
|
||||
*
|
||||
* \section intro_sec Introduction
|
||||
*
|
||||
* The C++ API provides C++ wrappers for the HDF5 C library.
|
||||
* It is assumed that the user has knowledge of the HDF5 file format
|
||||
* and its components. If you are not familiar with HDF5 file format,
|
||||
* and would like to find out more, please refer to the HDF5 documentation
|
||||
* at http://hdf.ncsa.uiuc.edu/HDF5/doc/H5.intro.html
|
||||
*
|
||||
* Because the HDF5 library maps very well to
|
||||
* the object oriented design approach, classes in the C++ API can
|
||||
* closely represent the interfaces of the HDF5 APIs, as followed:
|
||||
*
|
||||
* \verbatim
|
||||
HDF5 C APIs C++ Classes
|
||||
----------- -----------
|
||||
Attribute Interface (H5A) Attribute
|
||||
Datasets Interface (H5D) DataSet
|
||||
Error Interface (H5E) Exception
|
||||
File Interface (H5F) H5File
|
||||
Group Interface (H5G) Group
|
||||
Identifier Interface (H5I) IdComponent
|
||||
Property List Interface (H5P) PropList and subclasses
|
||||
Dataspace Interface (H5S) DataSpace
|
||||
Datatype Interface (H5T) DataType and subclasses
|
||||
\endverbatim
|
||||
* \section install_sec Installation
|
||||
*
|
||||
* Please refer to the file release_docs/INSTALL_Windows_withcpp.txt
|
||||
* under the top directory for information about installing, building,
|
||||
* and testing the C++ API.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/// This example shows how to create datasets.
|
||||
///\par
|
||||
///\example create.cpp
|
||||
|
||||
///\par
|
||||
/// This example shows how to write datasets.
|
||||
///\example writedata.cpp
|
||||
|
||||
///\par
|
||||
/// This example shows how to read datasets.
|
||||
///\example readdata.cpp
|
||||
|
||||
///\par
|
||||
/// This example shows how to create a compound datatype,
|
||||
/// write an array which has the compound datatype to the file,
|
||||
/// and read back fields' subsets.
|
||||
///\example compound.cpp
|
||||
|
||||
///\par
|
||||
/// This example shows how to work with extendible datasets.
|
||||
///\example extend_ds.cpp
|
||||
|
||||
///\par
|
||||
/// This example shows how to read data from a chunked dataset.
|
||||
///\example chunks.cpp
|
||||
|
||||
///\par
|
||||
/// This example shows how to work with groups.
|
||||
///\example h5group.cpp
|
||||
|
||||
#endif
|
||||
@@ -28,8 +28,9 @@
|
||||
#include "H5Object.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5DxferProp.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5DataSet.h"
|
||||
@@ -38,17 +39,36 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet default constructor
|
||||
///\brief Default constructor: creates a stub DataSet.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::DataSet() : AbstractDs() {}
|
||||
|
||||
// Creates a copy of DataSet using an existing id
|
||||
DataSet::DataSet( const hid_t dataset_id ) : AbstractDs( dataset_id ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet overloaded constructor
|
||||
///\brief Creates an DataSet object using the id of an existing dataset.
|
||||
///\param existing_id - IN: Id of an existing dataset
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::DataSet(const hid_t existing_id) : AbstractDs(existing_id) {}
|
||||
|
||||
// Copy constructor makes a copy of the original object by using base
|
||||
// class' copy constructors
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original DataSet object.
|
||||
///\param original - IN: DataSet instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::DataSet( const DataSet& original ) : AbstractDs( original ) {}
|
||||
|
||||
// Gets a copy of the dataspace of this dataset
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getSpace
|
||||
///\brief Gets a copy of the dataspace of this dataset.
|
||||
///\return DataSpace instance
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace DataSet::getSpace() const
|
||||
{
|
||||
// Calls C function H5Dget_space to get the id of the dataspace
|
||||
@@ -67,7 +87,7 @@ DataSpace DataSet::getSpace() const
|
||||
// This private member function calls the C API to get the identifier
|
||||
// of the datatype that is used by this dataset. It is used
|
||||
// by the various AbstractDs functions to get the specific datatype.
|
||||
hid_t DataSet::p_getType() const
|
||||
hid_t DataSet::p_get_type() const
|
||||
{
|
||||
hid_t type_id = H5Dget_type( id );
|
||||
if( type_id > 0 )
|
||||
@@ -78,7 +98,13 @@ hid_t DataSet::p_getType() const
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the dataset creation property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getCreatePlist
|
||||
///\brief Gets the dataset creation property list.
|
||||
///\return DSetCreatPropList instance
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetCreatPropList DataSet::getCreatePlist() const
|
||||
{
|
||||
hid_t create_plist_id = H5Dget_create_plist( id );
|
||||
@@ -91,7 +117,13 @@ DSetCreatPropList DataSet::getCreatePlist() const
|
||||
return( create_plist );
|
||||
}
|
||||
|
||||
// Returns the amount of storage required for a dataset.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getStorageSize
|
||||
///\brief Returns the amount of storage required for a dataset.
|
||||
///\return Amount of storage
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t DataSet::getStorageSize() const
|
||||
{
|
||||
hsize_t storage_size = H5Dget_storage_size( id );
|
||||
@@ -104,27 +136,75 @@ hsize_t DataSet::getStorageSize() const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the number of bytes required to store VL data.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getOffset
|
||||
///\brief Returns the address of this dataset in the file.
|
||||
///\return Address of dataset
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
haddr_t DataSet::getOffset() const
|
||||
{
|
||||
haddr_t ds_addr; // for address of dataset
|
||||
|
||||
ds_addr = H5Dget_offset(id);
|
||||
if( ds_addr == HADDR_UNDEF )
|
||||
{
|
||||
throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF");
|
||||
}
|
||||
return(ds_addr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getSpaceStatus
|
||||
///\brief Determines whether space has been allocated for a dataset.
|
||||
///\param status - OUT: Space allocation status
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::getSpaceStatus(H5D_space_status_t& status) const
|
||||
{
|
||||
herr_t ret_value = H5Dget_space_status(id, &status);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getVlenBufSize
|
||||
///\brief Returns the number of bytes required to store VL data.
|
||||
///\return Amount of storage
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
//hid_t type_id = type.getId();
|
||||
//hid_t space_id = space.getId();
|
||||
//hsize_t size;
|
||||
hid_t type_id = type.getId();
|
||||
hid_t space_id = space.getId();
|
||||
|
||||
//herr_t ret_value = H5Dget_vlen_buf_size( id, type_id, space_id, &size );
|
||||
//if( ret_value >= 0 )
|
||||
// return( size );
|
||||
//else
|
||||
//{
|
||||
//throw DataSetIException();
|
||||
//}
|
||||
throw DataSetIException( "DataSet::getVlenBufSize",
|
||||
"Currently not implemented yet.");
|
||||
return (0);
|
||||
hsize_t size; // for amount of storage
|
||||
|
||||
herr_t ret_value = H5Dvlen_get_buf_size( id, type_id, space_id, &size );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw DataSetIException("DataSet::getStorageSize", "H5Dget_storage_size failed");
|
||||
}
|
||||
return( size );
|
||||
}
|
||||
|
||||
// Reclaims VL datatype memory buffers.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getVlenBufSize
|
||||
///\brief Reclaims VL datatype memory buffers.
|
||||
///\param type - IN: Datatype, which is the datatype stored in the buffer
|
||||
///\param space - IN: Selection for the memory buffer to free the
|
||||
/// VL datatypes within
|
||||
///\param xfer_plist - IN: Property list used to create the buffer
|
||||
///\param buf - IN: Pointer to the buffer to be reclaimed
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::vlenReclaim( DataType& type, DataSpace& space, DSetMemXferPropList& xfer_plist, void* buf ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
@@ -139,8 +219,21 @@ void DataSet::vlenReclaim( DataType& type, DataSpace& space, DSetMemXferPropList
|
||||
}
|
||||
}
|
||||
|
||||
// Reads raw data from the specified dataset into buf, converting from
|
||||
// file datatype and dataspace to memory datatype and dataspace.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::read
|
||||
///\brief Reads raw data from the specified dataset.
|
||||
///\param buf - IN: Buffer for read data
|
||||
///\param mem_type - IN: Memory datatype
|
||||
///\param mem_space - IN: Memory dataspace
|
||||
///\param file_space - IN: Dataset's dataspace in the file
|
||||
///\param xfer_plist - IN: Transfer property list for this I/O operation
|
||||
///\exception H5::DataSetIException
|
||||
///\par Description
|
||||
/// This function reads raw data from this dataset into the
|
||||
/// buffer \a buf, converting from file datatype and dataspace
|
||||
/// to memory datatype \a mem_type and dataspace \a mem_space.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
@@ -156,6 +249,12 @@ void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_sp
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::read
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes a reference to a \c std::string for the buffer.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::read( string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
|
||||
{
|
||||
// Allocate C character string for reading
|
||||
@@ -170,9 +269,22 @@ void DataSet::read( string& strg, const DataType& mem_type, const DataSpace& mem
|
||||
delete strg_C;
|
||||
}
|
||||
|
||||
// Writes raw data from an application buffer buffer to a dataset,
|
||||
// converting from memory datatype and dataspace to file datatype
|
||||
// and dataspace.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::write
|
||||
///\brief Writes raw data from an application buffer to a dataset.
|
||||
///\param buf - IN: Buffer containing data to be written
|
||||
///\param mem_type - IN: Memory datatype
|
||||
///\param mem_space - IN: Memory dataspace
|
||||
///\param file_space - IN: Dataset's dataspace in the file
|
||||
///\param xfer_plist - IN: Transfer property list for this I/O operation
|
||||
///\exception H5::DataSetIException
|
||||
///\par Description
|
||||
/// This function writes raw data from an application buffer
|
||||
/// \a buf to a dataset, converting from memory datatype
|
||||
/// \a mem_type and dataspace \a mem_space to file datatype
|
||||
/// and dataspace.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
@@ -188,6 +300,12 @@ void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace&
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::write
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes a reference to a \c std::string for the buffer.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::write( const string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
|
||||
{
|
||||
// Convert string to C-string
|
||||
@@ -198,7 +316,23 @@ void DataSet::write( const string& strg, const DataType& mem_type, const DataSpa
|
||||
write(strg_C, mem_type, mem_space, file_space, xfer_plist);
|
||||
}
|
||||
|
||||
// Iterates over all selected elements in a dataspace.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::iterateElems
|
||||
///\brief Iterates over all selected elements in a dataspace.
|
||||
///\param buf - IN/OUT: Pointer to the buffer in memory containing the
|
||||
/// elements to iterate over
|
||||
///\param type - IN: Datatype for the elements stored in \a buf
|
||||
///\param space - IN: Dataspace for \a buf. Also contains the selection
|
||||
/// to iterate over.
|
||||
///\param op - IN: Function pointer to the routine to be called for
|
||||
/// each element in \a buf iterated over
|
||||
///\param op_data - IN/OUT: Pointer to any user-defined data associated
|
||||
/// with the operation
|
||||
///\exception H5::DataSetIException
|
||||
///\note This function may not work correctly yet - it's still
|
||||
/// under development.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data )
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
@@ -213,7 +347,17 @@ int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& spa
|
||||
}
|
||||
}
|
||||
|
||||
// Extends a dataset with unlimited dimension.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::extend
|
||||
///\brief Extends a dataset with unlimited dimension.
|
||||
///\param size - IN: Array containing the new magnitude of each dimension
|
||||
///\exception H5::DataSetIException
|
||||
///\par Description
|
||||
/// For more information, please see the Description section in
|
||||
/// C layer Reference Manual at:
|
||||
/// http:
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::extend( const hsize_t* size ) const
|
||||
{
|
||||
herr_t ret_value = H5Dextend( id, size );
|
||||
@@ -223,25 +367,17 @@ void DataSet::extend( const hsize_t* size ) const
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
NAME
|
||||
fillMemBuf
|
||||
PURPOSE
|
||||
Fills a selection in memory with a value
|
||||
USAGE
|
||||
fillMemBuf(fill, fill_type, buf, buf_type, space)
|
||||
fillMemBuf(buf, buf_type, space)
|
||||
void *buf; IN/OUT: Memory buffer to fill selection within
|
||||
DataType& buf_type; IN: Datatype of the elements in buffer
|
||||
DataSpace& space; IN: Dataspace describing memory buffer &
|
||||
containing selection to use.
|
||||
const void *fill; IN: Pointer to fill value to use - default NULL
|
||||
DataType& fill_type; IN: Datatype of the fill value
|
||||
DESCRIPTION
|
||||
Use the selection in the dataspace to fill elements in a memory buffer.
|
||||
COMMENTS, BUGS, ASSUMPTIONS
|
||||
Second usage uses all zeros as fill value
|
||||
--------------------------------------------------------------------------*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::fillMemBuf
|
||||
///\brief Fills a selection in memory with a value.
|
||||
///\param fill - IN: Pointer to fill value to use - default NULL
|
||||
///\param fill_type - IN: Datatype of the fill value
|
||||
///\param buf - IN/OUT: Memory buffer to fill selection within
|
||||
///\param buf_type - IN: Datatype of the elements in buffer
|
||||
///\param space - IN: Dataspace describing memory buffer & containing selection to use
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space)
|
||||
{
|
||||
hid_t fill_type_id = fill_type.getId();
|
||||
@@ -253,6 +389,18 @@ void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataT
|
||||
throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::fillMemBuf
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it only takes the
|
||||
/// the last three arguments.
|
||||
///\param buf - IN/OUT: Memory buffer to fill selection within
|
||||
///\param buf_type - IN: Datatype of the elements in buffer
|
||||
///\param space - IN: Dataspace describing memory buffer & containing selection to use
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space)
|
||||
{
|
||||
hid_t buf_type_id = buf_type.getId();
|
||||
@@ -264,8 +412,84 @@ void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space)
|
||||
}
|
||||
}
|
||||
|
||||
// This private function calls the C API H5Dclose to close this dataset.
|
||||
// Used by IdComponent::reset
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::Reference
|
||||
///\brief Creates a reference to an HDF5 object or a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* DataSet::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
return(p_reference(name, dataspace.getId(), ref_type));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::Reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it only creates
|
||||
/// a reference to an HDF5 object, not to a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
///\par Description
|
||||
// This function passes H5R_OBJECT and -1 to the protected
|
||||
// function for it to pass to the C API H5Rcreate
|
||||
// to create a reference to the named object.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* DataSet::Reference(const char* name) const
|
||||
{
|
||||
return(p_reference(name, -1, H5R_OBJECT));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref_type - IN: Type of reference to query
|
||||
///\param ref - IN: Reference to query
|
||||
// Return An object type, which can be one of the following:
|
||||
// H5G_LINK Object is a symbolic link.
|
||||
// H5G_GROUP Object is a group.
|
||||
// H5G_DATASET Object is a dataset.
|
||||
// H5G_TYPE Object is a named datatype
|
||||
// Exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t DataSet::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
/// to H5R_DATASET_REGION
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\return DataSpace instance
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace DataSet::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::p_close (private)
|
||||
// Purpose: Closes this dataset.
|
||||
// Exception H5::DataSetIException
|
||||
// Description
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer. - May, 2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::p_close() const
|
||||
{
|
||||
herr_t ret_value = H5Dclose( id );
|
||||
@@ -274,17 +498,18 @@ void DataSet::p_close() const
|
||||
throw DataSetIException(0, "H5Dclose failed");
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// The destructor of this instance calls IdComponent::reset to
|
||||
// reset its identifier - no longer true
|
||||
// Older compilers (baldric) don't support template member functions
|
||||
// and IdComponent::reset is one; so at this time, the resetId is not
|
||||
// a member function so it can be template to work around that problem.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet destructor
|
||||
///\brief Properly terminates access to this dataset.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::~DataSet()
|
||||
{
|
||||
// The dataset id will be closed properly
|
||||
try {
|
||||
resetIdComponent( this ); }
|
||||
resetIdComponent( this ); }
|
||||
catch (Exception close_error) { // thrown by p_close
|
||||
cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl;
|
||||
}
|
||||
|
||||
@@ -24,12 +24,26 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP DataSet : public AbstractDs {
|
||||
public:
|
||||
// Gets the dataspace of this dataset.
|
||||
virtual DataSpace getSpace() const;
|
||||
// Extends the dataset with unlimited dimension.
|
||||
void extend( const hsize_t* size ) const;
|
||||
|
||||
// Fills a selection in memory with a value
|
||||
void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space);
|
||||
// Fills a selection in memory with zero
|
||||
void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space);
|
||||
|
||||
// Gets the creation property list of this dataset.
|
||||
DSetCreatPropList getCreatePlist() const;
|
||||
|
||||
// Returns the address of this dataset in the file.
|
||||
haddr_t getOffset() const;
|
||||
|
||||
// Gets the dataspace of this dataset.
|
||||
virtual DataSpace getSpace() const;
|
||||
|
||||
// Determines whether space has been allocated for a dataset.
|
||||
void getSpaceStatus(H5D_space_status_t& status) const;
|
||||
|
||||
// Gets the storage size of this dataset.
|
||||
hsize_t getStorageSize() const;
|
||||
|
||||
@@ -52,28 +66,34 @@ class H5_DLLCPP DataSet : public AbstractDs {
|
||||
// Iterates the selected elements in the specified dataspace - not implemented in C++ style yet
|
||||
int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL );
|
||||
|
||||
// Extends the dataset with unlimited dimension.
|
||||
void extend( const hsize_t* size ) const;
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
// Fills a selection in memory with a value
|
||||
void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space);
|
||||
// Fills a selection in memory with zero
|
||||
void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space);
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Creates a copy of an existing DataSet using its id
|
||||
// Note: used by CommonFG to return a DataSet; should be modified
|
||||
// to use friend template function instead)
|
||||
DataSet( const hid_t dataset_id );
|
||||
// Creates a reference to a named Hdf5 object or to a dataset region
|
||||
// in this object.
|
||||
void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Used by the API to appropriately close a dataset
|
||||
// Creates a reference to a named Hdf5 object in this object.
|
||||
void* Reference(const char* name) const;
|
||||
|
||||
// Creates a copy of an existing DataSet using its id.
|
||||
DataSet(const hid_t existing_id);
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Used by the API to appropriately close a dataset.
|
||||
virtual void p_close() const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Default constructor
|
||||
// Default constructor.
|
||||
DataSet();
|
||||
|
||||
// Copy constructor
|
||||
// Copy constructor.
|
||||
DataSet( const DataSet& original );
|
||||
|
||||
// Destructor: properly terminates access to this dataset.
|
||||
virtual ~DataSet();
|
||||
|
||||
private:
|
||||
@@ -81,7 +101,7 @@ class H5_DLLCPP DataSet : public AbstractDs {
|
||||
// getTypeClass and various API functions getXxxType
|
||||
// defined in AbstractDs for generic datatype and specific
|
||||
// sub-types
|
||||
virtual hid_t p_getType() const;
|
||||
virtual hid_t p_get_type() const;
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#endif
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5RefCounter.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5Idtemplates.h"
|
||||
#include "H5DataSpace.h"
|
||||
@@ -30,12 +30,20 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default dataspace.
|
||||
//--------------------------------------------------------------------------
|
||||
const DataSpace DataSpace::ALL( H5S_ALL );
|
||||
|
||||
// Default constructor
|
||||
DataSpace::DataSpace() : IdComponent() {}
|
||||
|
||||
// This constructor creates a DataSpace instance, given a dataspace type
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace constructor
|
||||
///\brief Creates a new dataspace given a dataspace type.
|
||||
///\param type - IN: Type of the dataspace to be created, which
|
||||
/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE;
|
||||
/// default to \c H5S_SCALAR.
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace::DataSpace( H5S_class_t type ) : IdComponent()
|
||||
{
|
||||
id = H5Screate( type );
|
||||
@@ -45,7 +53,15 @@ DataSpace::DataSpace( H5S_class_t type ) : IdComponent()
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a new simple data space and opens it for access.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace overloaded constructor
|
||||
///\brief Creates a new simple dataspace.
|
||||
///\param rank - IN: Number of dimensions of dataspace.
|
||||
///\param dims - IN: An array of the size of each dimension.
|
||||
///\param maxdims - IN: An array of the maximum size of each dimension.
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent()
|
||||
{
|
||||
id = H5Screate_simple( rank, dims, maxdims );
|
||||
@@ -55,51 +71,76 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) :
|
||||
}
|
||||
}
|
||||
|
||||
/* Constructor that takes an existing dataspace id
|
||||
Description:
|
||||
Uses an HDF5 id to create a DataSpace identifier instance.
|
||||
This id can be either an existing dataspace id or a default
|
||||
dataspace id. Design note: in the case of default dataspace,
|
||||
the identifier still has reference counter; the p_close function
|
||||
will take care of not to call H5Sclose on the default id.
|
||||
*/
|
||||
DataSpace::DataSpace( const hid_t space_id ) : IdComponent( space_id ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace overloaded constructor
|
||||
///\brief Creates a DataSpace object using the id of an existing
|
||||
/// dataspace.
|
||||
///\param existing_id - IN: Id of an existing dataspace
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace::DataSpace(const hid_t existing_id) : IdComponent(existing_id) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original DataSpace instance
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original DataSpace object.
|
||||
///\param original - IN: DataSpace object to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace::DataSpace( const DataSpace& original ) : IdComponent( original ) {}
|
||||
|
||||
// Makes a copy of an existing dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::copy
|
||||
///\brief Makes a copy of an existing dataspace.
|
||||
///\param like_space - IN: Dataspace to be copied
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::copy( const DataSpace& like_space )
|
||||
{
|
||||
// reset the identifier of this instance - send 'this' in so that
|
||||
// reset the identifier of this object - send 'this' in so that
|
||||
// H5Sclose can be called appropriately
|
||||
try {
|
||||
resetIdComponent( this ); }
|
||||
catch (Exception close_error) { // thrown by p_close
|
||||
throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg());
|
||||
}
|
||||
try {
|
||||
resetIdComponent( this ); }
|
||||
catch (Exception close_error) { // thrown by p_close
|
||||
throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg());
|
||||
}
|
||||
|
||||
// call C routine to copy the dataspace
|
||||
id = H5Scopy( like_space.getId() );
|
||||
|
||||
// new ref counter for this id
|
||||
// new ref counter for this id
|
||||
ref_count = new RefCounter;
|
||||
|
||||
if( id <= 0 )
|
||||
{
|
||||
throw DataSpaceIException("DataSpace::copy", "H5Scopy failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Makes a copy of the dataspace on the right hand side and stores
|
||||
// the new id in the left hand side object.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::operator=
|
||||
///\brief Assignment operator.
|
||||
///\param rhs - IN: Reference to the existing dataspace
|
||||
///\return Reference to DataSpace instance
|
||||
///\exception H5::DataSpaceIException
|
||||
// Description
|
||||
// Makes a copy of the type on the right hand side and stores
|
||||
// the new id in the left hand side object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace& DataSpace::operator=( const DataSpace& rhs )
|
||||
{
|
||||
copy(rhs);
|
||||
return(*this);
|
||||
}
|
||||
|
||||
// Determines whether this dataspace is a simple dataspace.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::isSimple
|
||||
///\brief Determines whether this dataspace is a simple dataspace.
|
||||
///\return \c true if the dataspace is a simple dataspace, and \c false,
|
||||
/// otherwise
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool DataSpace::isSimple () const
|
||||
{
|
||||
htri_t simple = H5Sis_simple( id );
|
||||
@@ -114,7 +155,18 @@ bool DataSpace::isSimple () const
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the offset of this simple dataspace.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::offsetSimple
|
||||
///\brief Sets the offset of this simple dataspace.
|
||||
///\param offset - IN: Offset to position the selection at
|
||||
///\exception H5::DataSpaceIException
|
||||
///\par Description
|
||||
/// This function creates an offset for the selection within
|
||||
/// an extent, allowing the same shaped selection to be moved
|
||||
/// to different locations within a dataspace without requiring
|
||||
/// it to be re-defined.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::offsetSimple ( const hssize_t* offset ) const
|
||||
{
|
||||
herr_t ret_value = H5Soffset_simple( id, offset );
|
||||
@@ -124,7 +176,16 @@ void DataSpace::offsetSimple ( const hssize_t* offset ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves dataspace dimension size and maximum size
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSimpleExtentDims
|
||||
///\brief Retrieves dataspace dimension size and maximum size.
|
||||
///\param dims - IN: Name of the new member
|
||||
///\param maxdims - IN: Pointer to the value of the new member
|
||||
///\return Number of dimensions, the same value as returned by
|
||||
/// \c DataSpace::getSimpleExtentNdims()
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const
|
||||
{
|
||||
int ndims = H5Sget_simple_extent_dims( id, dims, maxdims );
|
||||
@@ -136,7 +197,13 @@ int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const
|
||||
return( ndims );
|
||||
}
|
||||
|
||||
// Determines the dimensionality of a dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSimpleExtentNdims
|
||||
///\brief Returns the dimensionality of a dataspace.
|
||||
///\return Number of dimensions
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int DataSpace::getSimpleExtentNdims () const
|
||||
{
|
||||
int ndims = H5Sget_simple_extent_ndims( id );
|
||||
@@ -148,10 +215,17 @@ int DataSpace::getSimpleExtentNdims () const
|
||||
return( ndims );
|
||||
}
|
||||
|
||||
// Determines the number of elements in a dataspace
|
||||
// 12/05/00: due to C API change
|
||||
// return type hssize_t vs. hsize_t
|
||||
// num_elements = -1 when failure occurs vs. 0
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSimpleExtentNpoints
|
||||
///\brief Returns the number of elements in a dataspace.
|
||||
///\return Number of elements
|
||||
///\exception H5::DataSpaceIException
|
||||
// Modification
|
||||
// 12/05/00: due to C API change
|
||||
// return type hssize_t vs. hsize_t
|
||||
// num_elements = -1 when failure occurs vs. 0
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hssize_t DataSpace::getSimpleExtentNpoints () const
|
||||
{
|
||||
hssize_t num_elements = H5Sget_simple_extent_npoints( id );
|
||||
@@ -165,7 +239,13 @@ hssize_t DataSpace::getSimpleExtentNpoints () const
|
||||
}
|
||||
}
|
||||
|
||||
// Determine the current class of a dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSimpleExtentType
|
||||
///\brief Returns the current class of a dataspace.
|
||||
///\return Class of the dataspace
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5S_class_t DataSpace::getSimpleExtentType () const
|
||||
{
|
||||
H5S_class_t class_name = H5Sget_simple_extent_type( id );
|
||||
@@ -177,7 +257,13 @@ H5S_class_t DataSpace::getSimpleExtentType () const
|
||||
return( class_name );
|
||||
}
|
||||
|
||||
// Copies the extent of a dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::extentCopy
|
||||
///\brief Copies the extent of a dataspace.
|
||||
///\param dest_space - IN: Dataspace to copy from
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::extentCopy ( DataSpace& dest_space ) const
|
||||
{
|
||||
hid_t dest_space_id = dest_space.getId();
|
||||
@@ -188,7 +274,15 @@ void DataSpace::extentCopy ( DataSpace& dest_space ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Sets or resets the size of an existing dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::setExtentSimple
|
||||
///\brief Sets or resets the size of an existing dataspace.
|
||||
///\param rank - IN: Rank of the dataspace
|
||||
///\param current_size - IN: Array containing current size of dataspace
|
||||
///\param maximum_size - IN: Array containing maximum size of dataspace
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size ) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
@@ -199,7 +293,12 @@ void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hs
|
||||
}
|
||||
}
|
||||
|
||||
// Removes the extent from a dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::setExtentNone
|
||||
///\brief Removes the extent from a dataspace.
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::setExtentNone () const
|
||||
{
|
||||
herr_t ret_value = H5Sset_extent_none( id );
|
||||
@@ -209,7 +308,13 @@ void DataSpace::setExtentNone () const
|
||||
}
|
||||
}
|
||||
|
||||
// Determines the number of elements in a dataspace selection
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSelectNpoints
|
||||
///\brief Returns the number of elements in a dataspace selection.
|
||||
///\return Number of elements
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hssize_t DataSpace::getSelectNpoints () const
|
||||
{
|
||||
hssize_t num_elements = H5Sget_select_npoints( id );
|
||||
@@ -221,7 +326,13 @@ hssize_t DataSpace::getSelectNpoints () const
|
||||
return( num_elements );
|
||||
}
|
||||
|
||||
// Get number of hyperslab blocks
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSelectHyperNblocks
|
||||
///\brief Returns number of hyperslab blocks.
|
||||
///\return Number of hyperslab blocks
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hssize_t DataSpace::getSelectHyperNblocks () const
|
||||
{
|
||||
hssize_t num_blocks = H5Sget_select_hyper_nblocks( id );
|
||||
@@ -233,7 +344,15 @@ hssize_t DataSpace::getSelectHyperNblocks () const
|
||||
return( num_blocks );
|
||||
}
|
||||
|
||||
// Gets the list of hyperslab blocks currently selected
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSelectHyperBlocklist
|
||||
///\brief Gets the list of hyperslab blocks currently selected
|
||||
///\param startblock - IN: Hyperslab block to start with
|
||||
///\param numblocks - IN: Number of hyperslab blocks to get
|
||||
///\param buf - IN: List of hyperslab blocks selected
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
@@ -245,7 +364,13 @@ void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks,
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the number of element points in the current selection
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSelectElemNpoints
|
||||
///\brief Returns the number of element points in the current selection.
|
||||
///\return Number of element points
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hssize_t DataSpace::getSelectElemNpoints () const
|
||||
{
|
||||
hssize_t num_points = H5Sget_select_elem_npoints( id );
|
||||
@@ -257,7 +382,19 @@ hssize_t DataSpace::getSelectElemNpoints () const
|
||||
return( num_points );
|
||||
}
|
||||
|
||||
// Gets the list of element points currently selected
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSelectElemPointlist
|
||||
///\brief Gets the list of element points currently selected
|
||||
///\param startpoint - IN: Element point to start with
|
||||
///\param numpoints - IN: Number of element points to get
|
||||
///\param buf - IN: List of element points selected
|
||||
///\exception H5::DataSpaceIException
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectElemPointList
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
@@ -269,7 +406,19 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints,
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the bounding box containing the current selection
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getSelectBounds
|
||||
///\brief Gets the bounding box containing the current selection.
|
||||
///\param start - IN: Starting coordinates of the bounding box
|
||||
///\param end - IN: Ending coordinates of the bounding box, i.e.,
|
||||
/// the coordinates of the diagonally opposite corner
|
||||
///\exception H5::DataSpaceIException
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectBounds
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::getSelectBounds ( hssize_t* start, hssize_t* end ) const
|
||||
{
|
||||
herr_t ret_value = H5Sget_select_bounds( id, start, end );
|
||||
@@ -280,7 +429,22 @@ void DataSpace::getSelectBounds ( hssize_t* start, hssize_t* end ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Selects array elements to be included in the selection for a dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::H5Sselect_elements
|
||||
///\brief Selects array elements to be included in the selection for
|
||||
/// this dataspace.
|
||||
///\param op - IN: Operator specifying how the new selection is to be
|
||||
/// combined with the existing selection for the dataspace
|
||||
///\param num_elements - IN: Number of elements to be selected
|
||||
///\param coord - IN: A 2-dimensional array of 0-based values
|
||||
/// specifying the coordinates of the elements being selected
|
||||
///\exception H5::DataSpaceIException
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectElements
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hssize_t *coord[ ] ) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
@@ -292,7 +456,12 @@ void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, co
|
||||
}
|
||||
}
|
||||
|
||||
// Selects the entire dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::selectAll
|
||||
///\brief Selects the entire dataspace.
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::selectAll () const
|
||||
{
|
||||
herr_t ret_value = H5Sselect_all( id );
|
||||
@@ -302,7 +471,12 @@ void DataSpace::selectAll () const
|
||||
}
|
||||
}
|
||||
|
||||
//Resets the selection region to include no elements
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::selectNone
|
||||
///\brief Resets the selection region to include no elements.
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::selectNone () const
|
||||
{
|
||||
herr_t ret_value = H5Sselect_none( id );
|
||||
@@ -313,7 +487,15 @@ void DataSpace::selectNone () const
|
||||
}
|
||||
}
|
||||
|
||||
// Verifies that the selection is within the extent of the dataspace
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::selectValid
|
||||
///\brief Verifies that the selection is within the extent of the
|
||||
/// dataspace.
|
||||
///\return \c true if the selection is within the extent of the
|
||||
/// dataspace, and \c false, otherwise
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool DataSpace::selectValid () const
|
||||
{
|
||||
htri_t ret_value = H5Sselect_valid( id );
|
||||
@@ -328,7 +510,21 @@ bool DataSpace::selectValid () const
|
||||
}
|
||||
}
|
||||
|
||||
// Selects a hyperslab region to add to the current selected region
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::selectHyperslab
|
||||
///\brief Selects a hyperslab region to add to the current selected region.
|
||||
///\param op - IN: Operation to perform on current selection
|
||||
///\param count - IN: Offset of the start of hyperslab
|
||||
///\param start - IN: Number of blocks included in the hyperslab
|
||||
///\param stride - IN: Hyperslab stride
|
||||
///\param block - IN: Size of block in the hyperslab
|
||||
///\exception H5::DataSpaceIException
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hssize_t *start, const hsize_t *stride, const hsize_t *block ) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
@@ -340,7 +536,16 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h
|
||||
}
|
||||
}
|
||||
|
||||
// Closes the dataspace if it is not a constant
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::p_close (private)
|
||||
// Purpose: Closes the dataspace if it is not a constant.
|
||||
// Exception H5::DataSpaceIException
|
||||
// Description
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer. - May, 2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::p_close() const
|
||||
{
|
||||
hid_t space_id = id;
|
||||
@@ -353,12 +558,13 @@ void DataSpace::p_close() const
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// The destructor of this instance calls IdComponent::reset to
|
||||
// reset its identifier - no longer true
|
||||
// Older compilers (baldric) don't support template member functions
|
||||
// and IdComponent::reset is one; so at this time, the resetId is not
|
||||
// a member function so it can be template to work around that problem.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace destructor
|
||||
///\brief Properly terminates access to this dataspace.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace::~DataSpace()
|
||||
{
|
||||
// The dataspace id will be closed properly
|
||||
|
||||
@@ -26,22 +26,37 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
static const DataSpace ALL;
|
||||
|
||||
// Creates a dataspace object given the space type
|
||||
DataSpace( H5S_class_t type ); // H5Screate
|
||||
DataSpace(H5S_class_t type = H5S_SCALAR);
|
||||
|
||||
// Creates a simple dataspace
|
||||
DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); // H5Screate_simple
|
||||
|
||||
// Makes copy of an existing dataspace.
|
||||
void copy( const DataSpace& like_space ); // H5Scopy
|
||||
DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL);
|
||||
|
||||
// Assignment operator
|
||||
DataSpace& operator=( const DataSpace& rhs );
|
||||
|
||||
// Determines if this dataspace is a simple one.
|
||||
bool isSimple() const;
|
||||
// Makes copy of an existing dataspace.
|
||||
void copy(const DataSpace& like_space);
|
||||
|
||||
// Sets the offset of this simple dataspace.
|
||||
void offsetSimple( const hssize_t* offset ) const;
|
||||
// Copies the extent of this dataspace.
|
||||
void extentCopy( DataSpace& dest_space ) const;
|
||||
|
||||
// Gets the bounding box containing the current selection.
|
||||
void getSelectBounds( hssize_t* start, hssize_t* end ) const;
|
||||
|
||||
// Gets the number of element points in the current selection.
|
||||
hssize_t getSelectElemNpoints() const;
|
||||
|
||||
// Retrieves the list of element points currently selected.
|
||||
void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const;
|
||||
|
||||
// Gets the list of hyperslab blocks currently selected.
|
||||
void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const;
|
||||
|
||||
// Get number of hyperslab blocks.
|
||||
hssize_t getSelectHyperNblocks() const;
|
||||
|
||||
// Gets the number of elements in this dataspace selection.
|
||||
hssize_t getSelectNpoints() const;
|
||||
|
||||
// Retrieves dataspace dimension size and maximum size.
|
||||
int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const;
|
||||
@@ -56,39 +71,21 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
// Gets the current class of this dataspace.
|
||||
H5S_class_t getSimpleExtentType() const;
|
||||
|
||||
// Copies the extent of this dataspace.
|
||||
void extentCopy( DataSpace& dest_space ) const;
|
||||
// Determines if this dataspace is a simple one.
|
||||
bool isSimple() const;
|
||||
|
||||
// Sets or resets the size of this dataspace.
|
||||
void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const;
|
||||
// Sets the offset of this simple dataspace.
|
||||
void offsetSimple( const hssize_t* offset ) const;
|
||||
|
||||
// Removes the extent from this dataspace.
|
||||
void setExtentNone() const;
|
||||
|
||||
// Gets the number of elements in this dataspace selection.
|
||||
hssize_t getSelectNpoints() const;
|
||||
|
||||
// Get number of hyperslab blocks.
|
||||
hssize_t getSelectHyperNblocks() const;
|
||||
|
||||
// Gets the list of hyperslab blocks currently selected.
|
||||
void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const;
|
||||
|
||||
// Gets the number of element points in the current selection.
|
||||
hssize_t getSelectElemNpoints() const;
|
||||
|
||||
// Retrieves the list of element points currently selected.
|
||||
void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const;
|
||||
|
||||
// Gets the bounding box containing the current selection.
|
||||
void getSelectBounds( hssize_t* start, hssize_t* end ) const;
|
||||
// Selects the entire dataspace.
|
||||
void selectAll() const;
|
||||
|
||||
// Selects array elements to be included in the selection for
|
||||
// this dataspace.
|
||||
void selectElements( H5S_seloper_t op, const size_t num_elements, const hssize_t *coord[ ] ) const;
|
||||
|
||||
// Selects the entire dataspace.
|
||||
void selectAll() const;
|
||||
// Selects a hyperslab region to add to the current selected region.
|
||||
void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hssize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const;
|
||||
|
||||
// Resets the selection region to include no elements.
|
||||
void selectNone() const;
|
||||
@@ -96,22 +93,24 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
// Verifies that the selection is within the extent of the dataspace.
|
||||
bool selectValid() const;
|
||||
|
||||
// Selects a hyperslab region to add to the current selected region.
|
||||
void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hssize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const;
|
||||
// Removes the extent from this dataspace.
|
||||
void setExtentNone() const;
|
||||
|
||||
// Uses an existing dataspace identifier to make a DataSpace object
|
||||
// or uses a default id to create a default dataspace object
|
||||
DataSpace( const hid_t space_id );
|
||||
// Sets or resets the size of this dataspace.
|
||||
void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const;
|
||||
|
||||
// Used by the API to close the dataspace
|
||||
void p_close() const;
|
||||
|
||||
// Default constructor
|
||||
DataSpace();
|
||||
// Creates a DataSpace object using an existing dataspace id.
|
||||
DataSpace(const hid_t space_id);
|
||||
|
||||
// Copy constructor: makes a copy of the original DataSpace object.
|
||||
DataSpace( const DataSpace& original );
|
||||
DataSpace(const DataSpace& original);
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Used by the API to close the dataspace
|
||||
void p_close() const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Destructor: properly terminates access to this dataspace.
|
||||
virtual ~DataSpace();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5Idtemplates.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5AtomType.h"
|
||||
#include "H5PredType.h"
|
||||
@@ -35,14 +38,31 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Constructor creates a copy of an existing DataType using its id.
|
||||
// 'predefined' is default to false; when a default datatype is
|
||||
// created, this argument is set to true so H5Tclose will not be
|
||||
// called on it later.
|
||||
DataType::DataType( const hid_t existing_id, bool predefined ) : H5Object( existing_id ), is_predtype( predefined ) {
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType overloaded constructor
|
||||
///\brief Creates a datatype using an existing datatype's id
|
||||
///\param existing_id - IN: Id of the existing datatype
|
||||
///\param predefined - IN: Indicates whether or not this datatype is
|
||||
/// a predefined datatype; default to \c false
|
||||
// Description
|
||||
// Constructor creates a copy of an existing DataType using
|
||||
// its id. The argument "predefined" is default to false;
|
||||
// when a default datatype is created, this argument is set
|
||||
// to true so H5Tclose will not be called on it later. - need
|
||||
// a reassessment after changing to the new ref counting mech.
|
||||
// - BMR 5/2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType(const hid_t existing_id, bool predefined) : H5Object(existing_id), is_predtype(predefined) {}
|
||||
|
||||
// Creates a datatype given its class and size
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType overloaded constructor
|
||||
///\brief Creates a object given its class and size
|
||||
///\param type_class - IN: Class of datatype to create
|
||||
///\param size - IN: Number of bytes in the datatype to create
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object(), is_predtype( false )
|
||||
{
|
||||
// Call C routine to create the new datatype
|
||||
@@ -53,18 +73,30 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object(), is
|
||||
}
|
||||
}
|
||||
|
||||
// Default constructor
|
||||
DataType::DataType() : H5Object(), is_predtype( false )
|
||||
{
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType default constructor
|
||||
///\brief Default constructor: Creates a stub datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType() : H5Object(), is_predtype( false ) {}
|
||||
|
||||
// Copy constructor: makes a copy of this DataType object.
|
||||
DataType::DataType( const DataType& original ) : H5Object( original )
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original DataType object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType(const DataType& original) : H5Object(original)
|
||||
{
|
||||
is_predtype = original.is_predtype; // copy data member from original
|
||||
}
|
||||
|
||||
// Copies an existing datatype to this datatype object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::copy
|
||||
///\brief Copies an existing datatype to this datatype object
|
||||
///\param like_type - IN: Datatype to be copied
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::copy( const DataType& like_type )
|
||||
{
|
||||
// reset the identifier of this instance, H5Tclose will be called
|
||||
@@ -87,15 +119,32 @@ void DataType::copy( const DataType& like_type )
|
||||
}
|
||||
}
|
||||
|
||||
// Makes a copy of the type on the right hand side and stores the new
|
||||
// id in the left hand side object.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::operator=
|
||||
///\brief Assignment operator
|
||||
///\param rhs - IN: Reference to the existing datatype
|
||||
///\return Reference to DataType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Description
|
||||
// Makes a copy of the type on the right hand side and stores
|
||||
// the new id in the left hand side object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType& DataType::operator=( const DataType& rhs )
|
||||
{
|
||||
copy(rhs);
|
||||
return(*this);
|
||||
}
|
||||
|
||||
// Determines whether two datatypes refer to the same actual datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::operator==
|
||||
///\brief Compares this DataType against the given one to determines
|
||||
/// whether the two objects refer to the same actual datatype.
|
||||
///\param compared_type - IN: Reference to the datatype to compare
|
||||
///\return true if the datatypes are equal, and false, otherwise.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool DataType::operator==(const DataType& compared_type ) const
|
||||
{
|
||||
// Call C routine H5Tequal to determines whether two datatype
|
||||
@@ -112,27 +161,19 @@ bool DataType::operator==(const DataType& compared_type ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Operates a user's function on each attribute of an object - commented
|
||||
// out because it should use the one from H5Object; need to check
|
||||
// the parameter list??? - work in progress
|
||||
//int DataType::iterate( unsigned * idx, H5A_operator_t op, void *op_data )
|
||||
//{
|
||||
//}
|
||||
|
||||
// Creates a new variable-length datatype - Note: should use inheritance -
|
||||
// work in progress
|
||||
//DataType DataType::vlenCreate( const DataType& base_type )
|
||||
//{
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::commit
|
||||
///\brief Commits a transient datatype to a file, creating a new
|
||||
/// named datatype
|
||||
///\param loc - IN: Either a file or a group
|
||||
///\param name - IN: Name of the datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
// Commits a transient datatype to a file, creating a new named datatype
|
||||
void DataType::commit( H5Object& loc, const string& name ) const
|
||||
void DataType::commit( CommonFG& loc, const char* name ) const
|
||||
{
|
||||
commit( loc, name.c_str() );
|
||||
}
|
||||
void DataType::commit( H5Object& loc, const char* name ) const
|
||||
{
|
||||
hid_t loc_id = loc.getId(); // get location id for C API
|
||||
hid_t loc_id = loc.getLocId(); // get location id for C API
|
||||
|
||||
// Call C routine to commit the transient datatype
|
||||
herr_t ret_value = H5Tcommit( loc_id, name, id );
|
||||
@@ -141,8 +182,26 @@ void DataType::commit( H5Object& loc, const char* name ) const
|
||||
throw DataTypeIException("DataType::commit", "H5Tcommit failed");
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::commit
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of the
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::commit( CommonFG& loc, const string& name ) const
|
||||
{
|
||||
commit( loc, name.c_str() );
|
||||
}
|
||||
|
||||
// Determines whether a datatype is a named type or a transient type.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::committed
|
||||
///\brief Determines whether a datatype is a named type or a
|
||||
/// transient type.
|
||||
///\return true if the datatype is a named type, and false, otherwise.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool DataType::committed() const
|
||||
{
|
||||
// Call C function to determine if a datatype is a named one
|
||||
@@ -157,7 +216,16 @@ bool DataType::committed() const
|
||||
}
|
||||
}
|
||||
|
||||
// Finds a conversion function.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::find
|
||||
///\brief Finds a conversion function that can handle a conversion
|
||||
/// from this datatype to the specified datatype, \a dest.
|
||||
///\param dest - IN: Destination datatype
|
||||
///\param pcdata - IN: Pointer to type conversion data
|
||||
///\return Pointer to a suitable conversion function
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const
|
||||
{
|
||||
// Call C routine to find the conversion function
|
||||
@@ -169,7 +237,19 @@ H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const
|
||||
return( func );
|
||||
}
|
||||
|
||||
// Converts data from between specified datatypes.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::convert
|
||||
///\brief Converts data from this datatype to the specified datatypes.
|
||||
///\param dest - IN: Destination datatype
|
||||
///\param nelmts - IN: Size of array \a buf
|
||||
///\param buf - IN/OUT: Array containing pre- and post-conversion
|
||||
/// values
|
||||
///\param background - IN: Optional backgroud buffer
|
||||
///\param plist - IN: Dataset transfer property list
|
||||
///\return Pointer to a suitable conversion function
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::convert( const DataType& dest, hsize_t nelmts, void *buf, void *background, PropList& plist ) const
|
||||
{
|
||||
// Get identifiers for C API
|
||||
@@ -203,7 +283,19 @@ H5T_overflow_t DataType::getOverflow(void) const
|
||||
// NULL can be returned as well
|
||||
}
|
||||
|
||||
// Locks a datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::lock
|
||||
///\brief Locks a datatype, making it read-only and non-destructible.
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Descrition
|
||||
/// This is normally done by the library for predefined data
|
||||
/// types so the application doesn't inadvertently change or
|
||||
/// delete a predefined type.
|
||||
///
|
||||
/// Once a data type is locked it can never be unlocked unless
|
||||
/// the entire library is closed.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::lock() const
|
||||
{
|
||||
// Call C routine to lock the datatype
|
||||
@@ -214,7 +306,13 @@ void DataType::lock() const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the datatype class identifier.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getClass
|
||||
///\brief Returns the datatype class identifier.
|
||||
///\return Datatype class identifier
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_class_t DataType::getClass() const
|
||||
{
|
||||
H5T_class_t type_class = H5Tget_class( id );
|
||||
@@ -228,7 +326,13 @@ H5T_class_t DataType::getClass() const
|
||||
return( type_class );
|
||||
}
|
||||
|
||||
// Returns the size of a datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getSize
|
||||
///\brief Returns the size of a datatype.
|
||||
///\return Datatype size in bytes
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
size_t DataType::getSize() const
|
||||
{
|
||||
// Call C routine to get the datatype size
|
||||
@@ -241,8 +345,13 @@ size_t DataType::getSize() const
|
||||
return( type_size );
|
||||
}
|
||||
|
||||
// Returns the base datatype from which a datatype is derived.
|
||||
// - just for DataType?
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getSuper
|
||||
///\brief Returns the base datatype from which a datatype is derived.
|
||||
///\return DataType object
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType DataType::getSuper() const
|
||||
{
|
||||
// Call C routine to get the base datatype from which the specified
|
||||
@@ -262,11 +371,22 @@ DataType DataType::getSuper() const
|
||||
}
|
||||
}
|
||||
|
||||
// Registers the specified conversion function.
|
||||
void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const
|
||||
{
|
||||
registerFunc( pers, name.c_str(), dest, func );
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::registerFunc
|
||||
///\brief Registers the specified conversion function.
|
||||
///\param pers - IN: Conversion option
|
||||
/// \li \c H5T_PERS_HARD for hard conversion functions
|
||||
/// \li \c H5T_PERS_SOFT for soft conversion functions.
|
||||
///\param name - IN: Name displayed in diagnostic output.
|
||||
///\param dest - IN: Destination datatype.
|
||||
///\param func - IN: Function to convert between source and
|
||||
/// destination datatypes.
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For more information, please see:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-Register
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const
|
||||
{
|
||||
hid_t dest_id = dest.getId(); // get id of the destination datatype
|
||||
@@ -278,12 +398,31 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType&
|
||||
throw DataTypeIException("DataType::registerFunc", "H5Tregister failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Removes a conversion function from all conversion paths.
|
||||
void DataType::unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::registerFunc
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of the
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const
|
||||
{
|
||||
unregister( pers, name.c_str(), dest, func );
|
||||
registerFunc( pers, name.c_str(), dest, func );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::unregister
|
||||
///\brief Removes a conversion function from all conversion paths.
|
||||
///\param pers - IN: Conversion option
|
||||
/// \li \c H5T_PERS_HARD for hard conversion functions
|
||||
/// \li \c H5T_PERS_SOFT for soft conversion functions.
|
||||
///\param name - IN: Name displayed in diagnostic output.
|
||||
///\param dest - IN: Destination datatype.
|
||||
///\param func - IN: Function to convert between source and
|
||||
/// destination datatypes.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const
|
||||
{
|
||||
hid_t dest_id = dest.getId(); // get id of the dest datatype for C API
|
||||
@@ -295,12 +434,26 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de
|
||||
throw DataTypeIException("DataType::unregister", "H5Tunregister failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Tags an opaque datatype.
|
||||
void DataType::setTag( const string& tag ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::unregister
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of the
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const
|
||||
{
|
||||
setTag( tag.c_str());
|
||||
unregister( pers, name.c_str(), dest, func );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::setTag
|
||||
///\brief Tags an opaque datatype.
|
||||
///\param tag - IN: Descriptive ASCII string with which the opaque
|
||||
/// datatype is to be tagged.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::setTag( const char* tag ) const
|
||||
{
|
||||
// Call C routine H5Tset_tag to tag an opaque datatype.
|
||||
@@ -310,8 +463,25 @@ void DataType::setTag( const char* tag ) const
|
||||
throw DataTypeIException("DataType::setTag", "H5Tset_tag failed");
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::setTag
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of the
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::setTag( const string& tag ) const
|
||||
{
|
||||
setTag( tag.c_str());
|
||||
}
|
||||
|
||||
// Gets the tag associated with an opaque datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getTag
|
||||
///\brief Gets the tag associated with an opaque datatype.
|
||||
///\return Tag associated with the opaque datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string DataType::getTag() const
|
||||
{
|
||||
char* tag_Cstr = H5Tget_tag( id );
|
||||
@@ -331,8 +501,128 @@ string DataType::getTag() const
|
||||
}
|
||||
}
|
||||
|
||||
// This private function calls the C API H5Tclose to close this datatype.
|
||||
// Used by H5Object::p_reset.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::detectClass
|
||||
///\brief Checks whether a datatype contains (or is) a certain type of
|
||||
/// datatype.
|
||||
///\return true if this datatype contains or is the specified type,
|
||||
/// and false, otherwise.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
bool DataType::detectClass(H5T_class_t cls) const
|
||||
{
|
||||
htri_t ret_value = H5Tdetect_class(id, cls);
|
||||
if( ret_value > 0 )
|
||||
return true;
|
||||
else if( ret_value == 0 )
|
||||
return false;
|
||||
else
|
||||
{
|
||||
throw DataTypeIException("DataType::detectClass",
|
||||
"H5Tdetect_class returns negative value");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::isVariableStr
|
||||
///\brief Check whether this datatype is a variable-length string.
|
||||
///\return true if this datatype is a variable-length string, and
|
||||
/// false, otherwise.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
bool DataType::isVariableStr() const
|
||||
{
|
||||
htri_t is_varlen_str = H5Tis_variable_str(id);
|
||||
if( is_varlen_str == 1 )
|
||||
return true;
|
||||
else if( is_varlen_str == 0 )
|
||||
return false;
|
||||
else
|
||||
{
|
||||
throw DataTypeIException("DataType::isVariableStr",
|
||||
"H5Tis_variable_str returns negative value");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::Reference
|
||||
///\brief Creates a reference to an HDF5 object or a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
return(p_reference(name, dataspace.getId(), ref_type));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::Reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it only creates
|
||||
/// a reference to an HDF5 object, not to a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
///\par Description
|
||||
// This function passes H5R_OBJECT and -1 to the protected
|
||||
// function for it to pass to the C API H5Rcreate
|
||||
// to create a reference to the named object.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* DataType::Reference(const char* name) const
|
||||
{
|
||||
return(p_reference(name, -1, H5R_OBJECT));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref - IN: Reference to query
|
||||
///\param ref_type - IN: Type of reference to query
|
||||
///\return Object type, which can be one of the following:
|
||||
/// \li \c H5G_LINK Object is a symbolic link.
|
||||
/// \li \c H5G_GROUP Object is a group.
|
||||
/// \li \c H5G_DATASET Object is a dataset.
|
||||
/// \li \c H5G_TYPE Object is a named datatype
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t DataType::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
///\return DataSpace instance
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace DataType::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::p_close (private)
|
||||
// Purpose: Closes the datatype if it is not a predefined type.
|
||||
// Exception H5::DataTypeIException
|
||||
// Description
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer. - May, 2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::p_close() const
|
||||
{
|
||||
// If this datatype is not a predefined type, call H5Tclose on it.
|
||||
@@ -345,12 +635,13 @@ void DataType::p_close() const
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// The destructor of this instance calls IdComponent::reset to
|
||||
// reset its identifier - no longer true
|
||||
// Older compilers (baldric) don't support template member functions
|
||||
// and IdComponent::reset is one; so at this time, the resetId is not
|
||||
// a member function so it can be template to work around that problem.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType destructor
|
||||
///\brief Properly terminates access to this datatype.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::~DataType()
|
||||
{
|
||||
// The datatype id will be closed properly
|
||||
|
||||
@@ -25,45 +25,36 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
// Creates a datatype given its class and size
|
||||
DataType( const H5T_class_t type_class, size_t size );
|
||||
|
||||
// Copy constructor: makes a copy of the original object
|
||||
DataType( const DataType& original );
|
||||
|
||||
// Copies an existing datatype to this datatype object
|
||||
void copy( const DataType& like_type );
|
||||
|
||||
// Returns the datatype class identifier.
|
||||
H5T_class_t getClass() const;
|
||||
|
||||
// Commits a transient datatype to a file; this datatype becomes
|
||||
// a named datatype which can be accessed from the location.
|
||||
void commit( H5Object& loc, const string& name ) const;
|
||||
void commit( H5Object& loc, const char* name ) const;
|
||||
void commit( CommonFG& loc, const char* name ) const;
|
||||
void commit( CommonFG& loc, const string& name ) const;
|
||||
|
||||
// Determines whether this datatype is a named datatype or
|
||||
// a transient datatype.
|
||||
bool committed() const;
|
||||
|
||||
// Converts data from between specified datatypes.
|
||||
void convert( const DataType& dest, hsize_t nelmts, void *buf, void *background, PropList& plist ) const;
|
||||
|
||||
// Checks whether this datatype contains (or is) a certain type class.
|
||||
bool detectClass(H5T_class_t cls) const;
|
||||
|
||||
// Finds a conversion function that can handle the conversion
|
||||
// this datatype to the given datatype, dest.
|
||||
H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const;
|
||||
|
||||
// Converts data from between specified datatypes.
|
||||
void convert( const DataType& dest, hsize_t nelmts, void *buf, void *background, PropList& plist ) const;
|
||||
|
||||
// Sets the overflow handler to a specified function.
|
||||
void setOverflow(H5T_overflow_t func) const;
|
||||
// Returns the datatype class identifier.
|
||||
H5T_class_t getClass() const;
|
||||
|
||||
// Returns a pointer to the current global overflow function.
|
||||
H5T_overflow_t getOverflow(void) const;
|
||||
|
||||
// Assignment operator
|
||||
DataType& operator=( const DataType& rhs );
|
||||
|
||||
// Determines whether two datatypes are the same.
|
||||
bool operator==(const DataType& compared_type ) const;
|
||||
|
||||
// Locks a datatype.
|
||||
void lock() const;
|
||||
// Sets the overflow handler to a specified function.
|
||||
void setOverflow(H5T_overflow_t func) const;
|
||||
|
||||
// Returns the size of a datatype.
|
||||
size_t getSize() const;
|
||||
@@ -72,6 +63,25 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
// Note: not quite right for specific types yet???
|
||||
DataType getSuper() const;
|
||||
|
||||
// Gets the tag associated with an opaque datatype.
|
||||
string getTag() const;
|
||||
|
||||
// Tags an opaque datatype.
|
||||
void setTag( const string& tag ) const;
|
||||
void setTag( const char* tag ) const;
|
||||
|
||||
// Checks whether this datatype is a variable-length string.
|
||||
bool isVariableStr() const;
|
||||
|
||||
// Locks a datatype.
|
||||
void lock() const;
|
||||
|
||||
// Assignment operator
|
||||
DataType& operator=( const DataType& rhs );
|
||||
|
||||
// Determines whether two datatypes are the same.
|
||||
bool operator==(const DataType& compared_type ) const;
|
||||
|
||||
// Registers a conversion function.
|
||||
void registerFunc(H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const;
|
||||
void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
|
||||
@@ -80,19 +90,18 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const;
|
||||
void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
|
||||
|
||||
// Tags an opaque datatype.
|
||||
void setTag( const string& tag ) const;
|
||||
void setTag( const char* tag ) const;
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
// Gets the tag associated with an opaque datatype.
|
||||
string getTag() const;
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Creates a reference to a named Hdf5 object or to a dataset region
|
||||
// in this object.
|
||||
void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Creates a new variable-length datatype - not implemented yet
|
||||
// Will be moved into a subclass when completed
|
||||
//DataType vlenCreate( const DataType& base_type );
|
||||
|
||||
// Used by the API to appropriately close a datatype
|
||||
void p_close() const;
|
||||
// Creates a reference to a named Hdf5 object in this object.
|
||||
void* Reference(const char* name) const;
|
||||
|
||||
// Creates a copy of an existing DataType using its id
|
||||
DataType( const hid_t type_id, bool predtype = false );
|
||||
@@ -100,6 +109,15 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
// Default constructor
|
||||
DataType();
|
||||
|
||||
// Copy constructor: makes a copy of the original object
|
||||
DataType( const DataType& original );
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Used by the API to appropriately close a datatype
|
||||
void p_close() const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Destructor: properly terminates access to this datatype.
|
||||
virtual ~DataType();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -20,22 +20,57 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for dataset creation default property
|
||||
//--------------------------------------------------------------------------
|
||||
const DSetCreatPropList DSetCreatPropList::DEFAULT( H5P_DEFAULT );
|
||||
|
||||
// Creates a dataset creation property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList default constructor
|
||||
///\brief Default constructor: creates a stub dataset creation property list
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetCreatPropList::DSetCreatPropList() : PropList( H5P_DATASET_CREATE) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original DSetCreatPropList object;
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original
|
||||
/// DSetCreatPropList object
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : PropList( orig ) {}
|
||||
|
||||
// Sets the size of the chunks used to store a chunked layout dataset.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList overloaded constructor
|
||||
///\brief Creates a DSetCreatPropList object using the id of an
|
||||
/// existing dataset creation property list.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : PropList( plist_id ) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setChunk
|
||||
///\brief Sets the size of the chunks used to store a chunked layout
|
||||
/// dataset.
|
||||
///\param ndims - IN: Number of dimensions of each chunk
|
||||
///\param dim - IN: Array containing the size of each chunk
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The \a ndims parameter currently must have the same value as
|
||||
/// the rank of the dataset. The values of the \a dim array
|
||||
/// define the size of the chunks to store the dataset's raw
|
||||
/// data. As a side-effect, the layout of the dataset will be
|
||||
/// changed to \c H5D_CHUNKED, if it is not so already.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_chunk( id, ndims, dim );
|
||||
@@ -45,20 +80,15 @@ void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the layout of the raw data storage of the data that uses this
|
||||
// property list
|
||||
H5D_layout_t DSetCreatPropList::getLayout() const
|
||||
{
|
||||
H5D_layout_t layout = H5Pget_layout( id );
|
||||
if( layout == H5D_LAYOUT_ERROR )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::getLayout",
|
||||
"H5Pget_layout returns H5D_LAYOUT_ERROR");
|
||||
}
|
||||
return( layout );
|
||||
}
|
||||
|
||||
// Retrieves the size of the chunks used to store a chunked layout dataset.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getChunk
|
||||
///\brief Retrieves the size of the chunks used to store a chunked
|
||||
/// layout dataset.
|
||||
///\param max_ndims - IN: Size of \a dim array
|
||||
///\param dim - OUT: Array to store the chunk dimensions
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
|
||||
{
|
||||
int chunk_size = H5Pget_chunk( id, max_ndims, dim );
|
||||
@@ -70,8 +100,17 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
|
||||
return( chunk_size );
|
||||
}
|
||||
|
||||
// Sets the type of storage used store the raw data for a dataset.
|
||||
void DSetCreatPropList::setLayout(hid_t plist, H5D_layout_t layout ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setLayout
|
||||
///\brief Sets the type of storage used store the raw data for a dataset.
|
||||
///\param layout - IN: Type of storage layout for raw data
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information on setting layout type, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetLayout
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setLayout(H5D_layout_t layout) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_layout( id, layout );
|
||||
if( ret_value < 0 )
|
||||
@@ -81,7 +120,45 @@ void DSetCreatPropList::setLayout(hid_t plist, H5D_layout_t layout ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Sets compression method and compression level
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getLayout
|
||||
///\brief Retrieves the layout type of this property list
|
||||
///\return Layout type, which can be:
|
||||
/// \li \c H5D_COMPACT - raw data is stored in the object
|
||||
/// header in the file.
|
||||
/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the
|
||||
/// object header in one contiguous chunk in
|
||||
/// the file.
|
||||
/// \li \c H5D_CHUNKED - raw data is stored separately from the
|
||||
/// object header in chunks in separate locations
|
||||
/// in the file.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5D_layout_t DSetCreatPropList::getLayout() const
|
||||
{
|
||||
H5D_layout_t layout = H5Pget_layout( id );
|
||||
if( layout == H5D_LAYOUT_ERROR )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::getLayout",
|
||||
"H5Pget_layout returns H5D_LAYOUT_ERROR");
|
||||
}
|
||||
return( layout );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setDeflate
|
||||
///\brief Sets compression method and compression level
|
||||
///\param level - IN: Compression level, should [0..9], inclusive
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The function sets the compression method for this property
|
||||
/// list to \c H5D_COMPRESS_DEFLATE and the compression level to
|
||||
/// \a level. Lower compression levels are faster but result in
|
||||
/// less compression.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setDeflate( int level ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_deflate( id, level );
|
||||
@@ -92,8 +169,25 @@ void DSetCreatPropList::setDeflate( int level ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Sets a dataset fill value
|
||||
void DSetCreatPropList::setFillValue( DataType& fvalue_type, const void* value ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setFillValue
|
||||
///\brief Sets a dataset fill value
|
||||
///\param fvalue_type - IN: Data type for the value passed via \a value
|
||||
///\param value - IN: Pointer to buffer containing the fill value
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The datatype may differ from that of the dataset, but it must
|
||||
/// be one that the HDF5 library is able to convert \a value to
|
||||
/// the dataset datatype when the dataset is created.
|
||||
/// The default fill value is 0 (zero,) which is interpreted
|
||||
/// according to the actual dataset datatype.
|
||||
///\par
|
||||
/// For information on setting fill value, please refer to the
|
||||
/// C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFillValue
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_fill_value( id, fvalue_type.getId(), value );
|
||||
if( ret_value < 0 )
|
||||
@@ -103,8 +197,20 @@ void DSetCreatPropList::setFillValue( DataType& fvalue_type, const void* value )
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves a dataset fill value
|
||||
void DSetCreatPropList::getFillValue( DataType& fvalue_type, void* value ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getFillValue
|
||||
///\brief Retrieves a dataset fill value
|
||||
///\param fvalue_type - IN: Data type for the value passed via \a value
|
||||
///\param value - OUT: Pointer to buffer to hold the retrieved fill value
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The fill value is returned through \a value pointer
|
||||
/// and the memory is allocated by the caller. The fill
|
||||
/// value will be converted from its current data type to the
|
||||
/// specified by \a fvalue_type.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_fill_value( id, fvalue_type.getId(), value );
|
||||
if( ret_value < 0 )
|
||||
@@ -114,10 +220,52 @@ void DSetCreatPropList::getFillValue( DataType& fvalue_type, void* value ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a filter to the filter pipeline
|
||||
void DSetCreatPropList::setFilter( H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::isFillValueDefined
|
||||
///\brief Check if fill value has been defined for this property
|
||||
///\return
|
||||
/// \li \c H5D_FILL_VALUE_UNDEFINED =0,
|
||||
/// \li \c H5D_FILL_VALUE_DEFAULT =1,
|
||||
/// \li \c H5D_FILL_VALUE_USER_DEFINED =2
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5D_fill_value_t DSetCreatPropList::isFillValueDefined()
|
||||
{
|
||||
herr_t ret_value = H5Pset_filter( id, filter, flags, cd_nelmts, cd_values );
|
||||
H5D_fill_value_t status;
|
||||
herr_t ret_value = H5Pfill_value_defined(id, &status);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::isFillValueDefined",
|
||||
"H5Pfill_value_defined returned H5D_FILL_VALUE_ERROR (-1)");
|
||||
}
|
||||
else
|
||||
return (status);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setFilter
|
||||
///\brief Adds a filter to the filter pipeline
|
||||
///\param filter_id - IN: Filter to add
|
||||
///\param flags - IN: Specifies general properties of the filter
|
||||
///\param cd_nelmts - IN: Number of elements in cd_values
|
||||
///\param cd_values - IN: Auxiliary data for the filter
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The \a flags argument is a bit vector of the field:
|
||||
/// \c H5Z_FLAG_OPTIONAL(0x0001)
|
||||
///\par
|
||||
/// If this bit is set then the filter is optional. If the filter
|
||||
/// fails during a \c DataSet::write() operation then the filter
|
||||
/// is just excluded from the pipeline for the chunk for which it
|
||||
/// failed; the filter will not participate in the pipeline
|
||||
/// during a \c DataSet::read() of the chunk. If this bit is clear
|
||||
/// and the filter fails then the entire I/O operation fails.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_filter( id, filter_id, flags, cd_nelmts, cd_values );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::setFilter",
|
||||
@@ -125,7 +273,33 @@ void DSetCreatPropList::setFilter( H5Z_filter_t filter, unsigned int flags, size
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the number of filters in the pipeline
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::removeFilter
|
||||
///\brief Removes one or more filters
|
||||
///\param filter_id - IN: Filter to remove
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Deletes a filter from the dataset creation property list;
|
||||
/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const
|
||||
{
|
||||
herr_t ret_value = H5Premove_filter( id, filter_id);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::removeFilter",
|
||||
"H5Premove_filter failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getNfilters
|
||||
///\brief Returns the number of filters in the pipeline
|
||||
///\return Number of filters
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int DSetCreatPropList::getNfilters() const
|
||||
{
|
||||
int num_filters = H5Pget_nfilters( id );
|
||||
@@ -138,22 +312,262 @@ int DSetCreatPropList::getNfilters() const
|
||||
return( num_filters );
|
||||
}
|
||||
|
||||
// Returns information about a filter in a pipeline
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getFilter
|
||||
///\brief Returns information about a filter in a pipeline
|
||||
///\param filter_number - IN: Filter to get, range [0..N-1], where
|
||||
/// N is returned by H5Pget_nfilters()
|
||||
///\param flags - OUT: General properties of the filter
|
||||
///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
|
||||
/// of values defined by the filter
|
||||
///\param cd_values - OUT: Array to hold the data; allocated by the user
|
||||
///\param namelen - OUT: Length of \a name
|
||||
///\param name - OUT: Name of the filter
|
||||
///\return Filter id
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Failure occurs when \a filter_number is out of range.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Z_filter_t DSetCreatPropList::getFilter( int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[] ) const
|
||||
{
|
||||
H5Z_filter_t filter;
|
||||
filter = H5Pget_filter( id, filter_number, &flags, &cd_nelmts,
|
||||
cd_values, namelen, name );
|
||||
if( filter == H5Z_FILTER_ERROR )
|
||||
H5Z_filter_t filter_id;
|
||||
filter_id = H5Pget_filter(id, filter_number, &flags, &cd_nelmts,
|
||||
cd_values, namelen, name);
|
||||
if (filter_id == H5Z_FILTER_ERROR)
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::getFilter",
|
||||
"H5Pget_filter returned H5Z_FILTER_ERROR");
|
||||
}
|
||||
else
|
||||
return( filter );
|
||||
return(filter_id);
|
||||
}
|
||||
|
||||
// Adds an external file to the list of external files
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getFilterById
|
||||
///\brief Returns information about a filter in a pipeline given the
|
||||
/// filter id
|
||||
///\param filter_id - IN: Filter to get
|
||||
///\param flags - OUT: General properties of the filter
|
||||
///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
|
||||
/// of values defined by the filter
|
||||
///\param cd_values - OUT: Array to hold the data; allocated by the user
|
||||
///\param namelen - IN: Length of \a name
|
||||
///\param name - OUT: Name of the filter
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[]) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts,
|
||||
cd_values, namelen, name );
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::getFilterById",
|
||||
"H5Pget_filter_by_id failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::modifyFilter
|
||||
///\brief Modifies the specified filter
|
||||
///\param filter_id - IN: Filter to get
|
||||
///\param flags - OUT: General properties of the filter
|
||||
///\param cd_nelmts - IN: Number of elements in \a cd_values
|
||||
/// \n OUT: Number of values defined by the filter
|
||||
///\param cd_values - OUT: Array to hold the data; allocated by the user
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The \a flags argument is a bit vector of the field:
|
||||
/// \c H5Z_FLAG_OPTIONAL(0x0001)
|
||||
///\par
|
||||
/// If this bit is set then the filter is optional. If the filter
|
||||
/// fails during a DataSet::write() operation then the filter
|
||||
/// is just excluded from the pipeline for the chunk for which it
|
||||
/// failed; the filter will not participate in the pipeline
|
||||
/// during a DataSet::read() of the chunk. If this bit is clear
|
||||
/// and the filter fails then the entire I/O operation fails.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const
|
||||
{
|
||||
herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::modifyFilter",
|
||||
"H5Pmodify_filter failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::allFiltersAvail
|
||||
///\brief Queries whether all the filters set in this property list
|
||||
/// are available currently.
|
||||
///\return true if all filters available, and false if one or more
|
||||
/// filters not currently available
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool DSetCreatPropList::allFiltersAvail()
|
||||
{
|
||||
htri_t ret_value = H5Pall_filters_avail(id);
|
||||
if( ret_value > 0 )
|
||||
return true;
|
||||
else if( ret_value == 0 )
|
||||
return false;
|
||||
else // Raise exception when H5Pall_filters_avail returns a negative value
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setShuffle
|
||||
///\brief Sets method of the shuffle filter
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Please refer to the Reference Manual of \c H5Pset_shuffle for
|
||||
/// details.
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetShuffle
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setShuffle()
|
||||
{
|
||||
herr_t ret_value = H5Pset_shuffle(id);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::setShuffle",
|
||||
"H5Pset_shuffle failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getAllocTime
|
||||
///\brief Get space allocation time for this property.
|
||||
///\return Space allocation time.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The values of space allocation time can be one of the
|
||||
/// followings:
|
||||
/// \li \c H5D_ALLOC_TIME_DEFAULT
|
||||
/// \li \c H5D_ALLOC_TIME_EARLY
|
||||
/// \li \c H5D_ALLOC_TIME_LATE
|
||||
/// \li \c H5D_ALLOC_TIME_INCR
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5D_alloc_time_t DSetCreatPropList::getAllocTime()
|
||||
{
|
||||
H5D_alloc_time_t alloc_time;
|
||||
herr_t ret_value = H5Pget_alloc_time(id, &alloc_time);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::getAllocTime",
|
||||
"H5Pget_alloc_time failed");
|
||||
}
|
||||
else
|
||||
return (alloc_time);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getFillTime
|
||||
///\brief Gets fill value writing time.
|
||||
///\return Fill value writing time
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Valid values for fill value writing time include
|
||||
/// \li \c H5D_FILL_TIME_NEVER
|
||||
/// \li \c H5D_FILL_TIME_ALLOC.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5D_fill_time_t DSetCreatPropList::getFillTime()
|
||||
{
|
||||
H5D_fill_time_t fill_time;
|
||||
herr_t ret_value = H5Pget_fill_time(id, &fill_time);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::getFillTime",
|
||||
"H5Pget_fill_time failed");
|
||||
}
|
||||
else
|
||||
return (fill_time);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setAllocTime
|
||||
///\brief Sets space allocation time for dataset during creation.
|
||||
///\param alloc_time - IN: Allocation time
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Valid values for space allocation time include:
|
||||
/// \li \c H5D_ALLOC_TIME_DEFAULT
|
||||
/// \li \c H5D_ALLOC_TIME_EARLY
|
||||
/// \li \c H5D_ALLOC_TIME_LATE
|
||||
/// \li \c H5D_ALLOC_TIME_INCR
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time)
|
||||
{
|
||||
herr_t ret_value = H5Pset_alloc_time(id, alloc_time);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::setAllocTime",
|
||||
"H5Pset_alloc_time failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setFillTime
|
||||
///\brief Sets fill value writing time for dataset.
|
||||
///\return Fill value writing time
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Valid values for fill value writing time include
|
||||
/// \li \c H5D_FILL_TIME_NEVER
|
||||
/// \li \c H5D_FILL_TIME_ALLOC.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time)
|
||||
{
|
||||
herr_t ret_value = H5Pset_fill_time(id, fill_time);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::setFillTime",
|
||||
"H5Pset_fill_time failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setFletcher32
|
||||
///\brief Sets Fletcher32 checksum of EDC for this property list.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setFletcher32()
|
||||
{
|
||||
herr_t ret_value = H5Pset_fletcher32(id);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetCreatPropList::setFletcher32",
|
||||
"H5Pset_fletcher32 failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::setExternal
|
||||
///\brief Adds an external file to the list of external files
|
||||
///\param name - IN: Name of the external file
|
||||
///\param offset - IN: Location where the data starts in the file
|
||||
///\param size - IN: Number of bytes reserved in the file for the data
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// If a dataset is splitted across multiple files then the files
|
||||
/// should be defined in order. The total size of the dataset is
|
||||
/// the sum of the \a size arguments for all the external files. If
|
||||
/// the total size is larger than the size of a dataset then the
|
||||
/// dataset can be extended (provided the data space also allows
|
||||
/// the extending).
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_external( id, name, offset, size );
|
||||
@@ -164,7 +578,13 @@ void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t siz
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the number of external files for a dataset
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getExternalCount
|
||||
///\brief Returns the number of external files for a dataset
|
||||
///\return Number of external files
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int DSetCreatPropList::getExternalCount() const
|
||||
{
|
||||
int num_ext_files = H5Pget_external_count( id );
|
||||
@@ -177,7 +597,28 @@ int DSetCreatPropList::getExternalCount() const
|
||||
return( num_ext_files );
|
||||
}
|
||||
|
||||
// Returns information about an external file
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::getExternal
|
||||
///\brief Returns information about an external file
|
||||
///\param idx - IN: Index of the external file, ranges [0-(N-1)] and
|
||||
/// returned by getExternalCount()
|
||||
///\param name_size - IN: Maximum length of \a name
|
||||
///\param name - IN: Name of the external file
|
||||
///\param offset - IN: Location to return an offset value
|
||||
///\param size - OUT: Location to return the size of the external file data
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The parameter \a idx ranges [0..N-1] where N is returned by
|
||||
/// getExternalCount(). At most \a name_size characters are copied
|
||||
/// into the name array. If the external file name is longer than
|
||||
/// name_size with the null terminator, the return value is not
|
||||
/// null terminated (similar to strncpy()).
|
||||
/// If \a name_size is zero or \a name is a null pointer, the
|
||||
/// external file name will not be returned. If \a offset or
|
||||
/// \a size are null pointers then the corresponding information
|
||||
/// will not be returned.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::getExternal( int idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_external( id, idx, name_size, name, &offset, &size );
|
||||
@@ -188,7 +629,11 @@ void DSetCreatPropList::getExternal( int idx, size_t name_size, char* name, off_
|
||||
}
|
||||
}
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetCreatPropList::~DSetCreatPropList () {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -21,62 +21,96 @@ namespace H5 {
|
||||
#endif
|
||||
|
||||
class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
public:
|
||||
public:
|
||||
// Default dataset creation property list.
|
||||
static const DSetCreatPropList DEFAULT;
|
||||
|
||||
// Creates a dataset creation property list
|
||||
DSetCreatPropList();
|
||||
// Queries whether all the filters set in this property list are
|
||||
// available currently.
|
||||
bool allFiltersAvail();
|
||||
|
||||
// Copy constructor: creates a copy of a DSetCreatPropList object;
|
||||
// often used by the compiler when passing by value occurs.
|
||||
DSetCreatPropList( const DSetCreatPropList& orig );
|
||||
// Get space allocation time for this property.
|
||||
H5D_alloc_time_t getAllocTime();
|
||||
|
||||
// Sets the type of storage used to store the raw data for the
|
||||
// dataset that uses this property list
|
||||
void setLayout(hid_t plist, H5D_layout_t layout ) const;
|
||||
|
||||
// Gets the layout of the raw data storage of the data that uses this
|
||||
// property list
|
||||
H5D_layout_t getLayout() const;
|
||||
|
||||
// Sets the size of the chunks used to store a chunked layout dataset.
|
||||
void setChunk( int ndims, const hsize_t* dim ) const;
|
||||
// Set space allocation time for dataset during creation.
|
||||
void setAllocTime(H5D_alloc_time_t alloc_time);
|
||||
|
||||
// Retrieves the size of the chunks used to store a chunked layout dataset.
|
||||
int getChunk( int max_ndims, hsize_t* dim ) const;
|
||||
|
||||
// Sets compression method and compression level
|
||||
void setDeflate( int level ) const;
|
||||
// Sets the size of the chunks used to store a chunked layout dataset.
|
||||
void setChunk( int ndims, const hsize_t* dim ) const;
|
||||
|
||||
// Sets a dataset fill value
|
||||
void setFillValue( DataType& fvalue_type, const void* value ) const;
|
||||
|
||||
// Retrieves a dataset fill value
|
||||
void getFillValue( DataType& fvalue_type, void* value ) const;
|
||||
|
||||
// Adds a filter to the filter pipeline
|
||||
void setFilter( H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const;
|
||||
|
||||
// Returns the number of filters in the pipeline
|
||||
int getNfilters() const;
|
||||
|
||||
// Returns information about a filter in a pipeline
|
||||
H5Z_filter_t getFilter( int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[] ) const;
|
||||
|
||||
// Adds an external file to the list of external files
|
||||
void setExternal( const char* name, off_t offset, hsize_t size ) const;
|
||||
|
||||
// Returns the number of external files for a dataset
|
||||
int getExternalCount() const;
|
||||
|
||||
// Returns information about an external file
|
||||
// Returns information about an external file.
|
||||
void getExternal( int idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const;
|
||||
|
||||
// Creates a copy of an existing dataset creation property list
|
||||
// using the property list id
|
||||
DSetCreatPropList( const hid_t plist_id ) : PropList( plist_id ) {}
|
||||
// Returns the number of external files for a dataset.
|
||||
int getExternalCount() const;
|
||||
|
||||
// Default destructor
|
||||
// Gets fill value writing time.
|
||||
H5D_fill_time_t getFillTime();
|
||||
|
||||
// Sets fill value writing time for dataset.
|
||||
void setFillTime(H5D_fill_time_t fill_time);
|
||||
|
||||
// Retrieves a dataset fill value.
|
||||
void getFillValue( const DataType& fvalue_type, void* value ) const;
|
||||
|
||||
// Sets a dataset fill value.
|
||||
void setFillValue( const DataType& fvalue_type, const void* value ) const;
|
||||
|
||||
// Returns information about a filter in a pipeline.
|
||||
H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[]) const;
|
||||
|
||||
// Returns information about a filter in a pipeline given the filter id.
|
||||
void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[]) const;
|
||||
|
||||
// Gets the layout of the raw data storage of the data that uses this
|
||||
// property list.
|
||||
H5D_layout_t getLayout() const;
|
||||
|
||||
// Sets the type of storage used to store the raw data for the
|
||||
// dataset that uses this property list.
|
||||
void setLayout(H5D_layout_t layout) const;
|
||||
|
||||
// Returns the number of filters in the pipeline.
|
||||
int getNfilters() const;
|
||||
|
||||
// Checks if fill value has been defined for this property.
|
||||
H5D_fill_value_t isFillValueDefined();
|
||||
|
||||
// Modifies the specified filter.
|
||||
void modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const;
|
||||
|
||||
// Remove one or all filters from the filter pipeline.
|
||||
void removeFilter( H5Z_filter_t filter_id) const;
|
||||
|
||||
// Sets compression method and compression level.
|
||||
void setDeflate( int level ) const;
|
||||
|
||||
// Adds an external file to the list of external files.
|
||||
void setExternal( const char* name, off_t offset, hsize_t size ) const;
|
||||
|
||||
// Adds a filter to the filter pipeline.
|
||||
void setFilter( H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const;
|
||||
|
||||
// Sets Fletcher32 checksum of EDC for this property list.
|
||||
void setFletcher32();
|
||||
|
||||
// Sets method of the shuffle filter.
|
||||
void setShuffle();
|
||||
|
||||
// Default constructor: creates a stub dataset creation property list.
|
||||
DSetCreatPropList();
|
||||
|
||||
// Copy constructor: creates a copy of a DSetCreatPropList object.
|
||||
DSetCreatPropList(const DSetCreatPropList& orig);
|
||||
|
||||
// Creates a copy of an existing dataset creation property list
|
||||
// using the property list id.
|
||||
DSetCreatPropList(const hid_t plist_id);
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~DSetCreatPropList();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -25,16 +25,49 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default dataset memory and transfer property list.
|
||||
//--------------------------------------------------------------------------
|
||||
const DSetMemXferPropList DSetMemXferPropList::DEFAULT( H5P_DEFAULT );
|
||||
|
||||
// Creates a dataset memory and transfer property list
|
||||
DSetMemXferPropList::DSetMemXferPropList() : PropList( H5P_DATASET_XFER) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function Default constructor
|
||||
///\brief Default constructor: creates a stub dataset memory and
|
||||
/// transfer property list object.
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original DSetMemXferPropList object;
|
||||
DSetMemXferPropList::DSetMemXferPropList( const DSetMemXferPropList& orig ) : PropList( orig ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function DSetMemXferPropList copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original
|
||||
/// DSetMemXferPropList object
|
||||
///\param original - IN: Original dataset memory and transfer property
|
||||
/// list object to copy
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original) : PropList(original) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function DSetMemXferPropList overloaded constructor
|
||||
///\brief Creates a DSetMemXferPropList object using the id of an
|
||||
/// existing DSetMemXferPropList.
|
||||
///\param plist_id - IN: Id of an existing dataset memory and transfer
|
||||
/// property list
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_id) {}
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
// Sets type conversion and background buffers
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setBuffer
|
||||
///\brief Sets type conversion and background buffers.
|
||||
///\param size - IN: Size, in bytes, of the type conversion and background buffers
|
||||
///\param tconv - IN: Pointer to application-allocated type conversion buffer
|
||||
///\param bkg - IN: Pointer to application-allocated background buffer
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setBuffer( hsize_t size, void* tconv, void* bkg ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg );
|
||||
@@ -45,7 +78,15 @@ void DSetMemXferPropList::setBuffer( hsize_t size, void* tconv, void* bkg ) cons
|
||||
}
|
||||
}
|
||||
|
||||
// Reads buffer settings
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getBuffer
|
||||
///\brief Reads buffer settings.
|
||||
///\param tconv - IN: Pointer to application-allocated type conversion buffer
|
||||
///\param bkg - IN: Pointer to application-allocated background buffer
|
||||
///\return Buffer size, in bytes
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const
|
||||
{
|
||||
hsize_t buffer_size = H5Pget_buffer( id, tconv, bkg );
|
||||
@@ -57,7 +98,15 @@ hsize_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const
|
||||
return( buffer_size );
|
||||
}
|
||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
||||
// Sets type conversion and background buffers
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setBuffer
|
||||
///\brief Sets type conversion and background buffers.
|
||||
///\param size - IN: Size, in bytes, of the type conversion and background buffers
|
||||
///\param tconv - IN: Pointer to application-allocated type conversion buffer
|
||||
///\param bkg - IN: Pointer to application-allocated background buffer
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg );
|
||||
@@ -68,7 +117,15 @@ void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Reads buffer settings
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getBuffer
|
||||
///\brief Reads buffer settings.
|
||||
///\param tconv - IN: Pointer to application-allocated type conversion buffer
|
||||
///\param bkg - IN: Pointer to application-allocated background buffer
|
||||
///\return Buffer size, in bytes
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const
|
||||
{
|
||||
size_t buffer_size = H5Pget_buffer( id, tconv, bkg );
|
||||
@@ -81,7 +138,13 @@ size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
// Sets the dataset transfer property list status to TRUE or FALSE
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setPreserve
|
||||
///\brief Sets the dataset transfer property list status to true or false.
|
||||
///\param status - IN: Status to set, true or false
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setPreserve( bool status ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_preserve( id, (hbool_t) status );
|
||||
@@ -92,7 +155,13 @@ void DSetMemXferPropList::setPreserve( bool status ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Checks status of the dataset transfer property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getPreserve
|
||||
///\brief Checks status of the dataset transfer property list.
|
||||
///\return Status of the dataset transfer property list
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool DSetMemXferPropList::getPreserve() const
|
||||
{
|
||||
int ret_value = H5Pget_preserve( id );
|
||||
@@ -108,7 +177,21 @@ bool DSetMemXferPropList::getPreserve() const
|
||||
}
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
// Indicates whether to cache hyperslab blocks during I/O
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setHyperCache
|
||||
///\brief Indicates whether to cache hyperslab blocks during I/O
|
||||
///\param cache - IN: Flag indicating whether caching is to be set
|
||||
/// to on (1) or off (0)
|
||||
///\param limit - IN: Maximum size of the hyperslab block to cache or
|
||||
/// 0 (zero) for no limit
|
||||
///\exception H5::PropListIException
|
||||
///\note This function is deprecated in HDF5 Release 1.6 and will
|
||||
/// eventually be removed from the HDF5 distribution. It is
|
||||
/// provided in this release only to enable backward compatibility
|
||||
/// with HDF5 Releases 1.4.x and is enabled only if the HDF5
|
||||
/// library is configured with the flag H5_WANT_H5_V1_4_COMPAT.
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setHyperCache( bool cache, unsigned limit ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_hyper_cache( id, cache, limit );
|
||||
@@ -119,7 +202,22 @@ void DSetMemXferPropList::setHyperCache( bool cache, unsigned limit ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns information regarding the caching of hyperslab blocks during I/O
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getHyperCache
|
||||
///\brief Returns information regarding the caching of hyperslab
|
||||
/// blocks during I/O.
|
||||
///\param cache - OUT: Flag indicating whether caching is set
|
||||
/// to on (1) or off (0)
|
||||
///\param limit - OUT: Maximum size of the hyperslab block to cache or
|
||||
/// 0 (zero) for no limit
|
||||
///\exception H5::PropListIException
|
||||
///\note This function is deprecated in HDF5 Release 1.6 and will
|
||||
/// eventually be removed from the HDF5 distribution. It is
|
||||
/// provided in this release only to enable backward compatibility
|
||||
/// with HDF5 Releases 1.4.x and is enabled only if the HDF5
|
||||
/// library is configured with the flag H5_WANT_H5_V1_4_COMPAT.
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::getHyperCache( bool& cache, unsigned& limit ) const
|
||||
{
|
||||
unsigned temp_cache; // C routine takes hid_t, unsigned*, unsigned*
|
||||
@@ -136,7 +234,15 @@ void DSetMemXferPropList::getHyperCache( bool& cache, unsigned& limit ) const
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
// Sets B-tree split ratios for a dataset transfer property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setBtreeRatios
|
||||
///\brief Sets B-tree split ratios for a dataset transfer property list.
|
||||
///\param left - IN: B-tree split ratio for left-most nodes
|
||||
///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes
|
||||
///\param right - IN: B-tree split ratio for all other nodes
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setBtreeRatios( double left, double middle, double right ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_btree_ratios( id, left, middle, right );
|
||||
@@ -147,7 +253,15 @@ void DSetMemXferPropList::setBtreeRatios( double left, double middle, double rig
|
||||
}
|
||||
}
|
||||
|
||||
// Gets B-tree split ratios for a dataset transfer property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getBtreeRatios
|
||||
///\brief Gets B-tree split ratios for a dataset transfer property list.
|
||||
///\param left - OUT: B-tree split ratio for left-most nodes
|
||||
///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes
|
||||
///\param right - OUT: B-tree split ratio for all other nodes
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& right ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_btree_ratios( id, &left, &middle, &right );
|
||||
@@ -158,7 +272,16 @@ void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double&
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the memory manager for variable-length datatype allocation
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setVlenMemManager
|
||||
///\brief Sets the memory manager for variable-length datatype allocation.
|
||||
///\param alloc_func - IN: User's allocate routine
|
||||
///\param alloc_info - IN: User's allocation parameters
|
||||
///\param free_func - IN: User's free routine
|
||||
///\param free_info - IN: User's free parameters
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info,
|
||||
@@ -170,20 +293,28 @@ void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* a
|
||||
}
|
||||
}
|
||||
|
||||
// alloc_func and free_func are set to NULL, indicating that system malloc and
|
||||
// free are to be used
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setVlenMemManager
|
||||
///\brief Sets the memory manager for variable-length datatype
|
||||
/// allocation - system \c malloc and \c free will be used.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setVlenMemManager() const
|
||||
{
|
||||
setVlenMemManager( NULL, NULL, NULL, NULL );
|
||||
//herr_t ret_value = H5Pset_vlen_mem_manager( id, NULL, NULL, NULL, NULL );
|
||||
//if( ret_value < 0 )
|
||||
//{
|
||||
//throw PropListIException("DSetMemXferPropList::setVlenMemManager",
|
||||
//"H5Pset_vlen_mem_manager failed");
|
||||
//}
|
||||
}
|
||||
|
||||
// Gets the memory manager for variable-length datatype allocation
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getVlenMemManager
|
||||
///\brief Gets the memory manager for variable-length datatype allocation
|
||||
///\param alloc_func - OUT: User's allocate routine
|
||||
///\param alloc_info - OUT: User's allocation parameters
|
||||
///\param free_func - OUT: User's free routine
|
||||
///\param free_info - OUT: User's free parameters
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_vlen_mem_manager( id, &alloc_func, alloc_info, &free_func, free_info );
|
||||
@@ -194,36 +325,173 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void**
|
||||
}
|
||||
}
|
||||
|
||||
/* this function is in parallel mode only - not supported at this time.
|
||||
// Sets the transfer mode
|
||||
void DSetMemXferPropList::setXfer( H5D_transfer_t data_xfer_mode = H5D_XFER_INDEPENDENT ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setMulti
|
||||
///\brief Sets the data transfer property list for the multi-file driver.
|
||||
///\param memb_dxpl - OUT: Array of data access property lists
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// This function can only be used after the member map has
|
||||
/// been set with FileAccPropList::setMulti (not done - BMR.)
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setMulti(const hid_t *memb_dxpl)
|
||||
{
|
||||
herr_t ret_value = H5Pset_xfer( ... );
|
||||
if( ret_value < 0 )
|
||||
herr_t ret_value = H5Pset_dxpl_multi(id, memb_dxpl);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::setXfer",
|
||||
"H5Pset_xfer failed");
|
||||
throw PropListIException("DSetMemXferPropList::setMulti",
|
||||
"H5Pset_dxpl_multi failed");
|
||||
}
|
||||
}
|
||||
|
||||
// this function is in parallel mode only - not supported at this time.
|
||||
// Gets the transfer mode
|
||||
H5D_transfer_t DSetMemXferPropList::getXfer() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getMulti
|
||||
///\brief Returns multi-file data transfer property list information.
|
||||
///\param memb_dxpl - OUT: Array of data access property lists
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::getMulti(hid_t *memb_dxpl)
|
||||
{
|
||||
H5D_transfer_t xfer = H5Pget_xfer( id );
|
||||
// BMR - need to find out what the value is for ?? when this function
|
||||
// is supported
|
||||
if( xfer == ?? )
|
||||
herr_t ret_value = H5Pget_dxpl_multi(id, memb_dxpl);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::getXfer",
|
||||
"H5Pget_xfer failed");
|
||||
throw PropListIException("DSetMemXferPropList::getMulti",
|
||||
"H5Pget_dxpl_multi failed");
|
||||
}
|
||||
return( xfer );
|
||||
}
|
||||
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setSmallDataBlockSize
|
||||
///\brief Sets the size of a contiguous block reserved for small data.
|
||||
///\param size - IN: Maximum size, in bytes, of the small data block.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail, please refer to the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSmallData
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size)
|
||||
{
|
||||
herr_t ret_value = H5Pset_small_data_block_size(id, size);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize",
|
||||
"H5Pset_small_data_block_size failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getSmallDataBlockSize
|
||||
///\brief Returns the current small data block size setting.
|
||||
///\return Size of the small data block, in bytes
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t DSetMemXferPropList::getSmallDataBlockSize()
|
||||
{
|
||||
hsize_t size;
|
||||
herr_t ret_value = H5Pget_small_data_block_size(id, &size);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize",
|
||||
"H5Pget_small_data_block_size failed");
|
||||
}
|
||||
return(size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setHyperVectorSize
|
||||
///\brief Sets number of I/O vectors to be read/written in hyperslab I/O.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetHyperVectorSize
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setHyperVectorSize(size_t vector_size)
|
||||
{
|
||||
herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::setHyperVectorSize",
|
||||
"H5Pset_hyper_vector_size failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getSmallDataBlockSize
|
||||
///\brief Returns the number of I/O vectors to be read/written in
|
||||
/// hyperslab I/O.
|
||||
///\return Number of I/O vectors
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
size_t DSetMemXferPropList::getHyperVectorSize()
|
||||
{
|
||||
size_t vector_size;
|
||||
herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::getHyperVectorSize",
|
||||
"H5Pget_hyper_vector_size failed");
|
||||
}
|
||||
return(vector_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setEDCCheck
|
||||
///\brief Enables or disables error-detecting for a dataset reading
|
||||
/// process.
|
||||
///\param check - IN: Specifies whether error detection is enabled or
|
||||
/// disabled
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The error detection algorithm used is the algorithm previously
|
||||
/// specified in the corresponding dataset creation property
|
||||
/// list. This function does not affect the use of error
|
||||
/// detection in the writing process.
|
||||
///\par
|
||||
/// Valid values are as follows:
|
||||
/// \li \c H5Z_ENABLE_EDC (default)
|
||||
/// \li \c H5Z_DISABLE_EDC
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check)
|
||||
{
|
||||
herr_t ret_value = H5Pset_edc_check(id, check);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::setEDCCheck",
|
||||
"H5Pset_edc_check failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getEDCCheck
|
||||
///\brief Determines whether error-detection is enabled for dataset reads.
|
||||
///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - July, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5Z_EDC_t DSetMemXferPropList::getEDCCheck()
|
||||
{
|
||||
H5Z_EDC_t check = H5Pget_edc_check(id);
|
||||
if (check < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::getEDCCheck",
|
||||
"H5Pget_edc_check failed");
|
||||
}
|
||||
return(check);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetMemXferPropList::~DSetMemXferPropList() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -22,73 +22,93 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
public:
|
||||
// Default dataset memory and transfer property list.
|
||||
static const DSetMemXferPropList DEFAULT;
|
||||
|
||||
// Creates a dataset memory and transfer property list
|
||||
DSetMemXferPropList();
|
||||
|
||||
// Copy constructor: creates a copy of a DSetMemXferPropList object
|
||||
DSetMemXferPropList( const DSetMemXferPropList& orig );
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
// Sets type conversion and background buffers
|
||||
void setBuffer( hsize_t size, void* tconv, void* bkg ) const;
|
||||
// Sets type conversion and background buffers.
|
||||
void setBuffer( hsize_t size, void* tconv, void* bkg ) const;
|
||||
|
||||
// Reads buffer settings.
|
||||
hsize_t getBuffer( void** tconv, void** bkg ) const;
|
||||
|
||||
// Indicates whether to cache hyperslab blocks during I/O.
|
||||
void setHyperCache( bool cache, unsigned limit = 0 ) const;
|
||||
|
||||
// Returns information regarding the caching of hyperslab blocks during I/O.
|
||||
void getHyperCache( bool& cache, unsigned& limit ) const;
|
||||
|
||||
// Reads buffer settings
|
||||
hsize_t getBuffer( void** tconv, void** bkg ) const;
|
||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
||||
// Sets type conversion and background buffers
|
||||
void setBuffer( size_t size, void* tconv, void* bkg ) const;
|
||||
// Sets type conversion and background buffers.
|
||||
void setBuffer( size_t size, void* tconv, void* bkg ) const;
|
||||
|
||||
// Reads buffer settings
|
||||
size_t getBuffer( void** tconv, void** bkg ) const;
|
||||
// Reads buffer settings.
|
||||
size_t getBuffer( void** tconv, void** bkg ) const;
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
// Sets the dataset transfer property list status to TRUE or FALSE
|
||||
void setPreserve( bool status ) const;
|
||||
|
||||
// Checks status of the dataset transfer property list
|
||||
bool getPreserve() const;
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
// Indicates whether to cache hyperslab blocks during I/O
|
||||
void setHyperCache( bool cache, unsigned limit = 0 ) const;
|
||||
|
||||
// Returns information regarding the caching of hyperslab blocks during I/O
|
||||
void getHyperCache( bool& cache, unsigned& limit ) const;
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
// Sets B-tree split ratios for a dataset transfer property list
|
||||
// Sets B-tree split ratios for a dataset transfer property list.
|
||||
void setBtreeRatios( double left, double middle, double right ) const;
|
||||
|
||||
// Gets B-tree split ratios for a dataset transfer property list
|
||||
// Gets B-tree split ratios for a dataset transfer property list.
|
||||
void getBtreeRatios( double& left, double& middle, double& right ) const;
|
||||
|
||||
// Sets the dataset transfer property list status to TRUE or FALSE.
|
||||
void setPreserve( bool status ) const;
|
||||
|
||||
// Checks status of the dataset transfer property list.
|
||||
bool getPreserve() const;
|
||||
|
||||
// Sets the memory manager for variable-length datatype
|
||||
// allocation in H5Dread and H5Dvlen_reclaim
|
||||
// allocation in H5Dread and H5Dvlen_reclaim.
|
||||
void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info,
|
||||
H5MM_free_t free, void* free_info ) const;
|
||||
|
||||
// alloc and free are set to NULL, indicating that system
|
||||
// malloc and free are to be used
|
||||
// malloc and free are to be used.
|
||||
void setVlenMemManager() const;
|
||||
|
||||
// Gets the memory manager for variable-length datatype
|
||||
// allocation in H5Dread and H5Tvlen_reclaim
|
||||
// allocation in H5Dread and H5Tvlen_reclaim.
|
||||
void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info,
|
||||
H5MM_free_t& free, void** free_info ) const;
|
||||
|
||||
// Sets the transfer mode - parallel mode, not currently supported
|
||||
//void setXfer( H5D_transfer_t data_xfer_mode = H5D_XFER_INDEPENDENT ) const;
|
||||
// Sets the data transfer property list for the multi-file driver.
|
||||
void setMulti(const hid_t *memb_dxpl);
|
||||
|
||||
// Gets the transfer mode - parallel mode, not currently supported
|
||||
//H5D_transfer_t getXfer() const;
|
||||
// Returns multi-file data transfer property list information.
|
||||
void getMulti(hid_t *memb_dxpl);
|
||||
|
||||
// Sets the size of a contiguous block reserved for small data.
|
||||
void setSmallDataBlockSize(hsize_t size);
|
||||
|
||||
// Returns the current small data block size setting.
|
||||
hsize_t getSmallDataBlockSize();
|
||||
|
||||
// Sets number of I/O vectors to be read/written in hyperslab I/O.
|
||||
void setHyperVectorSize(size_t vector_size);
|
||||
|
||||
// Returns the number of I/O vectors to be read/written in
|
||||
// hyperslab I/O.
|
||||
size_t getHyperVectorSize();
|
||||
|
||||
// Enables or disables error-detecting for a dataset reading
|
||||
// process.
|
||||
void setEDCCheck(H5Z_EDC_t check);
|
||||
|
||||
// Determines whether error-detection is enabled for dataset reads.
|
||||
H5Z_EDC_t getEDCCheck();
|
||||
|
||||
// Default constructor: creates a dataset memory and transfer prop list.
|
||||
DSetMemXferPropList();
|
||||
|
||||
// Copy constructor: makes a copy of a DSetMemXferPropList object.
|
||||
DSetMemXferPropList(const DSetMemXferPropList& orig);
|
||||
|
||||
// Creates a copy of an existing dataset memory and transfer
|
||||
// property list using the property list id
|
||||
DSetMemXferPropList (const hid_t plist_id) : PropList( plist_id ) {}
|
||||
// property list using the property list id.
|
||||
DSetMemXferPropList (const hid_t plist_id);
|
||||
|
||||
// Default destructor
|
||||
// Noop destructor.
|
||||
virtual ~DSetMemXferPropList();
|
||||
|
||||
};
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5DxferProp.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DataSet.h"
|
||||
#include "H5AtomType.h"
|
||||
@@ -33,20 +35,48 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Creates an empty enumeration datatype based on a native signed
|
||||
// integer type.
|
||||
EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {}
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType default constructor
|
||||
///\brief Default constructor: Creates a stub datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType::EnumType() : DataType() {}
|
||||
|
||||
// Creates a enumeration datatype using an existing id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType overloaded constructor
|
||||
///\brief Creates an EnumType object using the id of an existing datatype.
|
||||
///\param existing_id - IN: Id of an existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType::EnumType( const hid_t existing_id ) : DataType( existing_id ) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original EnumType object.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original EnumType object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType::EnumType( const EnumType& original ) : DataType( original ) {}
|
||||
|
||||
// Gets the enum datatype of the specified dataset
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType overloaded constructor
|
||||
///\brief Creates an empty enumeration datatype given a size, in bytes.
|
||||
///\param size - IN: Number of bytes in the datatype to create
|
||||
///\exception H5::DataTypeIException
|
||||
// Description
|
||||
// The DataType constructor calls the C API H5Tcreate to create
|
||||
// the enum datatype.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType overloaded constructor
|
||||
///\brief Gets the enum datatype of the specified dataset.
|
||||
///\param dataset - IN: Dataset that this enum datatype associates with
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType::EnumType( const DataSet& dataset ) : DataType()
|
||||
{
|
||||
// Calls C function H5Dget_type to get the id of the datatype
|
||||
@@ -59,7 +89,13 @@ EnumType::EnumType( const DataSet& dataset ) : DataType()
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a new enum datatype based on an integer datatype
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType overloaded constructor
|
||||
///\brief Creates a new enum datatype based on an integer datatype.
|
||||
///\param data_type - IN: Base datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType::EnumType( const IntType& data_type ) : DataType()
|
||||
{
|
||||
// Calls C function H5Tenum_create to get the id of the datatype
|
||||
@@ -72,11 +108,14 @@ EnumType::EnumType( const IntType& data_type ) : DataType()
|
||||
}
|
||||
}
|
||||
|
||||
// Inserts a new member to this enumeration datatype.
|
||||
void EnumType::insert( const string& name, void *value ) const
|
||||
{
|
||||
insert( name.c_str(), value );
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::insert
|
||||
///\brief Inserts a new member to this enumeration datatype.
|
||||
///\param name - IN: Name of the new member
|
||||
///\param value - IN: Pointer to the value of the new member
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void EnumType::insert( const char* name, void *value ) const
|
||||
{
|
||||
// Calls C routine H5Tenum_insert to insert the new enum datatype member.
|
||||
@@ -87,7 +126,27 @@ void EnumType::insert( const char* name, void *value ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the symbol name corresponding to a specified member of an enumeration datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::insert
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void EnumType::insert( const string& name, void *value ) const
|
||||
{
|
||||
insert( name.c_str(), value );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::nameOf
|
||||
///\brief Returns the symbol name corresponding to a specified member
|
||||
/// of this enumeration datatype.
|
||||
///\param value - IN: Pointer to the value of the enum datatype
|
||||
///\param size - IN: Size for the name
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string EnumType::nameOf( void *value, size_t size ) const
|
||||
{
|
||||
char* name_C = new char[size+1]; // temporary C-string for C API
|
||||
@@ -102,16 +161,19 @@ string EnumType::nameOf( void *value, size_t size ) const
|
||||
}
|
||||
// otherwise, create the string to hold the datatype name and return it
|
||||
string name = string( name_C );
|
||||
delete name_C;
|
||||
delete [] name_C;
|
||||
return( name );
|
||||
}
|
||||
|
||||
// Retrieves the value corresponding to a member of an enumeration
|
||||
// datatype, given the member's name.
|
||||
void EnumType::valueOf( const string& name, void *value ) const
|
||||
{
|
||||
valueOf( name.c_str(), value );
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::valueOf
|
||||
///\brief Retrieves the value corresponding to a member of this
|
||||
/// enumeration datatype, given the member's name.
|
||||
///\param name - IN: Name of the queried member
|
||||
///\param value - OUT: Pointer to the retrieved value
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void EnumType::valueOf( const char* name, void *value ) const
|
||||
{
|
||||
// Calls C routine H5Tenum_valueof to get the enum datatype value
|
||||
@@ -122,20 +184,28 @@ void EnumType::valueOf( const char* name, void *value ) const
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: getMemberIndex
|
||||
*
|
||||
* Purpose: Returns the index of a member in an enumeration data type.
|
||||
* Members are stored in no particular order with numbers 0
|
||||
* through N-1, where N is the value returned by the member
|
||||
* function getNmembers.
|
||||
*
|
||||
* Return: Success: index of the member if exists.
|
||||
* Failure: DataTypeIException
|
||||
*
|
||||
* BMR - May 16, 2002
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::valueOf
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void EnumType::valueOf( const string& name, void *value ) const
|
||||
{
|
||||
valueOf( name.c_str(), value );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::getMemberIndex
|
||||
///\brief Returns the index of a member in this enumeration datatype.
|
||||
///\param name - IN: Name of the queried member
|
||||
///\return Index of the member if it exists. Index will have the value
|
||||
/// between 0 and \c N-1, where \c N is the value returned by the
|
||||
/// member function \c EnumType::getNmembers.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May 16, 2002
|
||||
//--------------------------------------------------------------------------
|
||||
int EnumType::getMemberIndex(const char *name) const
|
||||
{
|
||||
int member_index = H5Tget_member_index(id, name);
|
||||
@@ -146,13 +216,46 @@ int EnumType::getMemberIndex(const char *name) const
|
||||
}
|
||||
return( member_index );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::getMemberIndex
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - May 16, 2002
|
||||
//--------------------------------------------------------------------------
|
||||
int EnumType::getMemberIndex(const string& name) const
|
||||
{
|
||||
return(EnumType::getMemberIndex(name.c_str()));
|
||||
}
|
||||
|
||||
// Retrieves the value of a member in this enumeration datatype, given the
|
||||
// member's index.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::getNmembers
|
||||
///\brief Returns the number of members in this enumeration datatype.
|
||||
///\return Number of members
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
int EnumType::getNmembers() const
|
||||
{
|
||||
int num_members = H5Tget_nmembers( id );
|
||||
if( num_members < 0 )
|
||||
{
|
||||
throw DataTypeIException("CompType::getNmembers",
|
||||
"H5Tget_nmembers returns negative number of members");
|
||||
}
|
||||
return( num_members );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType::getMemberValue
|
||||
///\brief Retrieves the value of a member in this enumeration datatype,
|
||||
/// given the member's index.
|
||||
///\param memb_no - IN: Index of the queried member
|
||||
///\param value - OUT: Pointer to the retrieved value
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void EnumType::getMemberValue( int memb_no, void *value ) const
|
||||
{
|
||||
// Call C routine H5Tget_member_value to get the datatype member's value
|
||||
@@ -163,7 +266,11 @@ void EnumType::getMemberValue( int memb_no, void *value ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType destructor
|
||||
///\brief Properly terminates access to this enum datatype.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType::~EnumType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -27,6 +27,35 @@ class H5_DLLCPP EnumType : public DataType {
|
||||
// integer type, whose size is given by size.
|
||||
EnumType( size_t size );
|
||||
|
||||
// Gets the enum datatype of the specified dataset
|
||||
EnumType( const DataSet& dataset ); // H5Dget_type
|
||||
|
||||
// Creates a new enum datatype based on an integer datatype
|
||||
EnumType( const IntType& data_type ); // H5Tenum_create
|
||||
|
||||
// Returns the number of members in this enumeration datatype.
|
||||
int getNmembers () const;
|
||||
|
||||
// Returns the index of a member in this enumeration data type.
|
||||
int getMemberIndex(const char* name) const;
|
||||
int getMemberIndex(const string& name) const;
|
||||
|
||||
// Returns the value of an enumeration datatype member
|
||||
void getMemberValue( int memb_no, void *value ) const;
|
||||
|
||||
// Inserts a new member to this enumeration type.
|
||||
void insert( const char* name, void *value ) const;
|
||||
void insert( const string& name, void *value ) const;
|
||||
|
||||
// Returns the symbol name corresponding to a specified member
|
||||
// of this enumeration datatype.
|
||||
string nameOf( void *value, size_t size ) const;
|
||||
|
||||
// Returns the value corresponding to a specified member of this
|
||||
// enumeration datatype.
|
||||
void valueOf( const char* name, void *value ) const;
|
||||
void valueOf( const string& name, void *value ) const;
|
||||
|
||||
// Default constructor
|
||||
EnumType();
|
||||
|
||||
@@ -36,32 +65,6 @@ class H5_DLLCPP EnumType : public DataType {
|
||||
// Copy constructor: makes a copy of the original EnumType object.
|
||||
EnumType( const EnumType& original );
|
||||
|
||||
// Gets the enum datatype of the specified dataset
|
||||
EnumType( const DataSet& dataset ); // H5Dget_type
|
||||
|
||||
// Creates a new enum datatype based on an integer datatype
|
||||
EnumType( const IntType& data_type ); // H5Tenum_create
|
||||
|
||||
// Inserts a new member to this enumeration type.
|
||||
void insert( const string& name, void *value ) const;
|
||||
void insert( const char* name, void *value ) const;
|
||||
|
||||
// Returns the symbol name corresponding to a specified member
|
||||
// of this enumeration datatype.
|
||||
string nameOf( void *value, size_t size ) const;
|
||||
|
||||
// Returns the value corresponding to a specified member of this
|
||||
// enumeration datatype.
|
||||
void valueOf( const string& name, void *value ) const;
|
||||
void valueOf( const char* name, void *value ) const;
|
||||
|
||||
// Returns the index of a member in this enumeration data type.
|
||||
int getMemberIndex(const char* name) const;
|
||||
int getMemberIndex(const string& name) const;
|
||||
|
||||
// Returns the value of an enumeration datatype member
|
||||
void getMemberValue( int memb_no, void *value ) const;
|
||||
|
||||
virtual ~EnumType();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
@@ -22,62 +22,92 @@ namespace H5 {
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
Exception::Exception() : detailMessage(""), funcName("") {}
|
||||
const string Exception::DEFAULT_MSG("No detailed information provided");
|
||||
|
||||
// Constructor taking only a detailed message as string object
|
||||
//Exception::Exception(const string& message) : detailMessage(message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception default constructor
|
||||
///\brief Default constructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Exception::Exception() : detail_message(""), func_name("") {}
|
||||
|
||||
// Constructor taking a function name and a detailed message as string objects
|
||||
Exception::Exception(const string& func_name, const string& message) : detailMessage(message), funcName(func_name) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception overloaded constructor
|
||||
///\brief Creates an exception with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Exception::Exception(const string func_name, const string message) : detail_message(message), func_name(func_name) {}
|
||||
|
||||
// Constructor taking a detailed message as character string
|
||||
// digital alpha (gondolin) produces compilation error at static_cast<string>
|
||||
// so I replaced this constructor by the one below it
|
||||
//Exception::Exception( const char* message) : detailMessage(static_cast<string>(message)) {}
|
||||
//Exception::Exception(const char* message)
|
||||
//{
|
||||
//detailMessage = string(message);
|
||||
//}
|
||||
|
||||
// Constructor taking a function name and a detailed message as character
|
||||
// strings
|
||||
Exception::Exception(const char* func_name, const char* message)
|
||||
{
|
||||
detailMessage = string(message);
|
||||
if (func_name != NULL)
|
||||
funcName = string(func_name);
|
||||
}
|
||||
|
||||
// copy constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original Exception object.
|
||||
///\param orig - IN: Exception instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Exception::Exception( const Exception& orig )
|
||||
{
|
||||
detailMessage = orig.detailMessage;
|
||||
funcName = orig.funcName;
|
||||
detail_message = orig.detail_message;
|
||||
func_name = orig.func_name;
|
||||
}
|
||||
|
||||
// Returns the character string that describes an error specified by
|
||||
// a major error number.
|
||||
string Exception::getMajorString( H5E_major_t major_num ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getMajorString
|
||||
///\brief Returns a text string that describes the error
|
||||
/// specified by a major error number.
|
||||
///\param err_major - IN: Major error number
|
||||
///\return Major error string
|
||||
///\par Description
|
||||
/// In the failure case, the string "Invalid major error number"
|
||||
/// will be returned.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string Exception::getMajorString(H5E_major_t err_major) const
|
||||
{
|
||||
// calls the C API routine to get the major string - Note: in the
|
||||
// failure case, the string "Invalid major error number" will be returned.
|
||||
string major_str( H5Eget_major( major_num ));
|
||||
string major_str(H5Eget_major(err_major));
|
||||
return( major_str );
|
||||
}
|
||||
|
||||
// Returns the character string that describes an error specified by
|
||||
// a minor error number.
|
||||
string Exception::getMinorString( H5E_minor_t minor_num ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getMinorString
|
||||
///\brief Returns a text string that describes the error
|
||||
/// specified by a minor error number.
|
||||
///\param err_minor - IN: Minor error number
|
||||
///\return Minor error string
|
||||
///\par Description
|
||||
/// In the failure case, the string "Invalid minor error number"
|
||||
/// will be returned.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string Exception::getMinorString(H5E_minor_t err_minor) const
|
||||
{
|
||||
// calls the C API routine to get the minor string - Note: in the
|
||||
// failure case, the string "Invalid minor error number" will be returned.
|
||||
string minor_str( H5Eget_minor( minor_num ));
|
||||
string minor_str(H5Eget_minor(err_minor));
|
||||
return( minor_str );
|
||||
}
|
||||
|
||||
// Turns on the automatic error printing.
|
||||
void Exception::setAutoPrint( H5E_auto_t func, void* client_data )
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::setAutoPrint
|
||||
///\brief Turns on the automatic error printing.
|
||||
///\param func - IN: Function to be called upon an error condition
|
||||
///\param client_data - IN: Data passed to the error function
|
||||
///\par Description
|
||||
/// When the library is first initialized the auto printing
|
||||
/// function, \a func, is set to the C API \c H5Eprint and
|
||||
/// \a client_data is the standard error stream pointer, \c stderr.
|
||||
/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD
|
||||
/// direction.
|
||||
///\par
|
||||
/// Users are encouraged to write their own more specific error
|
||||
/// handlers
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::setAutoPrint( H5E_auto_t& func, void* client_data )
|
||||
{
|
||||
// calls the C API routine H5Eset_auto to set the auto printing to
|
||||
// the specified function.
|
||||
@@ -86,7 +116,11 @@ void Exception::setAutoPrint( H5E_auto_t func, void* client_data )
|
||||
throw Exception( "Exception::setAutoPrint", "H5Eset_auto failed" );
|
||||
}
|
||||
|
||||
// Turns off the automatic error printing.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::dontPrint
|
||||
///\brief Turns off the automatic error printing from the C library.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::dontPrint()
|
||||
{
|
||||
// calls the C API routine H5Eset_auto with NULL parameters to turn
|
||||
@@ -96,8 +130,16 @@ void Exception::dontPrint()
|
||||
throw Exception( "Exception::dontPrint", "H5Eset_auto failed" );
|
||||
}
|
||||
|
||||
// Retrieves the current settings for the automatic error stack traversal
|
||||
// function and its data.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getAutoPrint
|
||||
///\brief Retrieves the current settings for the automatic error
|
||||
/// stack traversal function and its data.
|
||||
///\param func - OUT: Current setting for the function to be
|
||||
/// called upon an error condition
|
||||
///\param client_data - OUT: Current setting for the data passed to
|
||||
/// the error function
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::getAutoPrint( H5E_auto_t& func, void** client_data )
|
||||
{
|
||||
// calls the C API routine H5Eget_auto to get the current setting of
|
||||
@@ -107,7 +149,14 @@ void Exception::getAutoPrint( H5E_auto_t& func, void** client_data )
|
||||
throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" );
|
||||
}
|
||||
|
||||
// Clears the error stack for the current thread.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::clearErrorStack
|
||||
///\brief Clears the error stack for the current thread.
|
||||
///\par Description
|
||||
/// The stack is also cleared whenever a C API function is
|
||||
/// called, with certain exceptions (for instance, \c H5Eprint).
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::clearErrorStack()
|
||||
{
|
||||
// calls the C API routine H5Eclear to clear the error stack
|
||||
@@ -116,7 +165,47 @@ void Exception::clearErrorStack()
|
||||
throw Exception( "Exception::clearErrorStack", "H5Eclear failed" );
|
||||
}
|
||||
|
||||
// Walks the error stack for the current thread, calling the specified function.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::walkErrorStack
|
||||
///\brief Walks the error stack for the current thread, calling the
|
||||
/// specified function.
|
||||
///\param direction - IN: Direction in which the error stack is to be walked
|
||||
///\param func - IN: Function to be called for each error encountered
|
||||
///\param client_data - IN: Data passed to the error function
|
||||
///\par Description
|
||||
/// Valid values for \a direction include:
|
||||
/// \li \c H5E_WALK_UPWARD - begin with the most specific error
|
||||
/// and end at the API
|
||||
/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the
|
||||
/// inner-most function where the error was first detected
|
||||
///\par
|
||||
/// The function specified by \a func will be called for each
|
||||
/// error in the error stack. The \c H5E_walk_t prototype is as
|
||||
/// follows:
|
||||
///\code
|
||||
/// typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data)
|
||||
/// int n - Indexed position of the error in the stack; it begins at zero
|
||||
/// regardless of stack traversal direction
|
||||
/// H5E_error_t *err_desc - Pointer to a data structure describing the
|
||||
/// error. This structure is listed below.
|
||||
/// void *client_data - Pointer to client data in the format expected by
|
||||
/// the user-defined function.
|
||||
///\endcode
|
||||
///\par
|
||||
/// Data structure to describe the error:
|
||||
///\code
|
||||
/// typedef struct H5E_error_t {
|
||||
/// hid_t cls_id; //class ID
|
||||
/// hid_t maj_num; //major error ID
|
||||
/// hid_t min_num; //minor error number
|
||||
/// const char *func_name; //function in which error occurred
|
||||
/// const char *file_name; //file in which error occurred
|
||||
/// unsigned line; //line in file where error occurs
|
||||
/// const char *desc; //optional supplied description
|
||||
/// } H5E_error_t;
|
||||
///\endcode
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk_t func, void* client_data )
|
||||
{
|
||||
// calls the C API routine H5Ewalk to walk the error stack
|
||||
@@ -125,87 +214,301 @@ void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk_t func, void
|
||||
throw Exception( "Exception::walkErrorStack", "H5Ewalk failed" );
|
||||
}
|
||||
|
||||
// Returns the detailed message set at the time the exception is thrown
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getDetailMsg
|
||||
///\brief Returns the detailed message set at the time the exception
|
||||
/// is thrown.
|
||||
///\return Text message - \c std::string
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string Exception::getDetailMsg() const
|
||||
{
|
||||
return(detailMessage);
|
||||
return(detail_message);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getCDetailMsg
|
||||
///\brief Returns the detailed message set at the time the exception
|
||||
/// is thrown.
|
||||
///\return Text message - \c char pointer
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
const char* Exception::getCDetailMsg() const
|
||||
{
|
||||
return(detailMessage.c_str());
|
||||
return(detail_message.c_str());
|
||||
}
|
||||
|
||||
// Returns the function name where the exception is thrown
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getFuncName
|
||||
///\brief Returns the name of the function, where the exception is thrown.
|
||||
///\return Text message - \c std::string
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
string Exception::getFuncName() const
|
||||
{
|
||||
return(funcName);
|
||||
}
|
||||
const char* Exception::getCFuncName() const
|
||||
{
|
||||
return(funcName.c_str());
|
||||
return(func_name);
|
||||
}
|
||||
|
||||
// Prints the error stack in a default manner.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getCFuncName
|
||||
///\brief Returns the name of the function, where the exception is thrown.
|
||||
///\return Text message - \c char pointer
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
const char* Exception::getCFuncName() const
|
||||
{
|
||||
return(func_name.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::printError
|
||||
///\brief Prints the error stack in a default manner.
|
||||
///\param stream - IN: File pointer
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::printError( FILE* stream ) const
|
||||
{
|
||||
herr_t ret_value = H5Eprint( NULL ); // print to stderr
|
||||
herr_t ret_value = H5Eprint(stream); // print to stderr
|
||||
if( ret_value < 0 )
|
||||
throw Exception( "Exception::printError", "H5Eprint failed" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception destructor
|
||||
///\brief Noop destructor
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Exception::~Exception() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: FileIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
FileIException::FileIException():Exception(){}
|
||||
FileIException::FileIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
FileIException::FileIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileIException overloaded constructor
|
||||
///\brief Creates a FileIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
FileIException::FileIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
FileIException::~FileIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: GroupIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
GroupIException::GroupIException():Exception(){}
|
||||
GroupIException::GroupIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
GroupIException::GroupIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: GroupIException overloaded constructor
|
||||
///\brief Creates a GroupIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
GroupIException::GroupIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: GroupIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
GroupIException::~GroupIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpaceIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpaceIException::DataSpaceIException():Exception(){}
|
||||
DataSpaceIException::DataSpaceIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
DataSpaceIException::DataSpaceIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpaceIException overloaded constructor
|
||||
///\brief Creates a DataSpaceIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpaceIException::DataSpaceIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpaceIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpaceIException::~DataSpaceIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataTypeIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataTypeIException::DataTypeIException():Exception(){}
|
||||
DataTypeIException::DataTypeIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
DataTypeIException::DataTypeIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataTypeIException overloaded constructor
|
||||
///\brief Creates a DataTypeIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
DataTypeIException::DataTypeIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataTypeIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataTypeIException::~DataTypeIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropListIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
PropListIException::PropListIException():Exception(){}
|
||||
PropListIException::PropListIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
PropListIException::PropListIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropListIException overloaded constructor
|
||||
///\brief Creates a PropListIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
PropListIException::PropListIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropListIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
PropListIException::~PropListIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSetIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSetIException::DataSetIException():Exception(){}
|
||||
DataSetIException::DataSetIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
DataSetIException::DataSetIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSetIException overloaded constructor
|
||||
///\brief Creates a DataSetIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
DataSetIException::DataSetIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSetIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSetIException::~DataSetIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AttributeIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
AttributeIException::AttributeIException():Exception(){}
|
||||
AttributeIException::AttributeIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
AttributeIException::AttributeIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AttributeIException overloaded constructor
|
||||
///\brief Creates an AttributeIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
AttributeIException::AttributeIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AttributeIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
AttributeIException::~AttributeIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: ReferenceException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ReferenceException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
ReferenceException::ReferenceException():Exception(){}
|
||||
ReferenceException::ReferenceException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
ReferenceException::ReferenceException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ReferenceException overloaded constructor
|
||||
///\brief Creates a ReferenceException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
ReferenceException::ReferenceException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: ReferenceException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
ReferenceException::~ReferenceException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: LibraryIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: LibraryIException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
LibraryIException::LibraryIException():Exception(){}
|
||||
LibraryIException::LibraryIException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
LibraryIException::LibraryIException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: LibraryIException overloaded constructor
|
||||
///\brief Creates a LibraryIException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
LibraryIException::LibraryIException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: LibraryIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
LibraryIException::~LibraryIException() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: IdComponentException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponentException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponentException::IdComponentException(): Exception() {}
|
||||
IdComponentException::IdComponentException(const string& func_name, const string& message) : Exception(func_name, message) {}
|
||||
IdComponentException::IdComponentException(const char* func_name, const char* message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponentException overloaded constructor
|
||||
///\brief Creates a IdComponentException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponentException::IdComponentException(const string func_name, const string message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponentException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponentException::~IdComponentException() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
#endif
|
||||
|
||||
@@ -27,22 +27,15 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP Exception {
|
||||
public:
|
||||
// Default constructor
|
||||
Exception();
|
||||
|
||||
// Creates an exception with a function name where the failure occurs
|
||||
// and an optional detailed message
|
||||
Exception( const string& func_name, const string& message = 0);
|
||||
Exception( const char* func_name, const char* message = NULL);
|
||||
Exception(const string func_name, const string message = DEFAULT_MSG);
|
||||
|
||||
// copy constructor
|
||||
Exception( const Exception& orig);
|
||||
|
||||
// Returns the character string that describes an error specified by
|
||||
// Returns a character string that describes the error specified by
|
||||
// a major error number.
|
||||
string getMajorString( H5E_major_t major_num ) const;
|
||||
|
||||
// Returns the character string that describes an error specified by
|
||||
// Returns a character string that describes the error specified by
|
||||
// a minor error number.
|
||||
string getMinorString( H5E_minor_t minor_num ) const;
|
||||
|
||||
@@ -53,7 +46,7 @@ class H5_DLLCPP Exception {
|
||||
const char* getCFuncName() const; // function name as a char string
|
||||
|
||||
// Turns on the automatic error printing.
|
||||
static void setAutoPrint( H5E_auto_t func, void* client_data);
|
||||
static void setAutoPrint( H5E_auto_t& func, void* client_data);
|
||||
|
||||
// Turns off the automatic error printing.
|
||||
static void dontPrint();
|
||||
@@ -73,6 +66,12 @@ class H5_DLLCPP Exception {
|
||||
// Prints the error stack in a default manner.
|
||||
virtual void printError( FILE* stream = NULL ) const;
|
||||
|
||||
// Default constructor
|
||||
Exception();
|
||||
|
||||
// copy constructor
|
||||
Exception( const Exception& orig);
|
||||
|
||||
// virtual Destructor
|
||||
virtual ~Exception();
|
||||
|
||||
@@ -83,87 +82,81 @@ class H5_DLLCPP Exception {
|
||||
#if defined(WIN32)
|
||||
#pragma warning(disable: 4251)
|
||||
#endif
|
||||
string detailMessage;
|
||||
string funcName;
|
||||
string detail_message;
|
||||
string func_name;
|
||||
|
||||
protected:
|
||||
// Default value for detail_message
|
||||
static const string DEFAULT_MSG;
|
||||
};
|
||||
|
||||
class H5_DLLCPP FileIException : public Exception {
|
||||
public:
|
||||
FileIException( const string func_name, const string message = DEFAULT_MSG);
|
||||
FileIException();
|
||||
FileIException( const string& func_name, const string& message = NULL);
|
||||
FileIException( const char* func_name, const char* message = NULL);
|
||||
virtual ~FileIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP GroupIException : public Exception {
|
||||
public:
|
||||
GroupIException( const string func_name, const string message = DEFAULT_MSG);
|
||||
GroupIException();
|
||||
GroupIException( const string& func_name, const string& message=NULL);
|
||||
GroupIException( const char* func_name, const char* message = NULL);
|
||||
virtual ~GroupIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP DataSpaceIException : public Exception {
|
||||
public:
|
||||
DataSpaceIException(const string func_name, const string message = DEFAULT_MSG);
|
||||
DataSpaceIException();
|
||||
DataSpaceIException(const string& func_name, const string& message=NULL);
|
||||
DataSpaceIException(const char* func_name, const char* message = NULL);
|
||||
virtual ~DataSpaceIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP DataTypeIException : public Exception {
|
||||
public:
|
||||
DataTypeIException(const string func_name, const string message = DEFAULT_MSG);
|
||||
DataTypeIException();
|
||||
DataTypeIException(const string& func_name, const string& message = NULL);
|
||||
DataTypeIException(const char* func_name, const char* message = NULL);
|
||||
virtual ~DataTypeIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP PropListIException : public Exception {
|
||||
public:
|
||||
PropListIException(const string func_name, const string message = DEFAULT_MSG);
|
||||
PropListIException();
|
||||
PropListIException(const string& func_name, const string& message=NULL);
|
||||
PropListIException(const char* func_name, const char* message = NULL);
|
||||
virtual ~PropListIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP DataSetIException : public Exception {
|
||||
public:
|
||||
DataSetIException(const string func_name, const string message = DEFAULT_MSG);
|
||||
DataSetIException();
|
||||
DataSetIException(const string& func_name, const string& message=NULL);
|
||||
DataSetIException(const char* func_name, const char* message = NULL);
|
||||
virtual ~DataSetIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP AttributeIException : public Exception {
|
||||
public:
|
||||
AttributeIException(const string func_name, const string message = DEFAULT_MSG);
|
||||
AttributeIException();
|
||||
AttributeIException(const string& func_name, const string& message=NULL);
|
||||
AttributeIException(const char* func_name, const char* message = NULL);
|
||||
virtual ~AttributeIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP ReferenceException : public Exception {
|
||||
public:
|
||||
ReferenceException(const string func_name, const string message = DEFAULT_MSG);
|
||||
ReferenceException();
|
||||
ReferenceException(const string& func_name, const string& message=NULL);
|
||||
ReferenceException(const char* func_name, const char* message = NULL);
|
||||
virtual ~ReferenceException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP LibraryIException : public Exception {
|
||||
public:
|
||||
LibraryIException(const string func_name, const string message = DEFAULT_MSG);
|
||||
LibraryIException();
|
||||
LibraryIException(const string& func_name, const string& message=NULL);
|
||||
LibraryIException(const char* func_name, const char* message = NULL);
|
||||
virtual ~LibraryIException();
|
||||
};
|
||||
|
||||
class H5_DLLCPP IdComponentException : public Exception {
|
||||
public:
|
||||
IdComponentException(const string func_name, const string message = DEFAULT_MSG);
|
||||
IdComponentException();
|
||||
IdComponentException(const string& func_name, const string& message=NULL);
|
||||
IdComponentException(const char* func_name, const char* message = NULL);
|
||||
virtual ~IdComponentException();
|
||||
};
|
||||
|
||||
|
||||
@@ -25,145 +25,457 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default property
|
||||
//--------------------------------------------------------------------------
|
||||
const FileAccPropList FileAccPropList::DEFAULT( H5P_DEFAULT );
|
||||
|
||||
// Creates a file access property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList default constructor
|
||||
///\brief Default constructor: creates a file access property list.
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original FileAccPropList object;
|
||||
FileAccPropList::FileAccPropList( const FileAccPropList& orig ) : PropList( orig ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original FileAccPropList.
|
||||
/// FileAccPropList object
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileAccPropList::FileAccPropList(const FileAccPropList& orig) : PropList(orig) {}
|
||||
|
||||
/* commented out for 1.3.x, only in 1.2.x
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList overloaded constructor
|
||||
///\brief Creates a file access property list using the id of an
|
||||
/// existing one.
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setStdio
|
||||
///\brief Modifies this property list to use the \c H5FD_STDIO driver.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setStdio() const
|
||||
{
|
||||
herr_t ret_value = H5Pset_stdio( id );
|
||||
herr_t ret_value = H5Pset_fapl_stdio(id);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setStdio", "H5Pset_stdio failed");
|
||||
throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed");
|
||||
}
|
||||
}
|
||||
|
||||
bool FileAccPropList::getStdio() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getDriver
|
||||
///\brief Return the ID of the low-level file driver.
|
||||
///\return A low-level driver ID which is the same ID used when the
|
||||
/// driver was set for the property list. The driver ID is
|
||||
/// only valid as long as the file driver remains registered.
|
||||
/// Valid driver identifiers can be found at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t FileAccPropList::getDriver() const
|
||||
{
|
||||
herr_t ret_value = H5Pget_stdio( id );
|
||||
if( ret_value < 0 )
|
||||
return( false );
|
||||
else
|
||||
return( true );
|
||||
}
|
||||
|
||||
H5F_driver_t FileAccPropList::getDriver() const
|
||||
{
|
||||
H5F_driver_t driver = H5Pget_driver( id );
|
||||
if( driver == H5F_LOW_ERROR )
|
||||
hid_t driver = H5Pget_driver( id );
|
||||
if (driver < 0)
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed");
|
||||
}
|
||||
return( driver );
|
||||
}
|
||||
|
||||
void FileAccPropList::setSec2() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setDriver
|
||||
///\brief Set file driver for this property list.
|
||||
///\param new_driver_id - IN: File driver
|
||||
///\param new_driver_info - IN: Struct containing the driver-specific properites
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For a list of valid driver identifiers, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_sec2( id );
|
||||
if( ret_value < 0 )
|
||||
herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setSec2", "H5Pset_sec2 failed");
|
||||
throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed");
|
||||
}
|
||||
}
|
||||
|
||||
bool FileAccPropList::getSec2() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setFamilyOffset
|
||||
///\brief Sets offset for family driver.
|
||||
///\param offset - IN: offset value
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setFamilyOffset(hsize_t offset) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_sec2( id );
|
||||
if( ret_value < 0 )
|
||||
return( false );
|
||||
else
|
||||
return( true );
|
||||
}
|
||||
|
||||
void FileAccPropList::setCore( size_t increment ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_core( id, increment );
|
||||
if( ret_value < 0 )
|
||||
herr_t ret_value = H5Pset_family_offset(id, offset);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setCore", "H5Pset_core failed");
|
||||
throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed");
|
||||
}
|
||||
}
|
||||
|
||||
bool FileAccPropList::getCore( size_t& increment) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getFamilyOffset
|
||||
///\brief Get offset for family driver.
|
||||
///\return Offset for family driver
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t FileAccPropList::getFamilyOffset() const
|
||||
{
|
||||
herr_t ret_value = H5Pget_core( id, &increment );
|
||||
if( ret_value < 0 )
|
||||
return( false );
|
||||
else
|
||||
return( true );
|
||||
hsize_t offset;
|
||||
herr_t ret_value = H5Pget_family_offset(id, &offset);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed");
|
||||
}
|
||||
return(offset);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setCore
|
||||
///\brief Modifies this file access property list to use the \c H5FD_CORE
|
||||
/// driver.
|
||||
///\param increment - IN: Specifies how much memory to increase each
|
||||
/// time more memory is needed, in bytes
|
||||
///\param backing_store - IN: Indicating whether to write the file
|
||||
/// contents to disk when the file is closed
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For more details on the use of \c H5FD_CORE driver, please
|
||||
/// refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplCore
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getCore
|
||||
///\brief Queries core file driver properties.
|
||||
///\param increment - OUT: Size of memory increment, in bytes
|
||||
///\param backing_store - OUT: Indicating whether to write the file
|
||||
/// contents to disk when the file is closed
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setFamily
|
||||
///\brief Sets this file access property list to use the family driver.
|
||||
///\param memb_size - IN: Size in bytes of each file member
|
||||
///\param memb_plist - IN: File access property list to be used for
|
||||
/// each family member
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Note that \a memb_size is used only when creating a new file.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_family( id, memb_size, memb_plist.getId() );
|
||||
herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId() );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setFamily", "H5Pset_family failed");
|
||||
throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed");
|
||||
}
|
||||
}
|
||||
|
||||
//Note: working on this return value here. added copy constructor
|
||||
//that uses PropList copy const. but din't work
|
||||
// Determines whether the file access property list is set to the family
|
||||
// driver then retrieves the family member's property list and returns
|
||||
// true or false
|
||||
bool FileAccPropList::getFamily( hsize_t& memb_size, FileAccPropList& memb_plist ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getFamily
|
||||
///\brief Returns information about the family file access property
|
||||
/// list.
|
||||
///\param memb_size - OUT: Size in bytes of each file member
|
||||
///\param memb_plist - OUT: Retrieved file access property list for each
|
||||
/// file member
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const
|
||||
{
|
||||
hid_t memb_plist_id;
|
||||
herr_t ret_value = H5Pget_family( id, &memb_size, &memb_plist_id );
|
||||
herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
memb_plist.setId( 0 );
|
||||
return( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
memb_plist.setId( memb_plist_id );
|
||||
return( true );
|
||||
throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed");
|
||||
}
|
||||
memb_plist.setId(memb_plist_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getFamily
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts and its return value.
|
||||
///\param memb_size - OUT: Size in bytes of each file member
|
||||
///\return The file access property list for each file member
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const
|
||||
{
|
||||
hid_t memb_plist_id;
|
||||
herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed");
|
||||
}
|
||||
FileAccPropList memb_plist(memb_plist_id);
|
||||
return(memb_plist);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setSplit
|
||||
///\brief Emulates the old split file driver, which stored meta data
|
||||
/// in one file and raw data in another file.
|
||||
///\param meta_plist - IN: File access plist for the metadata file
|
||||
///\param raw_plist - IN: File access plist for the raw data file
|
||||
///\param meta_ext - IN: Metadata filename extension as \c char*
|
||||
///\param raw_ext - IN: Raw data filename extension as \c char*
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Temporary - For information, please refer to:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplSplit
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const
|
||||
{
|
||||
hid_t meta_pid = meta_plist.getId();
|
||||
hid_t raw_pid = raw_plist.getId();
|
||||
herr_t ret_value = H5Pset_split( id, meta_ext, meta_pid, raw_ext, raw_pid );
|
||||
herr_t ret_value = H5Pset_fapl_split( id, meta_ext, meta_pid, raw_ext, raw_pid );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setSplit", "H5Pset_split failed");
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setSplit
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param meta_plist - IN: File access plist for the metadata file
|
||||
///\param raw_plist - IN: File access plist for the raw data file
|
||||
///\param meta_ext - IN: Metadata filename extension as \c string
|
||||
///\param raw_ext - IN: Raw data filename extension as \c string
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const string& meta_ext, const string& raw_ext ) const
|
||||
{
|
||||
setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() );
|
||||
}
|
||||
|
||||
void FileAccPropList::getSplit( size_t meta_ext_size, string& meta_ext, FileAccPropList& meta_plist, size_t raw_ext_size, string& raw_ext, FileAccPropList& raw_plist ) const
|
||||
#ifdef H5_HAVE_STREAM // for Stream Virtual File Driver
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getStream
|
||||
///\brief Retrieves the streaming I/O driver settings
|
||||
///\return The streaming I/O file access property list structure
|
||||
/// For detail on this structure, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5FD_stream_fapl_t FileAccPropList::getStream() const
|
||||
{
|
||||
hid_t meta_plist_id, raw_plist_id; // meta-data and raw-data plist ids
|
||||
char* meta_ext_C = new char[meta_ext_size]; // meta-data extension in C
|
||||
char* raw_ext_C = new char[raw_ext_size]; // raw-data extension in C
|
||||
herr_t ret_value = H5Pget_split( id, meta_ext_size, meta_ext_C,
|
||||
&meta_plist_id, raw_ext_size, raw_ext_C, &raw_plist_id );
|
||||
H5FD_stream_fapl_t fapl;
|
||||
herr_t ret_value = H5Pget_fapl_stream(id, &fapl);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getSplit", "H5Pget_split failed");
|
||||
throw PropListIException("FileAccPropList::getStream", "H5Pget_fapl_stream failed");
|
||||
}
|
||||
meta_plist.setId( meta_plist_id );
|
||||
raw_plist.setId( raw_plist_id );
|
||||
raw_ext = string( raw_ext_C );
|
||||
meta_ext = string( raw_ext_C );
|
||||
delete [] raw_ext_C;
|
||||
delete [] meta_ext_C;
|
||||
return(fapl);
|
||||
}
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setStream
|
||||
///\brief Modifies this file access property list to use the Stream
|
||||
/// driver.
|
||||
///\param fapl - IN: The streaming I/O file access property list
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on \a fapl, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setStream(H5FD_stream_fapl_t &fapl) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_fapl_stream (id, &fapl);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setStream", "H5Pset_fapl_stream failed");
|
||||
}
|
||||
}
|
||||
#endif // Stream Virtual File Driver
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getSieveBufSize
|
||||
///\brief Returns the current settings for the data sieve buffer size
|
||||
/// property from this property list.
|
||||
///\return Data sieve buffer size, in bytes
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
size_t FileAccPropList::getSieveBufSize() const
|
||||
{
|
||||
size_t bufsize;
|
||||
herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed");
|
||||
}
|
||||
return(bufsize);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setSieveBufSize
|
||||
///\brief Sets the maximum size of the data sieve buffer.
|
||||
///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on data sieving, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSieveBufSize
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSieveBufSize(size_t bufsize) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setMetaBlockSize
|
||||
///\brief Sets the minimum size of metadata block allocations.
|
||||
///\param block_size - IN: Minimum size, in bytes, of metadata
|
||||
/// block allocations
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For more detail, please see the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMetaBlockSize
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_meta_block_size(id, block_size);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getMetaBlockSize
|
||||
///\brief Returns the current metadata block size setting.
|
||||
///\return Metadata block size
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t FileAccPropList::getMetaBlockSize() const
|
||||
{
|
||||
hsize_t block_size;
|
||||
herr_t ret_value = H5Pget_meta_block_size(id, &block_size);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed");
|
||||
}
|
||||
return(block_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setLog
|
||||
///\brief Modifies this file access property list to use the logging
|
||||
/// driver.
|
||||
///\param logfile - IN: Name of the log file
|
||||
///\param flags - IN: Flags specifying the types of logging activity
|
||||
///\param buf_size - IN: Size of the logging buffer
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on \a flags, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setLog
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param logfile - IN: Name of the log file - string
|
||||
///\param flags - IN: Flags specifying the types of logging activity
|
||||
///\param buf_size - IN: Size of the logging buffer
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setLog(const string& logfile, unsigned flags, size_t buf_size) const
|
||||
{
|
||||
setLog(logfile.c_str(), flags, buf_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setSec2
|
||||
///\brief Modifies this file access property list to use the sec2
|
||||
/// driver.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSec2() const
|
||||
{
|
||||
herr_t ret_value = H5Pset_fapl_sec2(id);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setAlignment
|
||||
///\brief Sets the alignment properties of this property list.
|
||||
///\param threshold - IN: Threshold value for file object size
|
||||
///\param alignment - IN: Alignment value
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The parameter \a threshold must have a non-negative value.
|
||||
/// Note that setting the threshold value to 0 (zero) has the
|
||||
/// effect of a special case, forcing everything to be aligned.
|
||||
/// The parameter \a alignment must have a positive value.
|
||||
///
|
||||
/// For detail on \a setting alignment, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetAlignment
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_alignment( id, threshold, alignment );
|
||||
@@ -173,7 +485,15 @@ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const
|
||||
}
|
||||
}
|
||||
|
||||
void FileAccPropList::getAlignment( hsize_t& threshold, hsize_t& alignment ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getAlignment
|
||||
///\brief Returns the current settings for alignment properties from
|
||||
/// this property list.
|
||||
///\param threshold - OUT: Retrieved threshold value for file object size
|
||||
///\param alignment - OUT: Retrieved alignment value
|
||||
///\exception H5::PropListIException
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_alignment( id, &threshold, &alignment );
|
||||
if( ret_value < 0 )
|
||||
@@ -182,27 +502,62 @@ void FileAccPropList::getAlignment( hsize_t& threshold, hsize_t& alignment ) con
|
||||
}
|
||||
}
|
||||
|
||||
/* MPI_Comm and MPI_Info not declared in serial mode so leave these
|
||||
routines out until C++ API needs to deal with parallel
|
||||
void FileAccPropList::setMpi( MPI_Comm comm, MPI_Info info ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setMultiType
|
||||
///\brief Sets data type for \c MULTI driver.
|
||||
///\param dtype - IN: Type of data
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// More details and valid values for \a dtype can be found at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMultiType
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setMultiType(H5FD_mem_t dtype) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_mpi( id, comm, info );
|
||||
herr_t ret_value = H5Pset_multi_type(id, dtype);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setMpi", "H5Pset_mpi failed");
|
||||
throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed");
|
||||
}
|
||||
}
|
||||
|
||||
void FileAccPropList::getMpi( MPI_Comm& comm, MPI_Info& info ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getMultiType
|
||||
///\brief Returns the data type property for \c MULTI driver.
|
||||
///\return The data type property
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// More details and possible returned values can be found at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetMultiType
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5FD_mem_t FileAccPropList::getMultiType() const
|
||||
{
|
||||
herr_t ret_value = H5Pget_mpi( id, &comm, &info );
|
||||
H5FD_mem_t dtype;
|
||||
herr_t ret_value = H5Pget_multi_type(id, &dtype);
|
||||
if( ret_value < 0 )
|
||||
return( false );
|
||||
else
|
||||
return( true );
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed");
|
||||
}
|
||||
return(dtype);
|
||||
}
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setCache
|
||||
///\brief Sets the meta data cache and raw data chunk cache parameters.
|
||||
///\param mdc_nelmts - IN: Number of elements in the meta data cache
|
||||
///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache
|
||||
///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes
|
||||
///\param rdcc_w0 - IN: Preemption policy
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The argument \a rdcc_w0 should hold a value between 0 and 1
|
||||
/// inclusive. This value indicates how much chunks that have
|
||||
/// been fully read are favored for preemption. A value of zero
|
||||
/// means fully read chunks are treated no differently than other
|
||||
/// chunks (the preemption is strictly LRU) while a value of one
|
||||
/// means fully read chunks are always preempted before other chunks.
|
||||
//--------------------------------------------------------------------------
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
void FileAccPropList::setCache( int mdc_nelmts, int rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const
|
||||
{
|
||||
@@ -213,6 +568,15 @@ void FileAccPropList::setCache( int mdc_nelmts, int rdcc_nelmts, size_t rdcc_nby
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getCache
|
||||
///\brief Queries the meta data cache and raw data chunk cache parameters.
|
||||
///\param mdc_nelmts - OUT: Number of elements in the meta data cache
|
||||
///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache
|
||||
///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes
|
||||
///\param rdcc_w0 - OUT: Preemption policy
|
||||
///\exception H5::PropListIException
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::getCache( int& mdc_nelmts, int& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_cache( id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0 );
|
||||
@@ -222,6 +586,22 @@ void FileAccPropList::getCache( int& mdc_nelmts, int& rdcc_nelmts, size_t& rdcc_
|
||||
}
|
||||
}
|
||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setCache
|
||||
///\brief Sets the meta data cache and raw data chunk cache parameters.
|
||||
///\param mdc_nelmts - IN: Number of elements in the meta data cache
|
||||
///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache
|
||||
///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes
|
||||
///\param rdcc_w0 - IN: Preemption policy
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The argument \a rdcc_w0 should hold a value between 0 and 1
|
||||
/// inclusive. This value indicates how much chunks that have
|
||||
/// been fully read are favored for preemption. A value of zero
|
||||
/// means fully read chunks are treated no differently than other
|
||||
/// chunks (the preemption is strictly LRU) while a value of one
|
||||
/// means fully read chunks are always preempted before other chunks.
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_cache( id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 );
|
||||
@@ -231,6 +611,15 @@ void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getCache
|
||||
///\brief Queries the meta data cache and raw data chunk cache parameters.
|
||||
///\param mdc_nelmts - OUT: Number of elements in the meta data cache
|
||||
///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache
|
||||
///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes
|
||||
///\param rdcc_w0 - OUT: Preemption policy
|
||||
///\exception H5::PropListIException
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_cache( id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0 );
|
||||
@@ -241,6 +630,50 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setFcloseDegree
|
||||
///\brief Sets the degree for the file close behavior.
|
||||
///\param degree - IN:
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree)
|
||||
{
|
||||
herr_t ret_value = H5Pset_fclose_degree(id, degree);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getFcloseDegree
|
||||
///\brief Returns the degree for the file close behavior.
|
||||
///\return The degree for the file close behavior
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5F_close_degree_t FileAccPropList::getFcloseDegree()
|
||||
{
|
||||
H5F_close_degree_t degree;
|
||||
herr_t ret_value = H5Pget_fclose_degree(id, °ree);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed");
|
||||
}
|
||||
return(degree);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setGcReferences
|
||||
///\brief Sets garbage collecting references flag.
|
||||
///\param gc_ref - IN: Flag setting reference garbage collection to
|
||||
/// on (1) or off (0).
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on \a fapl, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setGcReferences( unsigned gc_ref ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_gc_references( id, gc_ref );
|
||||
@@ -250,6 +683,12 @@ void FileAccPropList::setGcReferences( unsigned gc_ref ) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getGcReferences
|
||||
///\brief Returns the garbage collecting references setting.
|
||||
///\return Garbage collecting references setting, 0 (off) or 1 (on)
|
||||
///\exception H5::PropListIException
|
||||
//--------------------------------------------------------------------------
|
||||
unsigned FileAccPropList::getGcReferences() const
|
||||
{
|
||||
unsigned gc_ref;
|
||||
@@ -263,6 +702,11 @@ unsigned FileAccPropList::getGcReferences() const
|
||||
return( gc_ref );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList destructor
|
||||
///\brief Noop destructor
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileAccPropList::~FileAccPropList() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -25,88 +25,93 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
public:
|
||||
static const FileAccPropList DEFAULT;
|
||||
|
||||
// Creates a file access property list.
|
||||
FileAccPropList();
|
||||
// Modifies this property list to use the H5FD_STDIO driver
|
||||
void setStdio() const;
|
||||
|
||||
// Copy constructor: creates a copy of a FileAccPropList object
|
||||
FileAccPropList( const FileAccPropList& orig );
|
||||
// Set file driver for this property list
|
||||
void setDriver(hid_t new_driver_id, const void *new_driver_info) const;
|
||||
|
||||
// Sets the low level file driver to use the functions
|
||||
// declared in the stdio.h
|
||||
// void setStdio() const;
|
||||
// Returns a low-level file driver identifier.
|
||||
hid_t getDriver() const;
|
||||
|
||||
// Determines whether the file access property list is set to the
|
||||
// stdio driver.
|
||||
// bool getStdio() const;
|
||||
// Sets offset for family driver.
|
||||
void setFamilyOffset(hsize_t offset) const;
|
||||
|
||||
// Gets offset for family driver.
|
||||
hsize_t getFamilyOffset() const;
|
||||
|
||||
// Modifies this file access property list to use the sec2 driver.
|
||||
void setSec2() const;
|
||||
|
||||
// Modifies this file access property list to use the H5FD_CORE
|
||||
// driver.
|
||||
void setCore (size_t increment, hbool_t backing_store) const;
|
||||
|
||||
// Queries H5FD_CORE driver properties.
|
||||
void getCore (size_t& increment, hbool_t& backing_store) const;
|
||||
|
||||
// Sets this file access properties list to the family driver.
|
||||
void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const;
|
||||
|
||||
// Returns information about the family file access property list.
|
||||
void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const;
|
||||
FileAccPropList getFamily(hsize_t& memb_size) const;
|
||||
|
||||
// Emulates the old split file driver,
|
||||
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
const char* meta_ext = ".meta", const char* raw_ext = ".raw" ) const;
|
||||
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
const string& meta_ext, const string& raw_ext ) const;
|
||||
|
||||
#ifdef H5_HAVE_STREAM // for Stream Virtual File Driver
|
||||
// Modifies this file access property list to use the Stream driver.
|
||||
void setStream(H5FD_stream_fapl_t &fapl) const;
|
||||
|
||||
// Retrieves the streaming I/O driver settings
|
||||
H5FD_stream_fapl_t getStream() const;
|
||||
#endif
|
||||
|
||||
// Sets the maximum size of the data sieve buffer.
|
||||
void setSieveBufSize(size_t bufsize) const;
|
||||
|
||||
// Returns the current settings for the data sieve buffer size
|
||||
// property
|
||||
size_t getSieveBufSize() const;
|
||||
|
||||
// Sets the minimum size of metadata block allocations.
|
||||
void setMetaBlockSize(hsize_t &block_size) const;
|
||||
|
||||
// Returns the current metadata block size setting.
|
||||
hsize_t getMetaBlockSize() const;
|
||||
|
||||
// Modifies this file access property list to use the logging driver.
|
||||
void setLog(const char *logfile, unsigned flags, size_t buf_size) const;
|
||||
void setLog(const string& logfile, unsigned flags, size_t buf_size) const;
|
||||
|
||||
// Sets alignment properties of this file access property list
|
||||
void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const;
|
||||
|
||||
// Retrieves the current settings for alignment properties from
|
||||
// this file access property list.
|
||||
// this property list.
|
||||
void getAlignment( hsize_t& threshold, hsize_t& alignment ) const;
|
||||
|
||||
/* MPI stuff not working in serial mode
|
||||
//void setMpi( MPI_Comm comm, MPI_Info info ) const;
|
||||
//void getMpi( MPI_Comm& comm, MPI_Info& info ) const;
|
||||
*/
|
||||
// Sets data type for multi driver.
|
||||
void setMultiType(H5FD_mem_t dtype) const;
|
||||
|
||||
// Returns a low-level file driver identifier.
|
||||
// H5F_driver_t getDriver() const;
|
||||
// Returns the data type property for MULTI driver.
|
||||
H5FD_mem_t getMultiType() const;
|
||||
|
||||
// Sets the low-level file driver to use the declared functions.
|
||||
// void setSec2() const;
|
||||
|
||||
// Determines whether this file access property list is set to the
|
||||
// sec2 driver.
|
||||
// bool getSec2() const;
|
||||
|
||||
// Sets the low-level file driver to use malloc() and free().
|
||||
// void setCore( size_t increment ) const;
|
||||
|
||||
// Determines whether this file access property list is set to the
|
||||
// core driver and retrieves the increment.
|
||||
// bool getCore( size_t& increment ) const;
|
||||
|
||||
// Sets this file access properties list to the family driver.
|
||||
// void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const;
|
||||
|
||||
// Determines whether this file access property list is set to the
|
||||
// family driver and retrieves the member's file access property list.
|
||||
// bool getFamily( hsize_t& memb_size, FileAccPropList& memb_plist ) const;
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
// Sets the meta data cache and raw data chunk cache parameters.
|
||||
void setCache( int mdc_nelmts, int rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const;
|
||||
|
||||
// Retrieves maximum sizes of data caches and the preemption
|
||||
// policy value.
|
||||
void getCache( int& mdc_nelmts, int& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const;
|
||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
||||
// Sets the meta data cache and raw data chunk cache parameters.
|
||||
void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const;
|
||||
|
||||
// Retrieves maximum sizes of data caches and the preemption
|
||||
// policy value.
|
||||
// Queries the meta data cache and raw data chunk cache parameters.
|
||||
void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const;
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
// Sets the low-level driver to split meta data from raw data.
|
||||
// void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
// const char* meta_ext = ".meta", const char* raw_ext = ".raw" ) const;
|
||||
// Sets the degree for the file close behavior.
|
||||
void setFcloseDegree(H5F_close_degree_t degree);
|
||||
|
||||
// void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
// const string& meta_ext, const string& raw_ext ) const;
|
||||
|
||||
// Determines whether this file access property list is set to the
|
||||
// split driver and retrieves the meta-data and raw-data property lists.
|
||||
// void getSplit( size_t meta_ext_size, string& meta_ext, FileAccPropList&
|
||||
// meta_plist, size_t raw_ext_size, string& raw_ext, FileAccPropList&
|
||||
// raw_plist ) const;
|
||||
|
||||
// Proposal: 2 separate functions
|
||||
//FileAccPropList getMetaPlist( size_t meta_ext_size, char* meta_ext );
|
||||
//FileAccPropList getRawPlist( size_t raw_ext_size, char* raw_ext );
|
||||
// Returns the degree for the file close behavior.
|
||||
H5F_close_degree_t getFcloseDegree();
|
||||
|
||||
// Sets garbage collecting references flag.
|
||||
void setGcReferences( unsigned gc_ref = 0 ) const;
|
||||
@@ -114,9 +119,15 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
// Returns garbage collecting references setting.
|
||||
unsigned getGcReferences() const;
|
||||
|
||||
// Creates a file access property list.
|
||||
FileAccPropList();
|
||||
|
||||
// Copy constructor: creates a copy of a FileAccPropList object.
|
||||
FileAccPropList( const FileAccPropList& original );
|
||||
|
||||
// Creates a copy of an existing file access property list
|
||||
// using the property list id
|
||||
FileAccPropList (const hid_t plist_id) : PropList( plist_id ) {}
|
||||
// using the property list id.
|
||||
FileAccPropList (const hid_t plist_id);
|
||||
|
||||
// Default destructor
|
||||
virtual ~FileAccPropList();
|
||||
|
||||
@@ -25,18 +25,51 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default property
|
||||
//--------------------------------------------------------------------------
|
||||
const FileCreatPropList FileCreatPropList::DEFAULT( H5P_DEFAULT );
|
||||
|
||||
// Creates a file create property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList default constructor
|
||||
///\brief Default constructor: creates a file creation property list.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original FileCreatPropList object;
|
||||
FileCreatPropList::FileCreatPropList( const FileCreatPropList& orig ) : PropList( orig ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList overloaded constructor
|
||||
///\brief Creates a file creation property list using the id of an
|
||||
/// existing one.
|
||||
///\param plist_id - IN: FileCreatPropList id to use
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original FileCreatPropList object.
|
||||
///\param original - IN: FileCreatPropList instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList(original) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::getVersion
|
||||
///\brief Retrieves version information for various parts of a file.
|
||||
///\param super - OUT: The file super block.
|
||||
///\param freelist - OUT: The global free list.
|
||||
///\param stab - OUT: The root symbol table entry.
|
||||
///\param shhdr - OUT: Shared object headers.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Any (or even all) of the output arguments can be null pointers.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::getVersion(
|
||||
int& boot, int& freelist, int& stab, int& shhdr ) const
|
||||
int& super, int& freelist, int& stab, int& shhdr ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_version( id, &boot, &freelist, &stab, &shhdr );
|
||||
herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileCreatPropList::getVersion",
|
||||
@@ -44,6 +77,16 @@ void FileCreatPropList::getVersion(
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::setUserblock
|
||||
///\brief Sets the user block size field of this file creation property list.
|
||||
///\param size - IN: User block size to be set, in bytes
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// The default user block size is 0; it may be set to any power
|
||||
/// of 2 equal to 512 or greater (512, 1024, 2048, etc.)
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setUserblock( hsize_t size ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_userblock( id, size);
|
||||
@@ -54,6 +97,13 @@ void FileCreatPropList::setUserblock( hsize_t size ) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::getUserblock
|
||||
///\brief Returns the user block size of this file creation property list.
|
||||
///\return User block size
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t FileCreatPropList::getUserblock() const
|
||||
{
|
||||
hsize_t userblock_size;
|
||||
@@ -66,6 +116,19 @@ hsize_t FileCreatPropList::getUserblock() const
|
||||
return( userblock_size );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::setSizes
|
||||
///\brief Sets the byte size of the offsets and lengths used to
|
||||
/// address objects in an HDF5 file.
|
||||
///\param sizeof_addr - IN: Size of an object offset in bytes
|
||||
///\param sizeof_size - IN: Size of an object length in bytes.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information on setting sizes, please refer to the
|
||||
/// C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSizes
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size );
|
||||
@@ -76,6 +139,13 @@ void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::getSizes
|
||||
///\brief Retrieves the size of the offsets and lengths used in an
|
||||
/// HDF5 file.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size );
|
||||
@@ -87,6 +157,18 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con
|
||||
}
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::setSymk
|
||||
///\brief Sets the size of parameters used to control the symbol table
|
||||
/// nodes.
|
||||
///\param ik - IN: Symbol table tree rank
|
||||
///\param lk - IN: Symbol table node size
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setSymk( int ik, int lk ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_sym_k( id, ik, lk );
|
||||
@@ -97,6 +179,16 @@ void FileCreatPropList::setSymk( int ik, int lk ) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::getSymk
|
||||
///\brief Retrieves the size of the symbol table B-tree 1/2 rank and
|
||||
/// the symbol table leaf node 1/2 size.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::getSymk( int& ik, int& lk ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_sym_k( id, &ik, &lk );
|
||||
@@ -107,6 +199,18 @@ void FileCreatPropList::getSymk( int& ik, int& lk ) const
|
||||
}
|
||||
}
|
||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::setSymk
|
||||
///\brief Sets the size of parameters used to control the symbol table
|
||||
/// nodes.
|
||||
///\param ik - IN: Symbol table tree rank
|
||||
///\param lk - IN: Symbol table node size
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setSymk( int ik, unsigned lk ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_sym_k( id, ik, lk );
|
||||
@@ -117,6 +221,16 @@ void FileCreatPropList::setSymk( int ik, unsigned lk ) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::getSymk
|
||||
///\brief Retrieves the size of the symbol table B-tree 1/2 rank and
|
||||
/// the symbol table leaf node 1/2 size.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::getSymk( int& ik, unsigned& lk ) const
|
||||
{
|
||||
herr_t ret_value = H5Pget_sym_k( id, &ik, &lk );
|
||||
@@ -128,6 +242,17 @@ void FileCreatPropList::getSymk( int& ik, unsigned& lk ) const
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::setIstorek
|
||||
///\brief Sets the size of the parameter used to control the B-trees
|
||||
/// for indexing chunked datasets.
|
||||
///\param ik - IN: 1/2 rank of chunked storage B-tree
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setIstorek( int ik ) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_istore_k( id, ik );
|
||||
@@ -137,6 +262,16 @@ void FileCreatPropList::setIstorek( int ik ) const
|
||||
"H5Pset_istore_k failed");
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::getIstorek
|
||||
///\brief Returns the 1/2 rank of an indexed storage B-tree.
|
||||
///\return 1/2 rank of chunked storage B-tree
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int FileCreatPropList::getIstorek() const
|
||||
{
|
||||
int ik;
|
||||
@@ -149,7 +284,11 @@ int FileCreatPropList::getIstorek() const
|
||||
return( ik );
|
||||
}
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileCreatPropList::~FileCreatPropList() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -23,58 +23,59 @@ namespace H5 {
|
||||
// class for file access properties
|
||||
class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
public:
|
||||
// Default file creation property list.
|
||||
static const FileCreatPropList DEFAULT;
|
||||
|
||||
// Creates a file create property list.
|
||||
// Creates a file creation property list.
|
||||
FileCreatPropList();
|
||||
|
||||
// Copy constructor: creates a copy of a FileCreatPropList object
|
||||
FileCreatPropList( const FileCreatPropList& orig );
|
||||
|
||||
// Retrieves version information for various parts of a file.
|
||||
void getVersion( int& boot, int& freelist, int& stab, int& shhdr ) const;
|
||||
|
||||
// Sets the userblock size field of a file creation property list.
|
||||
void setUserblock( hsize_t size ) const;
|
||||
|
||||
// Gets the size of a user block in this file creation property list.
|
||||
hsize_t getUserblock() const;
|
||||
|
||||
// Sets file size-of addresses and sizes.
|
||||
void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const;
|
||||
|
||||
// Retrieves the size-of address and size quantities stored in a
|
||||
// file according to this file creation property list.
|
||||
void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const;
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
// Sets the size of parameters used to control the symbol table nodes.
|
||||
void setSymk( int int_nodes_k, int leaf_nodes_k ) const;
|
||||
|
||||
// Retrieves the size of the symbol table B-tree 1/2 rank and the
|
||||
// symbol table leaf node 1/2 size.
|
||||
void getSymk( int& int_nodes_k, int& leaf_nodes_k ) const;
|
||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
||||
// Sets the size of parameters used to control the symbol table nodes.
|
||||
void setSymk( int int_nodes_k, unsigned leaf_nodes_k ) const;
|
||||
|
||||
// Retrieves the size of the symbol table B-tree 1/2 rank and the
|
||||
// symbol table leaf node 1/2 size.
|
||||
void getSymk( int& int_nodes_k, unsigned& leaf_nodes_k ) const;
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
// Returns the 1/2 rank of an indexed storage B-tree.
|
||||
int getIstorek() const;
|
||||
|
||||
// Sets the size of parameter used to control the B-trees for
|
||||
// indexing chunked datasets.
|
||||
void setIstorek( int ik ) const;
|
||||
|
||||
// Returns the 1/2 rank of an indexed storage B-tree.
|
||||
int getIstorek() const;
|
||||
// Retrieves the size-of address and size quantities stored in a
|
||||
// file according to this file creation property list.
|
||||
void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const;
|
||||
|
||||
// Sets file size-of addresses and sizes.
|
||||
void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const;
|
||||
|
||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
||||
// Retrieves the size of the symbol table B-tree 1/2 rank and the
|
||||
// symbol table leaf node 1/2 size.
|
||||
void getSymk( int& int_nodes_k, int& leaf_nodes_k ) const;
|
||||
|
||||
// Sets the size of parameters used to control the symbol table nodes.
|
||||
void setSymk( int int_nodes_k, int leaf_nodes_k ) const;
|
||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
||||
// Retrieves the size of the symbol table B-tree 1/2 rank and the
|
||||
// symbol table leaf node 1/2 size.
|
||||
void getSymk( int& int_nodes_k, unsigned& leaf_nodes_k ) const;
|
||||
|
||||
// Sets the size of parameters used to control the symbol table nodes.
|
||||
void setSymk( int int_nodes_k, unsigned leaf_nodes_k ) const;
|
||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||
|
||||
// Gets the size of a user block in this file creation property list.
|
||||
hsize_t getUserblock() const;
|
||||
|
||||
// Sets the userblock size field of a file creation property list.
|
||||
void setUserblock( hsize_t size ) const;
|
||||
|
||||
// Retrieves version information for various parts of a file.
|
||||
void getVersion( int& boot, int& freelist, int& stab, int& shhdr ) const;
|
||||
|
||||
// Copy constructor: creates a copy of a FileCreatPropList object
|
||||
FileCreatPropList(const FileCreatPropList& orig);
|
||||
|
||||
// Creates a copy of an existing file create property list
|
||||
// using the property list id
|
||||
FileCreatPropList (const hid_t plist_id) : PropList( plist_id ) {}
|
||||
FileCreatPropList (const hid_t plist_id);
|
||||
|
||||
// Default destructor
|
||||
// Noop destructor.
|
||||
virtual ~FileCreatPropList();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -42,23 +42,69 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function H5File default constructor
|
||||
///\brief Default constructor: creates a stub H5File object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File() : IdComponent() {}
|
||||
|
||||
// Creates or opens an HDF5 file depending on the parameter flags.
|
||||
H5File::H5File( const string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent()
|
||||
{
|
||||
getFile( name.c_str(), flags, create_plist, access_plist );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File overloaded constructor
|
||||
///\brief Creates or opens an HDF5 file depending on the parameter flags.
|
||||
///\param name - IN: Name of the file
|
||||
///\param flags - IN: File access flags
|
||||
///\param create_plist - IN: File creation property list, used when
|
||||
/// modifying default file meta-data. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
///\param access_plist - IN: File access property list. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
///\par Description
|
||||
/// Valid values of \a flags include:
|
||||
/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists,
|
||||
/// erasing all data previously stored in
|
||||
/// the file.
|
||||
/// \li \c H5F_ACC_EXCL - Fail if file already exists.
|
||||
/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive
|
||||
/// \li \c H5F_ACC_DEBUG - print debug information. This flag is
|
||||
/// used only by HDF5 library developers; it is neither
|
||||
/// tested nor supported for use in applications.
|
||||
///\par
|
||||
/// For info on file creation in the case of an already-open file,
|
||||
/// please refer to the \b Special \b case section in the C layer
|
||||
/// Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5F.html#File-Create
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent()
|
||||
{
|
||||
getFile( name, flags, create_plist, access_plist );
|
||||
p_get_file(name, flags, create_plist, access_plist);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File overloaded constructor
|
||||
///\brief This is another overloaded constructor. It differs from the
|
||||
/// above constructor only in the type of the \a name argument.
|
||||
///\param name - IN: Name of the file - \c std::string
|
||||
///\param flags - IN: File access flags
|
||||
///\param create_plist - IN: File creation property list, used when
|
||||
/// modifying default file meta-data. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
///\param access_plist - IN: File access property list. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File( const string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent()
|
||||
{
|
||||
p_get_file(name.c_str(), flags, create_plist, access_plist);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// This function is private and contains common code between the
|
||||
// constructors taking a string or a char*
|
||||
void H5File::getFile( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist )
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist)
|
||||
{
|
||||
// These bits only set for creation, so if any of them are set,
|
||||
// create the file.
|
||||
@@ -85,14 +131,23 @@ void H5File::getFile( const char* name, unsigned int flags, const FileCreatPropL
|
||||
}
|
||||
}
|
||||
|
||||
// Copy constructor: makes a copy of the original H5File object.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original
|
||||
/// H5File object.
|
||||
///\param original - IN: H5File instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File( const H5File& original ) : IdComponent( original ) {}
|
||||
|
||||
// Determines whether a file specified by its name in HDF5 format
|
||||
bool H5File::isHdf5(const string& name )
|
||||
{
|
||||
return( isHdf5( name.c_str()) );
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::isHdf5
|
||||
///\brief Determines whether a file in HDF5 format.
|
||||
///\param name - IN: Name of the file
|
||||
///\return true if the file is in HDF5 format, and false, otherwise
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool H5File::isHdf5(const char* name )
|
||||
{
|
||||
// Calls C routine H5Fis_hdf5 to determine whether the file is in
|
||||
@@ -108,15 +163,28 @@ bool H5File::isHdf5(const char* name )
|
||||
}
|
||||
}
|
||||
|
||||
// Get id of the location, which id the file id here; used by CommonFG
|
||||
// member functions
|
||||
hid_t H5File::getLocId() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::isHdf5
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes an \c std::string for \a name.
|
||||
///\param name - IN: Name of the file - \c std::string
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool H5File::isHdf5(const string& name )
|
||||
{
|
||||
return( getId() );
|
||||
return( isHdf5( name.c_str()) );
|
||||
}
|
||||
|
||||
// Reopens this file
|
||||
void H5File::reopen()
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::reOpen
|
||||
///\brief Reopens this file.
|
||||
///\exception H5::FileIException
|
||||
// Description
|
||||
// If this object has represented another HDF5 file, the previous
|
||||
// HDF5 file need to be closed first.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::reOpen()
|
||||
{
|
||||
// reset the identifier of this H5File - send 'this' in so that
|
||||
// H5Fclose can be called appropriately
|
||||
@@ -135,7 +203,27 @@ void H5File::reopen()
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the creation property list of this file
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::reopen
|
||||
///\brief Reopens this file.
|
||||
///\exception H5::FileIException
|
||||
///\par Description
|
||||
/// This function will be replaced by the above function \c reOpen
|
||||
/// in future releases.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::reopen()
|
||||
{
|
||||
H5File::reOpen();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getCreatePlist
|
||||
///\brief Returns the creation property list of this file
|
||||
///\return FileCreatPropList object
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileCreatPropList H5File::getCreatePlist() const
|
||||
{
|
||||
hid_t create_plist_id = H5Fget_create_plist( id );
|
||||
@@ -153,7 +241,13 @@ FileCreatPropList H5File::getCreatePlist() const
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the access property list of this file
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getAccessPlist
|
||||
///\brief Returns the access property list of this file
|
||||
///\return FileAccPropList object
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FileAccPropList H5File::getAccessPlist() const
|
||||
{
|
||||
hid_t access_plist_id = H5Fget_access_plist( id );
|
||||
@@ -171,7 +265,280 @@ FileAccPropList H5File::getAccessPlist() const
|
||||
}
|
||||
}
|
||||
|
||||
// Calls the C API H5Fclose to close this file. Used by IdComponent::reset
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getFreeSpace
|
||||
///\brief Returns the amount of free space in the file.
|
||||
///\return Amount of free space
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hssize_t H5File::getFreeSpace() const
|
||||
{
|
||||
hssize_t free_space = H5Fget_freespace(id);
|
||||
if( free_space < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed");
|
||||
}
|
||||
return (free_space);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getObjCount
|
||||
///\brief Returns the number of opened object IDs (files, datasets,
|
||||
/// groups and datatypes) in the same file.
|
||||
///\param types - Type of object to retrieve the count
|
||||
///\return Number of opened object IDs
|
||||
///\exception H5::FileIException
|
||||
///\par Description
|
||||
/// The valid values for \a types include:
|
||||
/// \li \c H5F_OBJ_FILE Files only
|
||||
/// \li \c H5F_OBJ_DATASET Datasets only
|
||||
/// \li \c H5F_OBJ_GROUP Groups only
|
||||
/// \li \c H5F_OBJ_DATATYPE Named datatypes only
|
||||
/// \li \c H5F_OBJ_ATTR Attributes only
|
||||
/// \li \c H5F_OBJ_ALL All of the above
|
||||
/// \li \c (i.e., H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR )
|
||||
/// Multiple object types can be combined with the logical OR operator (|).
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
int H5File::getObjCount(unsigned types) const
|
||||
{
|
||||
int num_objs = H5Fget_obj_count(id, types);
|
||||
if( num_objs < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed");
|
||||
}
|
||||
return (num_objs);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getObjCount
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes no parameter and returns the object count of all
|
||||
/// object types.
|
||||
///\return Number of opened object IDs
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
int H5File::getObjCount() const
|
||||
{
|
||||
int num_objs = H5Fget_obj_count(id, H5F_OBJ_ALL);
|
||||
if( num_objs < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed");
|
||||
}
|
||||
return (num_objs);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getObjIDs
|
||||
///\brief Retrieves a list of opened object IDs (files, datasets,
|
||||
/// groups and datatypes) in the same file.
|
||||
///\param types - Type of object to retrieve the count
|
||||
///\param max_objs - Maximum number of object identifiers to place
|
||||
/// into obj_id_list.
|
||||
///\param oid_list - List of open object identifiers
|
||||
///\exception H5::FileIException
|
||||
///\par Description
|
||||
/// The valid values for \a types include:
|
||||
/// \li \c H5F_OBJ_FILE Files only
|
||||
/// \li \c H5F_OBJ_DATASET Datasets only
|
||||
/// \li \c H5F_OBJ_GROUP Groups only
|
||||
/// \li \c H5F_OBJ_DATATYPE Named datatypes only
|
||||
/// \li \c H5F_OBJ_ATTR Attributes only
|
||||
/// \li \c H5F_OBJ_ALL All of the above
|
||||
/// \li \c (I.e., H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR )
|
||||
/// Multiple object types can be combined with the logical OR operator (|).
|
||||
//
|
||||
// Notes: will do the overload for this one after hearing from Quincey???
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const
|
||||
{
|
||||
herr_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getVFDHandle
|
||||
///\brief Returns the pointer to the file handle of the low-level file
|
||||
/// driver.
|
||||
///\param fapl - File access property list
|
||||
///\param file_handle - Pointer to the file handle being used by
|
||||
/// the low-level virtual file driver
|
||||
///\exception H5::FileIException
|
||||
///\par Description
|
||||
/// For the FAMILY or MULTI drivers, \a fapl should be
|
||||
/// defined through the property list functions:
|
||||
/// \c FileAccPropList::setFamilyOffset for the FAMILY driver
|
||||
/// and \c FileAccPropList::setMultiType for the MULTI driver.
|
||||
///
|
||||
/// The obtained file handle is dynamic and is valid only while
|
||||
/// the file remains open; it will be invalid if the file is
|
||||
/// closed and reopened or opened during a subsequent session.
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const
|
||||
{
|
||||
hid_t fapl_id = fapl.getId();
|
||||
herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getVFDHandle
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param file_handle - Pointer to the file handle being used by
|
||||
/// the low-level virtual file driver
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::getVFDHandle(void **file_handle) const
|
||||
{
|
||||
herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getFileName
|
||||
///\brief Gets the name of this file.
|
||||
///\return File name
|
||||
///\exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
string H5File::getFileName() const
|
||||
{
|
||||
return(p_get_file_name());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::Reference
|
||||
///\brief Creates a reference to an Hdf5 object or a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
///\par Description
|
||||
/// Note that name must be an absolute path to the object in the file.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* H5File::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
return(p_reference(name, dataspace.getId(), ref_type));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::Reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it only creates
|
||||
/// a reference to an HDF5 object, not to a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
///\par Description
|
||||
// This function passes H5R_OBJECT and -1 to the protected
|
||||
// function for it to pass to the C API H5Rcreate
|
||||
// to create a reference to the named object.
|
||||
///\par
|
||||
/// Note that, for H5File, name must be an absolute path to the
|
||||
/// object in the file.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* H5File::Reference(const char* name) const
|
||||
{
|
||||
return(p_reference(name, -1, H5R_OBJECT));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref - IN: Reference to query
|
||||
///\param ref_type - IN: Type of reference to query
|
||||
///\return Object type, which can be one of the following:
|
||||
/// \li \c H5G_LINK - Object is a symbolic link.
|
||||
/// \li \c H5G_GROUP - Object is a group.
|
||||
/// \li \c H5G_DATASET - Object is a dataset.
|
||||
/// \li \c H5G_TYPE - Object is a named datatype
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t H5File::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
///\return DataSpace instance
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace H5File::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getFileSize
|
||||
///\brief Returns the file size of the HDF5 file.
|
||||
///\return File size
|
||||
///\exception H5::FileIException
|
||||
///\par Description
|
||||
/// This function is called after an existing file is opened in
|
||||
/// order to learn the true size of the underlying file.
|
||||
// Programmer Raymond Lu - June 24, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t H5File::getFileSize() const
|
||||
{
|
||||
hsize_t file_size;
|
||||
herr_t ret_value = H5Fget_filesize(id, &file_size);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw FileIException("H5File::getFileSize", "H5Fget_filesize failed");
|
||||
}
|
||||
return (file_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getLocId
|
||||
// Purpose: Get the id of this file
|
||||
// Description
|
||||
// This function is a redefinition of CommonFG::getLocId. It
|
||||
// is used by CommonFG member functions to get the file id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t H5File::getLocId() const
|
||||
{
|
||||
return( getId() );
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_close (private)
|
||||
// Purpose: Closes this HDF5 file.
|
||||
// Exception H5::FileIException
|
||||
// Description
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer. - May, 2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::p_close() const
|
||||
{
|
||||
herr_t ret_value = H5Fclose( id );
|
||||
@@ -180,23 +547,34 @@ void H5File::p_close() const
|
||||
throw FileIException(0, "H5Fclose failed");
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Throw file exception; used in CommonFG implementation so that proper
|
||||
// exception can be thrown for file or group. The func_name is a member
|
||||
// function of CommonFG and "H5File::" will be inserted to indicate the
|
||||
// function called is an implementation of H5File
|
||||
void H5File::throwException(const string& func_name, const string& msg) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::throwException
|
||||
///\brief Throws file exception - initially implemented for CommonFG
|
||||
///\param func_name - Name of the function where failure occurs
|
||||
///\param msg - Message describing the failure
|
||||
///\exception H5::FileIException
|
||||
// Description
|
||||
// This function is used in CommonFG implementation so that
|
||||
// proper exception can be thrown for file or group. The
|
||||
// argument func_name is a member of CommonFG and "H5File::"
|
||||
// will be inserted to indicate the function called is an
|
||||
// implementation of H5File.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::throwException(const string func_name, const string msg) const
|
||||
{
|
||||
string full_name = func_name;
|
||||
full_name.insert(0, "H5File::");
|
||||
throw FileIException(full_name, msg);
|
||||
}
|
||||
|
||||
// The destructor of this instance calls IdComponent::reset to
|
||||
// reset its identifier - no longer true
|
||||
// Older compilers (baldric) don't support template member functions
|
||||
// and IdComponent::reset is one; so at this time, the resetId is not
|
||||
// a member function so it can be template to work around that problem.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File destructor
|
||||
///\brief Properly terminates access to this file.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::~H5File()
|
||||
{
|
||||
// The HDF5 file id will be closed properly
|
||||
|
||||
@@ -22,49 +22,87 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
public:
|
||||
// Default constructor
|
||||
H5File();
|
||||
|
||||
// copy constructor: makes a copy of the original H5File object.
|
||||
H5File(const H5File& original );
|
||||
|
||||
// Creates or opens an HDF5 file.
|
||||
H5File( const string& name, unsigned int flags,
|
||||
const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
|
||||
const FileAccPropList& access_plist = FileAccPropList::DEFAULT );
|
||||
H5File( const char* name, unsigned int flags,
|
||||
const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
|
||||
const FileAccPropList& access_plist = FileAccPropList::DEFAULT );
|
||||
H5File( const string& name, unsigned int flags,
|
||||
const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
|
||||
const FileAccPropList& access_plist = FileAccPropList::DEFAULT );
|
||||
|
||||
// Gets the access property list of this file.
|
||||
FileAccPropList getAccessPlist() const;
|
||||
|
||||
// Gets the creation property list of this file.
|
||||
FileCreatPropList getCreatePlist() const;
|
||||
|
||||
// Gets the name of this file.
|
||||
string getFileName() const;
|
||||
|
||||
// Retrieves the file size of an opened file.
|
||||
hsize_t getFileSize() const;
|
||||
|
||||
// Returns the amount of free space in the file.
|
||||
hssize_t getFreeSpace() const;
|
||||
|
||||
// Returns the number of opened object IDs (files, datasets, groups
|
||||
// and datatypes) in the same file.
|
||||
int getObjCount(unsigned types) const;
|
||||
int getObjCount() const;
|
||||
|
||||
// Retrieves a list of opened object IDs (files, datasets, groups
|
||||
// and datatypes) in the same file.
|
||||
void getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const;
|
||||
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Returns the pointer to the file handle of the low-level file driver.
|
||||
void getVFDHandle(FileAccPropList& fapl, void **file_handle) const;
|
||||
void getVFDHandle(void **file_handle) const;
|
||||
|
||||
// Determines if a file, specified by its name, is in HDF5 format
|
||||
static bool isHdf5(const char* name );
|
||||
static bool isHdf5(const string& name );
|
||||
|
||||
// Reopens this file.
|
||||
void reOpen(); // added for better name
|
||||
void reopen();
|
||||
|
||||
// Creates a reference to a named Hdf5 object or to a dataset region
|
||||
// in this object.
|
||||
void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Creates a reference to a named Hdf5 object in this object.
|
||||
void* Reference(const char* name) const;
|
||||
|
||||
// Throw file exception.
|
||||
virtual void throwException(const string func_name, const string msg) const;
|
||||
|
||||
// Gets the file id
|
||||
virtual hid_t getLocId() const;
|
||||
|
||||
// Throw file exception
|
||||
virtual void throwException(const string& func_name, const string& msg) const;
|
||||
// Default constructor
|
||||
H5File();
|
||||
|
||||
// Copy constructor: makes a copy of the original H5File object.
|
||||
H5File(const H5File& original);
|
||||
|
||||
// Determines if a file, specified by its name, is in HDF5 format
|
||||
static bool isHdf5(const string& name );
|
||||
static bool isHdf5(const char* name );
|
||||
|
||||
// Reopens this file
|
||||
void reopen();
|
||||
|
||||
// Gets the creation property list of this file
|
||||
FileCreatPropList getCreatePlist() const;
|
||||
|
||||
// Gets the access property list of this file
|
||||
FileAccPropList getAccessPlist() const;
|
||||
|
||||
// Used by the API to appropriately close a file
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Used by the API to appropriately close a file.
|
||||
void p_close() const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// H5File destructor.
|
||||
virtual ~H5File();
|
||||
|
||||
private:
|
||||
// This function is private and contains common code between the
|
||||
// constructors taking a string or a char*
|
||||
void getFile( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist );
|
||||
void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist );
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5DxferProp.h"
|
||||
@@ -33,23 +35,51 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType default constructor
|
||||
///\brief Default constructor: Creates a stub floating-point datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType::FloatType() {}
|
||||
|
||||
// Creates a floating-point type using a predefined type
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType overloaded constructor
|
||||
///\brief Creates a floating-point datatype using a predefined type.
|
||||
///\param pred_type - IN: Predefined datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType::FloatType( const PredType& pred_type ) : AtomType()
|
||||
{
|
||||
// use DataType::copy to make a copy of this predefined type
|
||||
copy( pred_type );
|
||||
}
|
||||
|
||||
// Creates a floating-point datatype using an existing id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType overloaded constructor
|
||||
///\brief Creates an FloatType object using the id of an existing
|
||||
/// datatype.
|
||||
///\param existing_id - IN: Id of an existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType::FloatType( const hid_t existing_id ) : AtomType( existing_id ) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original FloatType object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original FloatType object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType::FloatType( const FloatType& original ) : AtomType( original ){}
|
||||
|
||||
// Gets the floating-point datatype of the specified dataset - will reimplement
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType overloaded constructor
|
||||
///\brief Gets the floating-point datatype of the specified dataset
|
||||
///\param dataset - IN: Dataset that this floating-point datatype
|
||||
/// associates with
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType::FloatType( const DataSet& dataset ) : AtomType()
|
||||
{
|
||||
// Calls C function H5Dget_type to get the id of the datatype
|
||||
@@ -61,7 +91,17 @@ FloatType::FloatType( const DataSet& dataset ) : AtomType()
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves floating point datatype bit field information.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::getFields
|
||||
///\brief Retrieves floating point datatype bit field information.
|
||||
///\param spos - OUT: Retrieved floating-point sign bit
|
||||
///\param epos - OUT: Retrieved exponent bit-position
|
||||
///\param esize - OUT: Retrieved size of exponent, in bits
|
||||
///\param mpos - OUT: Retrieved mantissa bit-position
|
||||
///\param msize - OUT: Retrieved size of mantissa, in bits
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const
|
||||
{
|
||||
herr_t ret_value = H5Tget_fields( id, &spos, &epos, &esize, &mpos, &msize );
|
||||
@@ -71,7 +111,18 @@ void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mp
|
||||
}
|
||||
}
|
||||
|
||||
// Sets locations and sizes of floating point bit fields.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::setFields
|
||||
///\brief Sets locations and sizes of floating point bit fields.
|
||||
///\param spos - OUT: Sign position, i.e., the bit offset of the
|
||||
/// floating-point sign bit.
|
||||
///\param epos - OUT: Exponent bit position
|
||||
///\param esize - OUT: Size of exponent, in bits
|
||||
///\param mpos - OUT: Mantissa bit-position
|
||||
///\param msize - OUT: Size of mantissa, in bits
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const
|
||||
{
|
||||
herr_t ret_value = H5Tset_fields( id, spos, epos, esize, mpos, msize );
|
||||
@@ -81,7 +132,13 @@ void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos,
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the exponent bias of a floating-point type.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::getEbias
|
||||
///\brief Retrieves the exponent bias of a floating-point type.
|
||||
///\return Exponent bias
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
size_t FloatType::getEbias() const
|
||||
{
|
||||
size_t ebias = H5Tget_ebias( id );
|
||||
@@ -93,7 +150,13 @@ size_t FloatType::getEbias() const
|
||||
return( ebias );
|
||||
}
|
||||
|
||||
// Sets the exponent bias of a floating-point type.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::setEbias
|
||||
///\brief Sets the exponent bias of a floating-point type.
|
||||
///\param ebias - Exponent bias value
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FloatType::setEbias( size_t ebias ) const
|
||||
{
|
||||
herr_t ret_value = H5Tset_ebias( id, ebias );
|
||||
@@ -103,7 +166,21 @@ void FloatType::setEbias( size_t ebias ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves mantissa normalization of a floating-point datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::getNorm
|
||||
///\brief Retrieves mantissa normalization of a floating-point datatype.
|
||||
///\param norm_string - OUT: Text string of the normalization type
|
||||
///\return Valid normalization type, which can be:
|
||||
/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
|
||||
/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
|
||||
/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For your convenience, this function also provides the text
|
||||
/// string of the returned normalization type, via parameter
|
||||
/// \a norm_string.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_norm_t FloatType::getNorm( string& norm_string ) const
|
||||
{
|
||||
H5T_norm_t norm = H5Tget_norm( id ); // C routine
|
||||
@@ -121,7 +198,18 @@ H5T_norm_t FloatType::getNorm( string& norm_string ) const
|
||||
return( norm );
|
||||
}
|
||||
|
||||
// Sets the mantissa normalization of a floating-point datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::setNorm
|
||||
///\brief Sets the mantissa normalization of a floating-point datatype.
|
||||
///\param norm - IN: Mantissa normalization type
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// Valid values for normalization type include:
|
||||
/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
|
||||
/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
|
||||
/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FloatType::setNorm( H5T_norm_t norm ) const
|
||||
{
|
||||
herr_t ret_value = H5Tset_norm( id, norm );
|
||||
@@ -131,7 +219,21 @@ void FloatType::setNorm( H5T_norm_t norm ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the internal padding type for unused bits in floating-point datatypes.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::getInpad
|
||||
///\brief Retrieves the internal padding type for unused bits in
|
||||
/// this floating-point datatypes.
|
||||
///\return Internal padding type, which can be:
|
||||
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
|
||||
/// \li \c H5T_PAD_ONE (1) - Set background to ones
|
||||
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For your convenience, this function also provides the text
|
||||
/// string of the returned internal padding type, via parameter
|
||||
/// \a pad_string.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_pad_t FloatType::getInpad( string& pad_string ) const
|
||||
{
|
||||
H5T_pad_t pad_type = H5Tget_inpad( id );
|
||||
@@ -149,7 +251,23 @@ H5T_pad_t FloatType::getInpad( string& pad_string ) const
|
||||
return( pad_type );
|
||||
}
|
||||
|
||||
// Fills unused internal floating point bits.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType::setInpad
|
||||
///\brief Fills unused internal floating point bits.
|
||||
///\param inpad - IN: Internal padding type
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// If any internal bits of a floating point type are unused
|
||||
/// (that is, those significant bits which are not part of the
|
||||
/// sign, exponent, or mantissa), then they will be filled
|
||||
/// according to the padding value provided by \a inpad.
|
||||
///\par
|
||||
/// Valid values for normalization type include:
|
||||
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
|
||||
/// \li \c H5T_PAD_ONE (1) - Set background to ones
|
||||
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FloatType::setInpad( H5T_pad_t inpad ) const
|
||||
{
|
||||
herr_t ret_value = H5Tset_inpad( id, inpad );
|
||||
@@ -159,7 +277,11 @@ void FloatType::setInpad( H5T_pad_t inpad ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FloatType destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType::~FloatType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -22,38 +22,23 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP FloatType : public AtomType {
|
||||
public:
|
||||
// default constructor
|
||||
FloatType();
|
||||
|
||||
// Creates a floating-point datatype using an existing id
|
||||
FloatType( const hid_t existing_id );
|
||||
|
||||
// Creates a floating-point type using a predefined type
|
||||
FloatType( const PredType& pred_type );
|
||||
|
||||
// Copy constructor: makes a copy of the original FloatType object.
|
||||
FloatType( const FloatType& original );
|
||||
|
||||
// Gets the floating-point datatype of the specified dataset
|
||||
FloatType( const DataSet& dataset );
|
||||
|
||||
// Retrieves floating point datatype bit field information.
|
||||
void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const;
|
||||
|
||||
// Sets locations and sizes of floating point bit fields.
|
||||
void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const;
|
||||
|
||||
// Retrieves the exponent bias of a floating-point type.
|
||||
size_t getEbias() const;
|
||||
|
||||
// Sets the exponent bias of a floating-point type.
|
||||
void setEbias( size_t ebias ) const;
|
||||
|
||||
// Retrieves mantissa normalization of a floating-point datatype.
|
||||
H5T_norm_t getNorm( string& norm_string ) const;
|
||||
// Retrieves floating point datatype bit field information.
|
||||
void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const;
|
||||
|
||||
// Sets the mantissa normalization of a floating-point datatype.
|
||||
void setNorm( H5T_norm_t norm ) const;
|
||||
// Sets locations and sizes of floating point bit fields.
|
||||
void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const;
|
||||
|
||||
// Retrieves the internal padding type for unused bits in floating-point datatypes.
|
||||
H5T_pad_t getInpad( string& pad_string ) const;
|
||||
@@ -61,6 +46,22 @@ class H5_DLLCPP FloatType : public AtomType {
|
||||
// Fills unused internal floating point bits.
|
||||
void setInpad( H5T_pad_t inpad ) const;
|
||||
|
||||
// Retrieves mantissa normalization of a floating-point datatype.
|
||||
H5T_norm_t getNorm( string& norm_string ) const;
|
||||
|
||||
// Sets the mantissa normalization of a floating-point datatype.
|
||||
void setNorm( H5T_norm_t norm ) const;
|
||||
|
||||
// Default constructor
|
||||
FloatType();
|
||||
|
||||
// Creates a floating-point datatype using an existing id
|
||||
FloatType( const hid_t existing_id );
|
||||
|
||||
// Copy constructor: makes a copy of the original FloatType object.
|
||||
FloatType( const FloatType& original );
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~FloatType();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
@@ -42,92 +42,117 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group default constructor
|
||||
///\brief Default constructor: creates a stub Group.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group() : H5Object() {}
|
||||
|
||||
// Copy constructor: makes a copy of the original Group object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original Group object.
|
||||
///\param original - IN: Original group to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group( const Group& original ) : H5Object( original ) {}
|
||||
|
||||
// Get id of the location, which id the group id here; used by CommonFG
|
||||
// member functions
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::getLocId
|
||||
///\brief Returns the id of this group.
|
||||
///\return Id of this group
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t Group::getLocId() const
|
||||
{
|
||||
return( getId() );
|
||||
}
|
||||
|
||||
// Creates a copy of an existing Group using its id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group overloaded constructor
|
||||
///\brief Creates a Group object using the id of an existing group.
|
||||
///\param group_id - IN: Id of an existing group
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group( const hid_t group_id ) : H5Object( group_id ) {}
|
||||
|
||||
// Returns the number of objects in the group.
|
||||
hsize_t Group::getNumObjs() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::Reference
|
||||
///\brief Creates a reference to an HDF5 object or a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* Group::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
hsize_t num_objs;
|
||||
herr_t ret_value = H5Gget_num_objs(id, &num_objs);
|
||||
if(ret_value < 0)
|
||||
{
|
||||
throwException("getNumObjs", "H5Gget_num_objs failed");
|
||||
}
|
||||
return (num_objs);
|
||||
return(p_reference(name, dataspace.getId(), ref_type));
|
||||
}
|
||||
|
||||
// Retrieves the name of an object in a given group by giving index
|
||||
ssize_t Group::getObjnameByIdx(hsize_t idx, string& name, size_t size) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::Reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it only creates
|
||||
/// a reference to an HDF5 object, not to a dataset region.
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\return A reference
|
||||
///\exception H5::ReferenceIException
|
||||
///\par Description
|
||||
// This function passes H5R_OBJECT and -1 to the protected
|
||||
// function for it to pass to the C API H5Rcreate
|
||||
// to create a reference to the named object.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* Group::Reference(const char* name) const
|
||||
{
|
||||
char* name_C = new char[size];
|
||||
ssize_t name_len = H5Gget_objname_by_idx(id, idx, name_C, size);
|
||||
if(name_len < 0)
|
||||
{
|
||||
throwException("getObjnameByIdx", "H5Gget_objname_by_idx failed");
|
||||
}
|
||||
name = string( name_C );
|
||||
delete [] name_C;
|
||||
return (name_len);
|
||||
return(p_reference(name, -1, H5R_OBJECT));
|
||||
}
|
||||
|
||||
// Returns the type of an object in a given group by giving index
|
||||
int Group::getObjTypeByIdx(hsize_t idx) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref - IN: Reference to query
|
||||
///\param ref_type - IN: Type of reference to query
|
||||
// Return An object type, which can be one of the following:
|
||||
// H5G_LINK Object is a symbolic link.
|
||||
// H5G_GROUP Object is a group.
|
||||
// H5G_DATASET Object is a dataset.
|
||||
// H5G_TYPE Object is a named datatype
|
||||
// Exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t Group::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
int obj_type = H5Gget_objtype_by_idx(id, idx);
|
||||
if (obj_type == H5G_UNKNOWN)
|
||||
{
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
return (obj_type);
|
||||
}
|
||||
int Group::getObjTypeByIdx(hsize_t idx, string& type_name) const
|
||||
{
|
||||
int obj_type = H5Gget_objtype_by_idx(id, idx);
|
||||
switch (obj_type)
|
||||
{
|
||||
case H5G_GROUP: type_name = string("group"); break;
|
||||
case H5G_DATASET: type_name = string("dataset"); break;
|
||||
case H5G_TYPE: type_name = string("datatype"); break;
|
||||
case H5G_UNKNOWN:
|
||||
default:
|
||||
{
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
}
|
||||
return (obj_type);
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
|
||||
// Iterates a user's function over the entries of a group.
|
||||
//int Group::iterateElems( const string& name, int *idx, H5G_iterate_t op , void *op_data )
|
||||
//{
|
||||
//return( iterateElems( name.c_str(), idx, op, op_data ));
|
||||
//}
|
||||
//int Group::iterateElems( const char* name, int *idx, H5G_iterate_t op , void *op_data )
|
||||
//{
|
||||
//int ret_value = H5Giterate( id, name, idx, op, op_data );
|
||||
//if( ret_value >= 0 )
|
||||
//return( ret_value );
|
||||
//else // raise exception when H5Aiterate returns a negative value
|
||||
//{
|
||||
//throw GroupIException("Group::iterateElems", "H5Giterate failed");
|
||||
//}
|
||||
//}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
///\return DataSpace instance
|
||||
///\exception H5::ReferenceIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace Group::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
|
||||
// Calls the C API H5Gclose to close this group. Used by IdComponent::reset
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::p_close (private)
|
||||
// Purpose: Closes this group.
|
||||
// Exception H5::GroupIException
|
||||
// Description
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer. - May, 2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Group::p_close() const
|
||||
{
|
||||
herr_t ret_value = H5Gclose( id );
|
||||
@@ -136,20 +161,34 @@ void Group::p_close() const
|
||||
throw GroupIException(0, "H5Gclose failed");
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Throw file exception
|
||||
void Group::throwException(const string& func_name, const string& msg) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::throwException
|
||||
///\brief Throws H5::GroupIException.
|
||||
///\param func_name - Name of the function where failure occurs
|
||||
///\param msg - Message describing the failure
|
||||
///\exception H5::GroupIException
|
||||
// Description
|
||||
// This function is used in CommonFG implementation so that
|
||||
// proper exception can be thrown for file or group. The
|
||||
// argument func_name is a member of CommonFG and "Group::"
|
||||
// will be inserted to indicate the function called is an
|
||||
// implementation of Group.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Group::throwException(const string func_name, const string msg) const
|
||||
{
|
||||
string full_name = func_name;
|
||||
full_name.insert(0, "Group::");
|
||||
throw GroupIException(full_name, msg);
|
||||
}
|
||||
|
||||
// The destructor of this instance calls IdComponent::reset to
|
||||
// reset its identifier - no longer true
|
||||
// Older compilers (baldric) don't support template member functions
|
||||
// and IdComponent::reset is one; so at this time, the resetId is not
|
||||
// a member function so it can be template to work around that problem.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group destructor
|
||||
///\brief Properly terminates access to this group.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group::~Group()
|
||||
{
|
||||
// The group id will be closed properly
|
||||
|
||||
@@ -22,42 +22,40 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP Group : public H5Object, public CommonFG {
|
||||
public:
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Creates a reference to a named Hdf5 object or to a dataset region
|
||||
// in this object.
|
||||
void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Creates a reference to a named Hdf5 object in this object.
|
||||
void* Reference(const char* name) const;
|
||||
|
||||
// Throw group exception.
|
||||
virtual void throwException(const string func_name, const string msg) const;
|
||||
|
||||
// for CommonFG to get the file id.
|
||||
virtual hid_t getLocId() const;
|
||||
|
||||
// default constructor
|
||||
Group();
|
||||
|
||||
// Copy constructor: makes a copy of the original object
|
||||
Group( const Group& original );
|
||||
Group(const Group& original);
|
||||
|
||||
// Returns the number of objects in the group.
|
||||
hsize_t getNumObjs() const;
|
||||
|
||||
// Retrieves the name of an object in a given group by giving index
|
||||
//ssize_t getObjnameByIdx(hsize_t idx, char *name, size_t size) const;
|
||||
ssize_t getObjnameByIdx(hsize_t idx, string& name, size_t size) const;
|
||||
|
||||
// Returns the type of an object in a given group by giving index;
|
||||
// the overloaded function also provided the object type in text as
|
||||
// "group" for H5G_GROUP
|
||||
// "dataset" for H5G_DATASET
|
||||
// "datatype" for H5G_TYPE
|
||||
int getObjTypeByIdx(hsize_t idx) const;
|
||||
int getObjTypeByIdx(hsize_t idx, string& type_name) const;
|
||||
|
||||
// for CommonFG to get the file id
|
||||
virtual hid_t getLocId() const;
|
||||
|
||||
// Throw group exception
|
||||
virtual void throwException(const string& func_name, const string& msg) const;
|
||||
|
||||
|
||||
// Used by the API to appropriately close a group
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Used by the API to appropriately close a group - will be obsolete.
|
||||
void p_close() const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Destructor
|
||||
virtual ~Group();
|
||||
|
||||
// Creates a copy of an existing Group using its id
|
||||
// (used only by template functions in FGtemplates.h
|
||||
// to return a Group; will not be published; maybe, use friend???)
|
||||
// Creates a copy of an existing group using its id.
|
||||
Group( const hid_t group_id );
|
||||
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
@@ -25,22 +25,25 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor - private
|
||||
IdComponent::IdComponent() : id( -1 )
|
||||
{
|
||||
// starts counting object references
|
||||
ref_count = new RefCounter;
|
||||
}
|
||||
|
||||
// Constructor that takes an HDF5 object id. It creates an instance
|
||||
// of IdComponent to hold the HDF5 id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent overloaded constructor
|
||||
///\brief Creates an IdComponent object using the id of an existing object.
|
||||
///\param h5_id - IN: Id of an existing object
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent::IdComponent( const hid_t h5_id ) : id( h5_id )
|
||||
{
|
||||
// starts counting object references
|
||||
ref_count = new RefCounter;
|
||||
}
|
||||
|
||||
// Copy constructor: makes a copy of the original object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original IdComponent object.
|
||||
///\param original - IN: IdComponent instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent::IdComponent( const IdComponent& original )
|
||||
{
|
||||
id = original.id;
|
||||
@@ -48,17 +51,38 @@ IdComponent::IdComponent( const IdComponent& original )
|
||||
ref_count->increment(); // increment number of references to this id
|
||||
}
|
||||
|
||||
// Increment reference counter
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::incRefCount
|
||||
///\brief Increments id reference counter.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void IdComponent::incRefCount() { ref_count->increment(); }
|
||||
|
||||
// Decrement reference counter
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::decRefCount
|
||||
///\brief Decrements id reference counter.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void IdComponent::decRefCount() { ref_count->decrement(); }
|
||||
|
||||
// Get the reference counter to this identifier
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::getCounter
|
||||
///\brief Returns the reference counter to this identifier.
|
||||
///\return Reference count
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int IdComponent::getCounter() { return( ref_count->getCounter()); }
|
||||
|
||||
// Decrements the reference counter then determines if there are no more
|
||||
// reference to this object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::noReference
|
||||
///\brief Determines whether this object has any references.
|
||||
///\return \c true if there is no reference, and \c false, otherwise.
|
||||
///\note This function will be obsolete in the next release.
|
||||
// Description
|
||||
// Decrements the reference counter then determines if there
|
||||
// are no more reference to this object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool IdComponent::noReference()
|
||||
{
|
||||
if( ref_count->getCounter() > 0 )
|
||||
@@ -66,13 +90,20 @@ bool IdComponent::noReference()
|
||||
return( ref_count->getCounter() == 0 ? true:false );
|
||||
}
|
||||
|
||||
/* Assignment operator.
|
||||
Description:
|
||||
Reset the identifier of this object so that the HDF5 id can be properly
|
||||
closed. Copy the new identifier to this object, then increment the
|
||||
reference counter of the identifier to indicate that another object
|
||||
is referencing the identifier.
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::operator=
|
||||
///\brief Assignment operator.
|
||||
///\param rhs - IN: Reference to the existing object
|
||||
///\return Reference to IdComponent instance
|
||||
///\exception H5::IdComponentException when attempt to close the HDF5
|
||||
/// object fails
|
||||
// Description
|
||||
// Reset the identifier of this object so that the HDF5 id can
|
||||
// be properly closed. Copy the id from rhs to this object,
|
||||
// then increment the reference counter of the id to indicate
|
||||
// that another object is referencing it.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent& IdComponent::operator=( const IdComponent& rhs )
|
||||
{
|
||||
// reset the identifier of this object - resetIdComponent will call the
|
||||
@@ -93,13 +124,20 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs )
|
||||
return( *this );
|
||||
}
|
||||
|
||||
/* Sets the identifier of this object to a new value
|
||||
Description:
|
||||
Reset the current identifier of this object so that the HDF5
|
||||
id can be appropriately closed. If only this object references
|
||||
its identifier, its reference counter will be deleted. A new
|
||||
reference counter is created for the new HDF5 object id.
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::setId
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
///\exception H5::IdComponentException when the attempt to close the HDF5
|
||||
/// object fails
|
||||
///\par Description:
|
||||
/// The calling routine must reset the id of this object by
|
||||
/// calling resetIdComponent and passing in the "this" pointer.
|
||||
/// resetIdComponent ensures that the HDF5 id will be
|
||||
/// appropriately closed. If only this object references its
|
||||
/// id, its reference counter will be deleted. A new reference
|
||||
/// counter is created for the new HDF5 object id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void IdComponent::setId( hid_t new_id )
|
||||
{
|
||||
// reset the identifier of this object, call appropriate H5Xclose
|
||||
@@ -115,20 +153,34 @@ void IdComponent::setId( hid_t new_id )
|
||||
ref_count = new RefCounter;
|
||||
}
|
||||
|
||||
// Gets the id of this object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::getId
|
||||
///\brief Returns the id of this object.
|
||||
///\return HDF5 object id
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t IdComponent::getId () const
|
||||
{
|
||||
return( id );
|
||||
}
|
||||
|
||||
// Reset this object by deleting its RefCounter
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::reset
|
||||
///\brief Reset this object by deleting/resetting its reference counter.
|
||||
///\return HDF5 object id
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void IdComponent::reset ()
|
||||
{
|
||||
delete ref_count;
|
||||
ref_count = NULL;
|
||||
}
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent::~IdComponent() {
|
||||
|
||||
/* uncomment this block and complete it when deciding to use dontAtExit
|
||||
@@ -155,6 +207,133 @@ IdComponent::~IdComponent() {
|
||||
*/
|
||||
}
|
||||
|
||||
//
|
||||
// Implementation of protected functions
|
||||
//
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::p_get_file_name
|
||||
// Purpose: Gets the name of the file, in which this object belongs.
|
||||
// Exception: H5::IdComponentException
|
||||
// Description:
|
||||
// This function is protected so that the user applications can
|
||||
// only have access to its code via allowable classes, namely,
|
||||
// H5File and H5Object subclasses.
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
string IdComponent::p_get_file_name() const
|
||||
{
|
||||
// Preliminary call to H5Fget_name to get the length of the file name
|
||||
ssize_t name_size = H5Fget_name(id, NULL, 0);
|
||||
|
||||
// If H5Aget_name returns a negative value, raise an exception,
|
||||
if( name_size < 0 )
|
||||
{
|
||||
throw IdComponentException("IdComponent::p_get_file_name",
|
||||
"H5Fget_name failed");
|
||||
}
|
||||
|
||||
// Call H5Fget_name again to get the actual file name
|
||||
char* name_C = new char[name_size+1]; // temporary C-string for C API
|
||||
name_size = H5Fget_name(id, name_C, name_size+1);
|
||||
|
||||
// Check for failure again
|
||||
if( name_size < 0 )
|
||||
{
|
||||
throw IdComponentException("IdComponent::p_get_file_name",
|
||||
"H5Fget_name failed");
|
||||
}
|
||||
|
||||
// Convert the C file name and return
|
||||
string file_name(name_C);
|
||||
delete name_C;
|
||||
return(file_name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::p_reference (protected)
|
||||
// Purpose Creates a reference to an HDF5 object or a dataset region.
|
||||
// Parameters
|
||||
// name - IN: Name of the object to be referenced
|
||||
// dataspace - IN: Dataspace with selection
|
||||
// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
// Return A reference
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void* IdComponent::p_reference(const char* name, hid_t space_id, H5R_type_t ref_type) const
|
||||
{
|
||||
void *ref=NULL;
|
||||
herr_t ret_value = H5Rcreate(ref, id, name, ref_type, space_id);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw IdComponentException("IdComponent::p_reference",
|
||||
"H5Rcreate failed");
|
||||
}
|
||||
return(ref);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::p_get_obj_type (protected)
|
||||
// Purpose Retrieves the type of object that an object reference points to.
|
||||
// Parameters
|
||||
// ref - IN: Reference to query
|
||||
// ref_type - IN: Type of reference to query
|
||||
// Return An object type, which can be one of the following:
|
||||
// H5G_LINK Object is a symbolic link.
|
||||
// H5G_GROUP Object is a group.
|
||||
// H5G_DATASET Object is a dataset.
|
||||
// H5G_TYPE Object is a named datatype
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t IdComponent::p_get_obj_type(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Rget_obj_type(id, ref_type, ref);
|
||||
if (obj_type == H5G_UNKNOWN)
|
||||
{
|
||||
throw IdComponentException("IdComponent::p_get_obj_type",
|
||||
"H5R_get_obj_type failed");
|
||||
}
|
||||
return(obj_type);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::p_get_region (protected)
|
||||
// Purpose Retrieves a dataspace with the region pointed to selected.
|
||||
// Parameters
|
||||
// ref_type - IN: Type of reference to get region of - default
|
||||
// to H5R_DATASET_REGION
|
||||
// ref - IN: Reference to get region of
|
||||
// Return Dataspace id
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t IdComponent::p_get_region(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
hid_t space_id = H5Rget_region(id, ref_type, ref);
|
||||
if (space_id < 0)
|
||||
{
|
||||
throw IdComponentException("IdComponent::p_get_region",
|
||||
"H5Rget_region failed");
|
||||
}
|
||||
return(space_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent default constructor - private
|
||||
///\brief Default constructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent::IdComponent() : id(-1)
|
||||
{
|
||||
// starts counting object references
|
||||
ref_count = new RefCounter;
|
||||
}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -25,23 +25,6 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP IdComponent {
|
||||
public:
|
||||
// Parent classes must reset the current IdComponent copy
|
||||
// before setting new id to control reference count
|
||||
void setId( hid_t new_id );
|
||||
|
||||
// Pure virtual function so appropriate close function can
|
||||
// be called by subclasses' for the corresponding object
|
||||
virtual void p_close() const = 0;
|
||||
|
||||
// Creates an object to hold an HDF5 identifier
|
||||
IdComponent( const hid_t h5_id );
|
||||
|
||||
// Copy constructor: makes copy of the original IdComponent object.
|
||||
IdComponent( const IdComponent& original );
|
||||
|
||||
// Gets the value of IdComponent's data member
|
||||
virtual hid_t getId () const;
|
||||
|
||||
// Increment reference counter
|
||||
void incRefCount();
|
||||
|
||||
@@ -58,52 +41,62 @@ class H5_DLLCPP IdComponent {
|
||||
// Assignment operator
|
||||
IdComponent& operator=( const IdComponent& rhs );
|
||||
|
||||
// Resets this IdComponent instance
|
||||
//template <class Type>
|
||||
//void reset( Type* parent );
|
||||
void reset();
|
||||
void resetId();
|
||||
|
||||
// Sets the identifier of this object to a new value.
|
||||
void setId( hid_t new_id );
|
||||
|
||||
// Creates an object to hold an HDF5 identifier
|
||||
IdComponent( const hid_t h5_id );
|
||||
|
||||
// Copy constructor: makes copy of the original IdComponent object.
|
||||
IdComponent( const IdComponent& original );
|
||||
|
||||
// Gets the value of IdComponent's data member
|
||||
virtual hid_t getId () const;
|
||||
|
||||
// Pure virtual function so appropriate close function can
|
||||
// be called by subclasses' for the corresponding object
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer.
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
virtual void p_close() const = 0;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Destructor
|
||||
virtual ~IdComponent();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
hid_t id; // HDF5 object id
|
||||
RefCounter* ref_count; // used to keep track of the
|
||||
// number of copies of an object
|
||||
|
||||
// Default constructor
|
||||
// Default constructor.
|
||||
IdComponent();
|
||||
|
||||
// Gets the name of the file, in which an HDF5 object belongs.
|
||||
#ifndef H5_NO_STD
|
||||
std::string p_get_file_name() const;
|
||||
#else
|
||||
string p_get_file_name() const;
|
||||
#endif // H5_NO_STD
|
||||
|
||||
// Gets the id of the H5 file in which the given object is located.
|
||||
hid_t p_get_file_id();
|
||||
|
||||
// Creates a reference to an HDF5 object or a dataset region.
|
||||
void* p_reference(const char* name, hid_t space_id, H5R_type_t ref_type) const;
|
||||
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
}; // end class IdComponent
|
||||
|
||||
// BMR - including template member function implementation here to
|
||||
// prevent compilation errors. When the compilers support template
|
||||
// member functions in *.C files, move them to IdComponent.C.
|
||||
|
||||
// This function makes sure that this IdComponent instance actually
|
||||
// represents an HDF5 component and that this HDF5 component is no longer
|
||||
// referenced, then calls the parent function p_close to close the
|
||||
// appropriate HDF5 component. In addition, this identifier instance
|
||||
// will delete itself.
|
||||
// Type is the class of the instance to whom this IdComponent object
|
||||
// belongs.
|
||||
/* 11/10/00 - BMR: commented this member function because many compilers
|
||||
still have no support for member template function. The function is
|
||||
replaced by resetIdComponent in H5Idtemplates.h
|
||||
template <class Type>
|
||||
void IdComponent::reset( Type* parent )
|
||||
{
|
||||
if( ref_count->noReference()) // ref_count is decremented here
|
||||
{
|
||||
if( id > 0 )
|
||||
parent->p_close(); // which p_close depends on whom this
|
||||
// IdComponent object belongs to
|
||||
delete ref_count; // delete the reference counter
|
||||
delete this; // this IdComponent object deletes itself
|
||||
}
|
||||
}
|
||||
*/
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -22,10 +22,24 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Older compilers (baldric) don't support template member functions
|
||||
// and IdComponent::reset is one; so at this time, the resetId is not
|
||||
// a member function so it can be template to work around that problem.
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: resetIdComponent
|
||||
///\brief Resets the id of the passed-in object.
|
||||
///\param obj - IN: A "this" pointer of an IdComponent object
|
||||
///\exception H5::Exception's subclasses, thrown by p_close
|
||||
///\par Description:
|
||||
/// This function is used to reset an IdComponent object
|
||||
/// before using it again for another HDF5 object. If
|
||||
/// the member \a id is the valid id of an HDF5 object, which
|
||||
/// this IdComponent object represents, the associate close
|
||||
/// function will be called to properly close the HDF5 object.
|
||||
//
|
||||
// Note: Some older compilers don't support template member functions;
|
||||
// so at this time, resetIdComponent is not a member function so
|
||||
// it can be template to work around that problem.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
template <class Type>
|
||||
H5_DLLCPP void resetIdComponent(
|
||||
Type* obj ) // pointer to object to be reset
|
||||
@@ -40,7 +54,7 @@ H5_DLLCPP void resetIdComponent(
|
||||
obj->reset(); // delete ref_count from IdComponent
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -20,3 +20,18 @@
|
||||
// by #include <hdf5.h>, but decide not to. BMR - 3/22/01
|
||||
|
||||
#include <hdf5.h>
|
||||
|
||||
// Define bool type for platforms that don't support bool yet
|
||||
#ifdef BOOL_NOTDEFINED
|
||||
#ifdef false
|
||||
#undef false
|
||||
#endif
|
||||
#ifdef true
|
||||
#undef true
|
||||
#endif
|
||||
typedef int bool;
|
||||
const bool false = 0;
|
||||
const bool true = 1;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5DxferProp.h"
|
||||
@@ -33,31 +35,51 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType default constructor
|
||||
///\brief Default constructor: Creates a stub integer datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType::IntType() {}
|
||||
|
||||
// Copy constructor: makes copy of the original IntType object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original IntType object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType::IntType( const IntType& original ) : AtomType( original ) {}
|
||||
|
||||
// Creates a integer type using a predefined type
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType overloaded constructor
|
||||
///\brief Creates a integer type using a predefined type
|
||||
///\param pred_type - IN: Predefined datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType::IntType( const PredType& pred_type ) : AtomType()
|
||||
{
|
||||
// use DataType::copy to make a copy of this predefined type
|
||||
copy( pred_type );
|
||||
}
|
||||
|
||||
/* BMR - may not keep
|
||||
IntType& IntType::operator=( const PredType& rhs )
|
||||
{
|
||||
copy(rhs);
|
||||
return(*this);
|
||||
}
|
||||
*/
|
||||
|
||||
// Creates a integer datatype using an existing id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType overloaded constructor
|
||||
///\brief Creates an integer datatype using the id of an existing
|
||||
/// datatype.
|
||||
///\param existing_id - IN: Id of an existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {}
|
||||
|
||||
// Gets the integer datatype of the specified dataset - may reimplement -BMR
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType overloaded constructor
|
||||
///\brief Gets the integer datatype of the specified dataset.
|
||||
///\param dataset - IN: Dataset that this integer datatype associates with
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType::IntType( const DataSet& dataset ) : AtomType()
|
||||
{
|
||||
// Calls C function H5Dget_type to get the id of the datatype
|
||||
@@ -69,11 +91,18 @@ IntType::IntType( const DataSet& dataset ) : AtomType()
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the sign type for an integer type
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType::getSign
|
||||
///\brief Retrieves the sign type for an integer type.
|
||||
///\return Valid sign type
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_sign_t IntType::getSign() const
|
||||
{
|
||||
H5T_sign_t type_sign = H5Tget_sign( id ); // C routine
|
||||
// Returns a valid sign type if successful
|
||||
|
||||
// Returns a valid sign type if no errors
|
||||
if( type_sign == H5T_SGN_ERROR )
|
||||
{
|
||||
throw DataTypeIException("IntType::getSign",
|
||||
@@ -82,7 +111,13 @@ H5T_sign_t IntType::getSign() const
|
||||
return( type_sign );
|
||||
}
|
||||
|
||||
// Sets the sign proprety for an integer type.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType::getSign
|
||||
///\brief Sets the sign property for an integer type.
|
||||
///\param sign - IN: Sign type
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void IntType::setSign( H5T_sign_t sign ) const
|
||||
{
|
||||
// Call C routine to set the sign property
|
||||
@@ -93,7 +128,11 @@ void IntType::setSign( H5T_sign_t sign ) const
|
||||
}
|
||||
}
|
||||
|
||||
// This destructor terminates access to the datatype
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IntType destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType::~IntType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -21,25 +21,11 @@ namespace H5 {
|
||||
#endif
|
||||
class H5_DLLCPP IntType : public AtomType {
|
||||
public:
|
||||
|
||||
// default constructor
|
||||
IntType();
|
||||
|
||||
// Creates a integer datatype using an existing id
|
||||
IntType( const hid_t existing_id );
|
||||
|
||||
// Creates a integer type using a predefined type
|
||||
IntType( const PredType& pred_type );
|
||||
|
||||
// Copy constructor: makes copy of IntType object
|
||||
IntType( const IntType& original );
|
||||
IntType(const PredType& pred_type);
|
||||
|
||||
// Gets the integer datatype of the specified dataset
|
||||
IntType( const DataSet& dataset );
|
||||
|
||||
// Assignment operator that takes a predefined type
|
||||
// may not use - BMR
|
||||
// virtual IntType& operator=( const PredType& rhs );
|
||||
IntType(const DataSet& dataset);
|
||||
|
||||
// Retrieves the sign type for an integer type
|
||||
H5T_sign_t getSign() const;
|
||||
@@ -47,6 +33,16 @@ class H5_DLLCPP IntType : public AtomType {
|
||||
// Sets the sign proprety for an integer type.
|
||||
void setSign( H5T_sign_t sign ) const;
|
||||
|
||||
// Default constructor
|
||||
IntType();
|
||||
|
||||
// Creates a integer datatype using an existing id
|
||||
IntType(const hid_t existing_id);
|
||||
|
||||
// Copy constructor: makes copy of IntType object
|
||||
IntType(const IntType& original);
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~IntType();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "H5CppDoc.h" // included only for Doxygen to generate part of RM
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5Library.h"
|
||||
@@ -22,10 +23,17 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This static variable will be set to true when dontAtExit is called
|
||||
bool H5Library::need_cleanup = false;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Initializes the HDF5 library.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::open
|
||||
///\brief Initializes the HDF5 library.
|
||||
///\exception H5::LibraryIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::open()
|
||||
{
|
||||
herr_t ret_value = H5open();
|
||||
@@ -35,7 +43,12 @@ void H5Library::open()
|
||||
}
|
||||
}
|
||||
|
||||
// Flushes all data to disk, closes files, and cleans up memory.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::close
|
||||
///\brief Flushes all data to disk, closes files, and cleans up memory.
|
||||
///\exception H5::LibraryIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::close()
|
||||
{
|
||||
herr_t ret_value = H5close();
|
||||
@@ -45,7 +58,12 @@ void H5Library::close()
|
||||
}
|
||||
}
|
||||
|
||||
// Instructs library not to install atexit cleanup routine
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::dontAtExit
|
||||
///\brief Instructs library not to install \c atexit cleanup routine
|
||||
///\exception H5::LibraryIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::dontAtExit()
|
||||
{
|
||||
herr_t ret_value = H5dont_atexit();
|
||||
@@ -55,7 +73,15 @@ void H5Library::dontAtExit()
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the HDF library release number.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::getLibVersion
|
||||
///\brief Returns the HDF library release number.
|
||||
///\param majnum - OUT: Major version of the library
|
||||
///\param minnum - OUT: Minor version of the library
|
||||
///\param relnum - OUT: Release number of the library
|
||||
///\exception H5::LibraryIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum )
|
||||
{
|
||||
herr_t ret_value = H5get_libversion( &majnum, &minnum, &relnum );
|
||||
@@ -65,17 +91,84 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel
|
||||
}
|
||||
}
|
||||
|
||||
// Verifies that the arguments match the version numbers compiled
|
||||
// into the library
|
||||
void H5Library::checkVersion( unsigned majnum, unsigned minnum, unsigned relnum )
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::checkVersion
|
||||
///\brief Verifies that the arguments match the version numbers
|
||||
/// compiled into the library
|
||||
///\param majnum - IN: Major version of the library
|
||||
///\param minnum - IN: Minor version of the library
|
||||
///\param relnum - IN: Release number of the library
|
||||
///\exception H5::LibraryIException
|
||||
///\par Description
|
||||
/// For information about library version, please refer to
|
||||
/// the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-VersCheck
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum)
|
||||
{
|
||||
herr_t ret_value = H5check_version( majnum, minnum, relnum );
|
||||
herr_t ret_value = H5check_version(majnum, minnum, relnum);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw LibraryIException("H5Library::checkVersion", "H5check_version failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::garbageCollect
|
||||
///\brief Walks through all the garbage collection routines for the
|
||||
/// library, which are supposed to free any unused memory they
|
||||
/// have allocated.
|
||||
///\exception H5::LibraryIException
|
||||
///\par Description
|
||||
/// It is not required that H5Library::garbageCollect be called
|
||||
/// at any particular time; it is only necessary in certain
|
||||
/// situations, such as when the application has performed actions
|
||||
/// that cause the library to allocate many objects. The
|
||||
/// application should call H5Library::garbageCollect if it
|
||||
/// eventually releases those objects and wants to reduce the
|
||||
/// memory used by the library from the peak usage required.
|
||||
///\par
|
||||
/// The library automatically garbage collects all the free
|
||||
/// lists when the application ends.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::garbageCollect()
|
||||
{
|
||||
herr_t ret_value = H5garbage_collect();
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::setFreeListLimits
|
||||
///\brief Sets limits on the different kinds of free lists.
|
||||
///\param reg_global_lim - IN: Limit on all "regular" free list memory used
|
||||
///\param reg_list_lim - IN: Limit on memory used in each "regular" free list
|
||||
///\param arr_global_lim - IN: Limit on all "array" free list memory used
|
||||
///\param arr_list_lim - IN: Limit on memory used in each "array" free list
|
||||
///\param blk_global_lim - IN: Limit on all "block" free list memory used
|
||||
///\param blk_list_lim - IN: Limit on memory used in each "block" free list
|
||||
///\exception H5::LibraryIException
|
||||
///\par Description
|
||||
/// Setting a value of -1 for a limit means no limit of that type.
|
||||
/// For more information on free list limits, please refer to C
|
||||
/// layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-SetFreeListLimits
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim,
|
||||
int arr_global_lim, int arr_list_lim, int blk_global_lim,
|
||||
int blk_list_lim)
|
||||
{
|
||||
herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed");
|
||||
}
|
||||
}
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
#define NOTATEXIT (-10) // just in case the HDF5 library use more
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
// negative constants. Note: the solution used for the atexit/global
|
||||
// destructors is not reliable, and desperately needs improvement
|
||||
// It is not even working, inifiteloop message still printed when
|
||||
@@ -28,7 +30,9 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP H5Library {
|
||||
public:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
static bool need_cleanup; // indicates if H5close should be called
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Initializes the HDF5 library.
|
||||
static void open();
|
||||
@@ -46,6 +50,14 @@ class H5_DLLCPP H5Library {
|
||||
// into the library
|
||||
static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum );
|
||||
|
||||
// Walks through all the garbage collection routines for the library,
|
||||
// which are supposed to free any unused memory they have allocated.
|
||||
static void garbageCollect();
|
||||
|
||||
// Sets limits on the different kinds of free lists.
|
||||
static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int
|
||||
arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);
|
||||
|
||||
private:
|
||||
// Default constructor - no instance ever created
|
||||
H5Library() {};
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "H5Idtemplates.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5AbstractDs.h"
|
||||
@@ -30,6 +32,7 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// userAttrOpWrpr simply interfaces between the user's function and the
|
||||
// C library function H5Aiterate; used to resolve the different prototype
|
||||
// problem. May be moved to Iterator later.
|
||||
@@ -45,17 +48,56 @@ extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Default constructor - set id to 0 by default here but may be set
|
||||
// to a valid HDF5 id, if any, by a subclass constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object default constructor (protected)
|
||||
// Description
|
||||
// The id is set by IdComponent() but subclass constructor will
|
||||
// set it to a valid HDF5 id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::H5Object() : IdComponent() {}
|
||||
|
||||
// Constructs an object from an existing HDF5 id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object overloaded constructor (protected)
|
||||
// Purpose Creates an H5Object object using the id of an existing HDF5
|
||||
// object.
|
||||
// Parameters object_id - IN: Id of an existing HDF5 object
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::H5Object( const hid_t object_id ) : IdComponent( object_id ) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original H5Object instance
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original H5Object
|
||||
/// instance.
|
||||
///\param original - IN: H5Object instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::H5Object( const H5Object& original ) : IdComponent( original ) {}
|
||||
|
||||
// Creates an attribute for a group, dataset, or named datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::createAttribute
|
||||
///\brief Creates an attribute for a group, dataset, or named datatype.
|
||||
///\param name - IN: Name of the attribute
|
||||
///\param data_type - IN: Datatype for the attribute
|
||||
///\param data_space - IN: Dataspace for the attribute - only simple
|
||||
/// dataspaces are allowed at this time
|
||||
///\param create_plist - IN: Creation property list - default to
|
||||
/// PropList::DEFAULT
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// The attribute name specified in \a name must be unique.
|
||||
/// Attempting to create an attribute with the same name as an
|
||||
/// existing attribute will raise an exception, leaving the
|
||||
/// pre-existing attribute intact. To overwrite an existing
|
||||
/// attribute with a new attribute of the same name, first
|
||||
/// delete the existing one with \c H5Object::removeAttr, then
|
||||
/// recreate it with this function.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
|
||||
{
|
||||
hid_t type_id = data_type.getId();
|
||||
@@ -75,13 +117,26 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type
|
||||
}
|
||||
}
|
||||
|
||||
// Creates an attribute for a group, dataset, or named datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::createAttribute
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::createAttribute( const string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
|
||||
{
|
||||
return( createAttribute( name.c_str(), data_type, data_space, create_plist ));
|
||||
}
|
||||
|
||||
// Opens an attribute given its name; name is given as char*
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::openAttribute
|
||||
///\brief Opens an attribute given its name.
|
||||
///\param name - IN: Name of the attribute
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::openAttribute( const char* name ) const
|
||||
{
|
||||
hid_t attr_id = H5Aopen_name( id, name );
|
||||
@@ -96,13 +151,26 @@ Attribute H5Object::openAttribute( const char* name ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Opens an attribute given its name; name is given as string
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::openAttribute
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::openAttribute( const string& name ) const
|
||||
{
|
||||
return( openAttribute( name.c_str()) );
|
||||
}
|
||||
|
||||
// Opens an attribute given its index.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::openAttribute
|
||||
///\brief Opens an attribute given its index.
|
||||
///\param idx - IN: Index of the attribute, a 0-based, non-negative integer
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::openAttribute( const unsigned int idx ) const
|
||||
{
|
||||
hid_t attr_id = H5Aopen_idx( id, idx );
|
||||
@@ -117,7 +185,22 @@ Attribute H5Object::openAttribute( const unsigned int idx ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Iterates a user's function over all the attributes of the dataset
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::iterateAttrs
|
||||
///\brief Iterates a user's function over all the attributes of an H5
|
||||
/// object, which may be a group, dataset or named datatype.
|
||||
///\param user_op - IN: User's function to operate on each attribute
|
||||
///\param idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices
|
||||
///\param op_data - IN: User's data to pass to user's operator function
|
||||
///\return Returned value of the last operator if it was non-zero, or
|
||||
/// zero if all attributes were processed
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// For information, please refer to the C layer Reference Manual
|
||||
/// at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5A.html#Annot-Iterate
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Object::iterateAttrs( attr_operator_t user_op, unsigned * idx, void *op_data )
|
||||
{
|
||||
// store the user's function and data
|
||||
@@ -140,7 +223,13 @@ int H5Object::iterateAttrs( attr_operator_t user_op, unsigned * idx, void *op_da
|
||||
}
|
||||
}
|
||||
|
||||
// Determines the number of attributes attached to
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::getNumAttrs
|
||||
///\brief Returns the number of attributes attached to this HDF5 object.
|
||||
///\return Number of attributes
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Object::getNumAttrs() const
|
||||
{
|
||||
int num_attrs = H5Aget_num_attrs( id );
|
||||
@@ -153,7 +242,13 @@ int H5Object::getNumAttrs() const
|
||||
return( num_attrs );
|
||||
}
|
||||
|
||||
// Removes the named attribute from this object.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::removeAttr
|
||||
///\brief Removes the named attribute from this object.
|
||||
///\param name - IN: Name of the attribute to be removed
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::removeAttr( const char* name ) const
|
||||
{
|
||||
herr_t ret_value = H5Adelete( id, name );
|
||||
@@ -162,12 +257,31 @@ void H5Object::removeAttr( const char* name ) const
|
||||
throw AttributeIException("H5Object::removeAttr", "H5Adelete failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::removeAttr
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::removeAttr( const string& name ) const
|
||||
{
|
||||
removeAttr( name.c_str() );
|
||||
}
|
||||
|
||||
// Flushes all buffers associated with a file to disk.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::flush
|
||||
///\brief Flushes all buffers associated with a file to disk.
|
||||
///\param scope - IN: Specifies the scope of the flushing action,
|
||||
/// which can be either of these values:
|
||||
/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
|
||||
/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// This object is used to identify the file to be flushed.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::flush(H5F_scope_t scope ) const
|
||||
{
|
||||
herr_t ret_value = H5Fflush( id, scope );
|
||||
@@ -177,9 +291,23 @@ void H5Object::flush(H5F_scope_t scope ) const
|
||||
}
|
||||
}
|
||||
|
||||
// each subclass' destructor calls the template function resetIdComponent()
|
||||
// to reset the corresponding IdComponent object and close the HDF5 object
|
||||
// where appropriate.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::getFileName
|
||||
///\brief Gets the name of the file, in which this HDF5 object belongs.
|
||||
///\return File name
|
||||
///\exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
string H5Object::getFileName() const
|
||||
{
|
||||
return(p_get_file_name());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::~H5Object() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
|
||||
|
||||
// Define the operator function pointer for H5Aiterate().
|
||||
@@ -41,59 +42,54 @@ class UserData4Aiterate { // user data for attribute iteration
|
||||
void* opData;
|
||||
H5Object* object;
|
||||
};
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// The above part is being moved into Iterator, but not completed
|
||||
|
||||
class H5_DLLCPP H5Object : public IdComponent {
|
||||
public:
|
||||
// Pure virtual function so appropriate close function can
|
||||
// be called by subclasses' for the corresponding HDF5 object
|
||||
//virtual void p_close() const = 0;
|
||||
|
||||
// Copy constructor: makes copy of an H5Object object.
|
||||
H5Object( const H5Object& original );
|
||||
|
||||
// Flushes all buffers associated with this object to disk
|
||||
void flush( H5F_scope_t scope ) const;
|
||||
|
||||
// Assignment operator
|
||||
//H5Object& operator=( const H5Object& rhs );
|
||||
|
||||
// Sets and gets H5Object's data member
|
||||
//void setId( hid_t new_id );
|
||||
//hid_t getId () const;
|
||||
|
||||
// Creates an attribute for a group, dataset, or named datatype.
|
||||
// PropList is currently not used, so always be default.
|
||||
Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
|
||||
Attribute createAttribute( const string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
|
||||
|
||||
// Opens an attribute given its name.
|
||||
Attribute openAttribute( const string& name ) const;
|
||||
Attribute openAttribute( const char* name ) const;
|
||||
Attribute openAttribute( const string& name ) const;
|
||||
|
||||
// Opens an attribute given its index.
|
||||
Attribute openAttribute( const unsigned int idx ) const;
|
||||
|
||||
// Iterate user's function over the attributes of this object
|
||||
int iterateAttrs( attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL );
|
||||
// Flushes all buffers associated with this object to disk
|
||||
void flush( H5F_scope_t scope ) const;
|
||||
|
||||
// Gets the name of the file, in which this HDF5 object belongs.
|
||||
string getFileName() const;
|
||||
|
||||
// Determines the number of attributes attached to this object.
|
||||
int getNumAttrs() const;
|
||||
|
||||
// Removes the named attribute from this object.
|
||||
void removeAttr( const string& name ) const;
|
||||
void removeAttr( const char* name ) const;
|
||||
// Iterate user's function over the attributes of this object
|
||||
int iterateAttrs( attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL );
|
||||
|
||||
// Removes the named attribute from this object.
|
||||
void removeAttr( const char* name ) const;
|
||||
void removeAttr( const string& name ) const;
|
||||
|
||||
// Copy constructor: makes copy of an H5Object object.
|
||||
H5Object(const H5Object& original);
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~H5Object();
|
||||
|
||||
protected:
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Default constructor
|
||||
H5Object();
|
||||
|
||||
// Creates a copy of an existing object giving the object id
|
||||
H5Object( const hid_t object_id );
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
}; /* end class H5Object */
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5AtomType.h"
|
||||
#include "H5Library.h"
|
||||
@@ -29,25 +31,36 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
PredType::PredType() : AtomType() {}
|
||||
|
||||
// creates predefined datatype, so set DataType::is_predtype to true by default
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PredType overloaded constructor
|
||||
///\brief Creates a PredType object using the id of an existing
|
||||
/// predefined datatype.
|
||||
///\param predtype_id - IN: Id of a predefined datatype
|
||||
// Description
|
||||
// This constructor creates a predefined datatype, so it sets
|
||||
// DataType::is_predtype to true.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id )
|
||||
{
|
||||
is_predtype = true;
|
||||
}
|
||||
|
||||
// Copy constructor: makes a copy of this PredType object.
|
||||
PredType::PredType( const PredType& original ) : AtomType( original ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PredType default constructor
|
||||
///\brief Default constructor: Creates a stub predefined datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::PredType() : AtomType() {}
|
||||
|
||||
// Makes a copy of the predefined type and stores the new
|
||||
// id in the left hand side object.
|
||||
PredType& PredType::operator=( const PredType& rhs )
|
||||
{
|
||||
copy(rhs);
|
||||
return(*this);
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PredType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original PredType object.
|
||||
///\param original - IN: PredType instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::PredType( const PredType& original ) : AtomType( original ) {}
|
||||
|
||||
const PredType PredType::NotAtexit; // only for atexit/global dest. problem
|
||||
|
||||
@@ -196,7 +209,31 @@ const PredType PredType::NATIVE_INT_LEAST64( E_NATIVE_INT_LEAST64 );
|
||||
const PredType PredType::NATIVE_UINT_LEAST64( E_NATIVE_UINT_LEAST64 );
|
||||
const PredType PredType::NATIVE_INT_FAST64( E_NATIVE_INT_FAST64 );
|
||||
const PredType PredType::NATIVE_UINT_FAST64( E_NATIVE_UINT_FAST64 );
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PredType::operator=
|
||||
///\brief Assignment operator.
|
||||
///\param rhs - IN: Reference to the predefined datatype
|
||||
///\return Reference to PredType instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Description
|
||||
// Makes a copy of the type on the right hand side and stores
|
||||
// the new id in the left hand side object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PredType& PredType::operator=( const PredType& rhs )
|
||||
{
|
||||
copy(rhs);
|
||||
return(*this);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PredType::getId
|
||||
///\brief Returns the HDF5 predefined type id.
|
||||
///\return HDF5 predefined type id or INVALID
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t PredType::getId() const
|
||||
{
|
||||
switch( id ) {
|
||||
@@ -468,6 +505,7 @@ hid_t PredType::getId() const
|
||||
} // end switch
|
||||
} // end of getId()
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// These dummy functions do not inherit from DataType - they'll
|
||||
// throw an DataTypeIException if invoked.
|
||||
void PredType::commit( H5Object& loc, const char* name )
|
||||
@@ -485,8 +523,14 @@ bool PredType::committed()
|
||||
throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." );
|
||||
return (0);
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Default destructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PredType destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::~PredType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -27,15 +27,17 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP PredType : public AtomType {
|
||||
public:
|
||||
// Makes a copy of the predefined type and stores the new
|
||||
// id in the left hand side object.
|
||||
PredType& operator=( const PredType& rhs );
|
||||
|
||||
// Returns the HDF5 predefined type id.
|
||||
virtual hid_t getId() const;
|
||||
|
||||
// Default destructor
|
||||
virtual ~PredType();
|
||||
|
||||
// Copy constructor - makes copy of the original object
|
||||
PredType( const PredType& original );
|
||||
|
||||
virtual hid_t getId() const;
|
||||
|
||||
// Declaration of predefined types; their definition is in Predtype.C
|
||||
// Declaration of predefined types; their definition is in H5PredType.cpp
|
||||
static const PredType STD_I8BE;
|
||||
static const PredType STD_I8LE;
|
||||
static const PredType STD_I16BE;
|
||||
@@ -173,11 +175,13 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
static const PredType NATIVE_INT_FAST64;
|
||||
static const PredType NATIVE_UINT_FAST64;
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// These dummy functions do not inherit from DataType - they'll
|
||||
// throw a DataTypeIException if invoked.
|
||||
void commit( H5Object& loc, const string& name );
|
||||
void commit( H5Object& loc, const char* name );
|
||||
bool committed();
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
// added this to work around the atexit/global destructor problem
|
||||
@@ -233,15 +237,18 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
};
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Default constructor
|
||||
PredType();
|
||||
|
||||
// Creates a pre-defined type using an HDF5 pre-defined constant
|
||||
PredType( const hid_t predtype_id ); // used by the library only
|
||||
|
||||
// Makes a copy of the predefined type and stores the new
|
||||
// id in the left hand side object.
|
||||
PredType& operator=( const PredType& rhs );
|
||||
// Copy constructor - makes copy of the original object
|
||||
PredType( const PredType& original );
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
||||
@@ -30,23 +30,40 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default property.
|
||||
//--------------------------------------------------------------------------
|
||||
const PropList PropList::DEFAULT( H5P_DEFAULT );
|
||||
|
||||
// Default constructor - set id to 0 by default here but may be set
|
||||
// to a valid one, if any, by a subclass constructor.
|
||||
PropList::PropList() : IdComponent( 0 ) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function Default constructor
|
||||
///\brief Default constructor: creates a stub property list object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PropList::PropList() : IdComponent(0) {}
|
||||
|
||||
// Copy constructor: makes a copy of the original object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList copy constructor
|
||||
///\brief Copy constructor
|
||||
///\param original - IN: The original property list to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PropList::PropList( const PropList& original ) : IdComponent( original ) {}
|
||||
|
||||
/* Constructor that takes an existing property list id.
|
||||
Description:
|
||||
Uses an HDF5 id to create a PropList identifier object. This id
|
||||
can be either an existing property list id or a default property
|
||||
list id. Design note: in the case of default property list,
|
||||
the identifier still has reference counter; the p_close function
|
||||
will take care of not to call H5Pclose on the default id.
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList overloaded constructor
|
||||
///\brief Creates a property list using the id of an existing property.
|
||||
///\param plist_id - IN: Id of the existing property list
|
||||
///\exception H5::PropListIException
|
||||
// Description
|
||||
// This function calls H5Pcreate to create a new property list
|
||||
// if the given id, plist_id, is that of a property class. If
|
||||
// the given id is equal to H5P_NO_CLASS, then set this
|
||||
// property's id to H5P_DEFAULT, otherwise, to the given id.
|
||||
// Note: someone else added this code without comments and this
|
||||
// description was what I came up with from reading the code.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PropList::PropList( const hid_t plist_id ) : IdComponent(0)
|
||||
{
|
||||
if (H5I_GENPROP_CLS == H5Iget_type(plist_id)) {
|
||||
@@ -65,7 +82,13 @@ PropList::PropList( const hid_t plist_id ) : IdComponent(0)
|
||||
}
|
||||
}
|
||||
|
||||
// Makes a copy of an existing property list
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::copy
|
||||
///\brief Makes a copy of an existing property list
|
||||
///\param like_plist - IN: Reference to the existing property list
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::copy( const PropList& like_plist )
|
||||
{
|
||||
// reset the identifier of this PropList - send 'this' in so that
|
||||
@@ -88,22 +111,33 @@ void PropList::copy( const PropList& like_plist )
|
||||
}
|
||||
}
|
||||
|
||||
// Makes a copy of the property list on the right hand side and stores
|
||||
// the new id in the left hand side object.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::operator=
|
||||
///\brief Assignment operator.
|
||||
///\param rhs - IN: Reference to the existing property list
|
||||
///\return Reference to PropList instance
|
||||
///\exception H5::PropListIException
|
||||
// Description
|
||||
// Makes a copy of the property list on the right hand side
|
||||
// and stores the new id in the left hand side object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PropList& PropList::operator=( const PropList& rhs )
|
||||
{
|
||||
copy(rhs);
|
||||
return(*this);
|
||||
}
|
||||
|
||||
// Copies a property from one list or class to another
|
||||
void PropList::copyProp( PropList& dest, PropList& src, const string& name )
|
||||
{
|
||||
copyProp( dest, src, name.c_str());
|
||||
}
|
||||
|
||||
// Copies a property from one list or class to another
|
||||
void PropList::copyProp( PropList& dest, PropList& src, const char *name )
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::copyProp
|
||||
///\brief Copies a property from one list or class to another.
|
||||
///\param dest - IN: Destination property list or class
|
||||
///\param src - IN: Source property list or class
|
||||
///\param name - IN: Name of the property to copy - \c char pointer
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const
|
||||
{
|
||||
hid_t dst_id = dest.getId();
|
||||
hid_t src_id = src.getId();
|
||||
@@ -112,10 +146,33 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name )
|
||||
{
|
||||
throw PropListIException("PropList::copyProp", "H5Pcopy_prop failed");
|
||||
}
|
||||
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::copyProp
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param dest - IN: Destination property list or class
|
||||
///\param src - IN: Source property list or class
|
||||
///\param name - IN: Name of the property to copy - \c std::string
|
||||
///\exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::copyProp( PropList& dest, PropList& src, const string& name ) const
|
||||
{
|
||||
copyProp( dest, src, name.c_str());
|
||||
}
|
||||
|
||||
// Closes the property list if it is not a default one
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::p_close (private)
|
||||
// Purpose: Closes the property list if it is not a default one.
|
||||
// Exception H5::PropListIException
|
||||
// Description
|
||||
// This function will be obsolete because its functionality
|
||||
// is recently handled by the C library layer. - May, 2004
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::p_close() const
|
||||
{
|
||||
if( id != H5P_NO_CLASS ) // not a constant, should call H5Pclose
|
||||
@@ -127,8 +184,15 @@ void PropList::p_close() const
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Returns the class of this property list, i.e. H5P_FILE_CREATE...
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getClass
|
||||
///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE...
|
||||
///\return The property list class if it is not equal to \c H5P_NO_CLASS
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t PropList::getClass() const
|
||||
{
|
||||
hid_t plist_class = H5Pget_class( id );
|
||||
@@ -140,8 +204,384 @@ hid_t PropList::getClass() const
|
||||
return( plist_class );
|
||||
}
|
||||
|
||||
// The destructor of this instance calls the template resetIdComponent to
|
||||
// reset its identifier
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::propExist
|
||||
///\brief Query the existance of a property in a property object.
|
||||
///\param name - IN: Name of property to check for - \c char pointer
|
||||
///\return true if the property exists in the property object, and
|
||||
/// false, otherwise.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// This routine checks if a property exists within a property
|
||||
/// list or class.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
bool PropList::propExist(const char* name ) const
|
||||
{
|
||||
// Calls C routine H5Pexist to determine whether a property exists
|
||||
// within a property list or class. It returns a positive value, 0,
|
||||
// or a negative value
|
||||
htri_t ret_value = H5Pexist(id, name);
|
||||
if( ret_value > 0 )
|
||||
return true;
|
||||
else if( ret_value == 0 )
|
||||
return false;
|
||||
else // Raise exception when H5Pexist returns a negative value
|
||||
{
|
||||
throw PropListIException("PropList::propExist", "H5Pexist failed");
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::propExist
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to check for - \c std::string
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
bool PropList::propExist(const string& name ) const
|
||||
{
|
||||
return( propExist( name.c_str()) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::closeClass
|
||||
///\brief Close a property list class.
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Releases memory and de-attaches a class from the property
|
||||
/// list class hierarchy.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::closeClass() const
|
||||
{
|
||||
herr_t ret_value = H5Pclose_class(id);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("PropList::closeClass", "H5Pclose_class failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getProperty
|
||||
///\brief Query the value of a property in a property list.
|
||||
///\param name - IN: Name of property to query - \c char pointer
|
||||
///\param value - OUT: Pointer to the buffer for the property value
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Retrieves a copy of the value for a property in a property list. The
|
||||
/// property name must exist or this routine will throw an exception.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::getProperty(const char* name, void* value) const
|
||||
{
|
||||
herr_t ret_value = H5Pget(id, name, value);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("PropList::getProperty", "H5Pget failed");
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getProperty
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to query - \c char pointer
|
||||
///\return The property that is a \c std::string.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
string PropList::getProperty(const char* name) const
|
||||
{
|
||||
size_t size = getPropSize(name);
|
||||
char* prop_strg_C = new char[size+1]; // temporary C-string for C API
|
||||
herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API
|
||||
|
||||
// Throw exception if H5Pget returns failure
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("PropList::getProperty", "H5Pget failed");
|
||||
}
|
||||
|
||||
// Return propety value as a string after deleting temp C-string
|
||||
string prop_strg = string(prop_strg_C);
|
||||
delete prop_strg_C;
|
||||
return (prop_strg);
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getProperty
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to query - \c str::string
|
||||
///\param value - OUT: Pointer to the buffer for the property value
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::getProperty(const string& name, void* value) const
|
||||
{
|
||||
getProperty(name.c_str(), value);
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getProperty
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to query - \c std::string
|
||||
///\return The property that is a \c std::string.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
string PropList::getProperty(const string& name) const
|
||||
{
|
||||
return (getProperty(name.c_str()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getPropSize
|
||||
///\brief Query the size of a property in a property list or class.
|
||||
///\param name - IN: Name of property to query
|
||||
///\return Size of the property
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// This routine retrieves the size of a property's value
|
||||
/// in bytes. Zero-sized properties are allowed and the return
|
||||
/// value will be of 0. This function works for both property
|
||||
/// lists and classes.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
size_t PropList::getPropSize(const char *name) const
|
||||
{
|
||||
size_t prop_size;
|
||||
herr_t ret_value = H5Pget_size(id, name, &prop_size);
|
||||
if (prop_size < 0)
|
||||
{
|
||||
throw PropListIException("PropList::getPropSize", "H5Pget_size failed");
|
||||
}
|
||||
return(prop_size);
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getPropSize
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to query - \c std::string
|
||||
///
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
size_t PropList::getPropSize(const string& name) const
|
||||
{
|
||||
return (getPropSize(name.c_str()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getClassName
|
||||
///\brief Return the name of a generic property list class
|
||||
///\return A string containing the class name, if success, otherwise,
|
||||
/// a NULL string.
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
string PropList::getClassName() const
|
||||
{
|
||||
char* temp_str;
|
||||
temp_str = H5Pget_class_name(id);
|
||||
|
||||
if (temp_str != NULL)
|
||||
{
|
||||
string class_name = string(temp_str);
|
||||
free(temp_str);
|
||||
return(class_name);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getNumProps
|
||||
///\brief Returns the number of properties in this property list or class.
|
||||
///\return Size of the property.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
size_t PropList::getNumProps() const
|
||||
{
|
||||
size_t nprops;
|
||||
herr_t ret_value = H5Pget_nprops (id, &nprops);
|
||||
if( nprops < 0 )
|
||||
{
|
||||
throw PropListIException("PropList::getNumProps", "H5Pget_nprops failed");
|
||||
}
|
||||
return (nprops);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::setProperty
|
||||
///\brief Set a property's value in a property list.
|
||||
///\param name - IN: Name of property to set - \c char pointer
|
||||
///\param value - IN: Void pointer to the value for the property
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::setProperty(const char* name, void* value) const
|
||||
{
|
||||
herr_t ret_value = H5Pset(id, name, value);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("PropList::setProperty", "H5Pset failed");
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::setProperty
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to set - \c char pointer
|
||||
///\param charptr - IN: Char pointer to the value for the property
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::setProperty(const char* name, const char* charptr) const
|
||||
{
|
||||
herr_t ret_value = H5Pset(id, name, (void*) charptr);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("PropList::setProperty", "H5Pset failed");
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::setProperty
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to set - \c char pointer
|
||||
///\param strg - IN: Value for the property is a \c std::string
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::setProperty(const char* name, string& strg) const
|
||||
{
|
||||
setProperty(name, strg.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::setProperty
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to set - \c std::string
|
||||
///\param value - IN: Void pointer to the value for the property
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::setProperty(const string& name, void* value) const
|
||||
{
|
||||
setProperty(name.c_str(), value);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::setProperty
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to set - \c std::string
|
||||
///\param strg - IN: Value for the property is a \c std::string
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::setProperty(const string& name, string& strg) const
|
||||
{
|
||||
setProperty(name.c_str(), strg.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::isAClass
|
||||
///\brief Determines whether a property list is a certain class.
|
||||
///\param prop_class - IN: Property class to query
|
||||
///\return true if the property list is a member of the property list
|
||||
/// class, and false, otherwise.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
bool PropList::isAClass(const PropList& prop_class) const
|
||||
{
|
||||
htri_t ret_value = H5Pisa_class(id, prop_class.getId());
|
||||
if( ret_value > 0 )
|
||||
return true;
|
||||
else if( ret_value == 0 )
|
||||
return false;
|
||||
else // Raise exception when H5Pisa_class returns a negative value
|
||||
{
|
||||
throw PropListIException("PropList::isAClass", "H5Pisa_class failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::removeProp
|
||||
///\brief Removes a property from a property list.
|
||||
///\param name - IN: Name of property to remove - \c char pointer
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::removeProp(const char *name) const
|
||||
{
|
||||
herr_t ret_value = H5Premove(id, name);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("PropList::removeProp", "H5Premove failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::removeProp
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
///\param name - IN: Name of property to remove - \c std::string
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::removeProp(const string& name) const
|
||||
{
|
||||
removeProp(name.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::operator==
|
||||
///\brief Compares this property list or class against the given list or class.
|
||||
///\param rhs - IN: Reference to the property list to compare
|
||||
///\return true if the property lists or classes are equal, and
|
||||
/// false, otherwise.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
bool PropList::operator==(const PropList& rhs) const
|
||||
{
|
||||
htri_t ret_value = H5Pequal(id, rhs.getId());
|
||||
if( ret_value > 0 )
|
||||
return true;
|
||||
else if( ret_value == 0 )
|
||||
return false;
|
||||
else // Raise exception when H5Pequal returns a negative value
|
||||
{
|
||||
throw PropListIException("PropList::operator==", "H5Pequal failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getClassParent
|
||||
///\brief Returns the parent class of a generic property class
|
||||
///\return The parent class of a property class
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
PropList PropList::getClassParent() const
|
||||
{
|
||||
hid_t class_id = H5Pget_class_parent(id);
|
||||
if (class_id <= 0)
|
||||
{
|
||||
throw PropListIException("PropList::getClassParent", "H5Pget_class_parent failed");
|
||||
}
|
||||
PropList pclass(class_id);
|
||||
return(pclass);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList destructor
|
||||
///\brief Properly terminates access to this property list.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PropList::~PropList()
|
||||
{
|
||||
// The property list id will be closed properly
|
||||
|
||||
@@ -25,34 +25,79 @@ class H5_DLLCPP PropList : public IdComponent {
|
||||
// Default property list
|
||||
static const PropList DEFAULT;
|
||||
|
||||
// Creates a property list of a given type or creates a copy of an
|
||||
// existing property list giving the property list id
|
||||
PropList( const hid_t plist_id );
|
||||
// Make a copy of the given property list using assignment statement
|
||||
PropList& operator=( const PropList& rhs );
|
||||
|
||||
// Default constructor: creates a PropList object - this object
|
||||
// does not represent any property list yet.
|
||||
PropList();
|
||||
// Compares this property list or class against the given list or class.
|
||||
bool operator==(const PropList& rhs) const;
|
||||
|
||||
// Copy constructor: creates a copy of a PropList object.
|
||||
PropList( const PropList& original );
|
||||
// Close a property list class.
|
||||
void closeClass() const;
|
||||
|
||||
// Makes a copy of the given property list.
|
||||
void copy( const PropList& like_plist );
|
||||
|
||||
// Make a copy of the given property list using assignment statement
|
||||
PropList& operator=( const PropList& rhs );
|
||||
|
||||
// Copies a property from one property list or property class to another
|
||||
void copyProp( PropList& dest, PropList& src, const string& name);
|
||||
void copyProp( PropList& dest, PropList& src, const char* name);
|
||||
void copyProp( PropList& dest, PropList& src, const char* name) const;
|
||||
void copyProp( PropList& dest, PropList& src, const string& name) const;
|
||||
|
||||
// Gets the class of this property list, i.e. H5P_FILE_CREATE,
|
||||
// H5P_FILE_ACCESS, ...
|
||||
hid_t getClass() const;
|
||||
|
||||
// Used by the API to close the property list
|
||||
void p_close() const;
|
||||
// Return the name of a generic property list class.
|
||||
string getClassName() const;
|
||||
|
||||
// Returns the parent class of a generic property class.
|
||||
PropList getClassParent() const;
|
||||
|
||||
// Returns the number of properties in this property list or class.
|
||||
size_t getNumProps() const;
|
||||
|
||||
// Query the value of a property in a property list.
|
||||
void getProperty(const char* name, void* value) const;
|
||||
string getProperty(const char* name) const;
|
||||
void getProperty(const string& name, void* value) const;
|
||||
string getProperty(const string& name) const;
|
||||
|
||||
// Set a property's value in a property list.
|
||||
void setProperty(const char* name, void* charptr) const;
|
||||
void setProperty(const char* name, const char* value) const;
|
||||
void setProperty(const char* name, string& strg) const;
|
||||
void setProperty(const string& name, void* value) const;
|
||||
void setProperty(const string& name, string& strg) const;
|
||||
|
||||
// Query the size of a property in a property list or class.
|
||||
size_t getPropSize(const char *name) const;
|
||||
size_t getPropSize(const string& name) const;
|
||||
|
||||
// Determines whether a property list is a certain class.
|
||||
bool isAClass(const PropList& prop_class) const;
|
||||
|
||||
/// Query the existance of a property in a property object.
|
||||
bool propExist(const char* name) const;
|
||||
bool propExist(const string& name) const;
|
||||
|
||||
// Removes a property from a property list.
|
||||
void removeProp(const char *name) const;
|
||||
void removeProp(const string& name) const;
|
||||
|
||||
// Default constructor: creates a stub PropList object.
|
||||
PropList();
|
||||
|
||||
// Creates a property list of a given type or creates a copy of an
|
||||
// existing property list giving the property list id.
|
||||
PropList(const hid_t plist_id);
|
||||
|
||||
// Copy constructor: creates a copy of a PropList object.
|
||||
PropList(const PropList& original);
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Used by the API to close the property list.
|
||||
void p_close() const;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Destructor: properly terminates access to this property list.
|
||||
virtual ~PropList();
|
||||
};
|
||||
|
||||
|
||||
@@ -13,36 +13,74 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5RefCounter.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Creates a reference counter to be used by an HDF5 object
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: RefCounter default constructor
|
||||
// Purpose Default constructor: Creates a reference counter and set it
|
||||
// to 1.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
RefCounter::RefCounter() : counter(1) {}
|
||||
|
||||
// Returns the current value of the reference counter
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: RefCounter::getCounter
|
||||
// Purpose Returns the current value of the reference counter.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int RefCounter::getCounter () const { return counter; }
|
||||
|
||||
// Increments the reference counter as a copy of the object that uses
|
||||
// this counter is created.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: RefCounter::increment
|
||||
// Purpose Increments the reference counter.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void RefCounter::increment() { counter++; }
|
||||
|
||||
// Decrements the reference counter as a copy of the object that uses
|
||||
// this counter is destroyed.
|
||||
void RefCounter::decrement() { counter--; }
|
||||
|
||||
// Decrements the reference counter then determines if there are no more
|
||||
// reference to the object that uses this counter
|
||||
bool RefCounter::noReference()
|
||||
{
|
||||
if( counter > 0 )
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: RefCounter::decrement
|
||||
// Purpose Decrements the reference counter.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void RefCounter::decrement()
|
||||
{
|
||||
if (counter > 0)
|
||||
counter--;
|
||||
return( counter == 0 ? true:false );
|
||||
else
|
||||
throw IdComponentException("RefCounter::decrement",
|
||||
"reference counter of this object has non-positive value");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: RefCounter::noReference
|
||||
// Purpose Returns true if there are no more reference to the object
|
||||
// that uses this counter.
|
||||
// Return true if there are no more reference to the object
|
||||
// that uses this counter, and false, otherwise.
|
||||
// Description
|
||||
// Decrements the reference counter then determines if there
|
||||
// are no more reference to the object that uses this counter.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool RefCounter::noReference()
|
||||
{
|
||||
if (counter > 0)
|
||||
counter--;
|
||||
return(counter <= 0 ? true:false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: RefCounter destructor
|
||||
// Purpose Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
RefCounter::~RefCounter() {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
|
||||
@@ -16,40 +16,36 @@
|
||||
#ifndef _H5RefCounter_H
|
||||
#define _H5RefCounter_H
|
||||
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// define bool type for platforms that don't support bool yet
|
||||
// Note: it is added here because most of the C++ library source
|
||||
// files include this header file
|
||||
#ifdef BOOL_NOTDEFINED
|
||||
#ifdef false
|
||||
#undef false
|
||||
#endif
|
||||
#ifdef true
|
||||
#undef true
|
||||
#endif
|
||||
typedef int bool;
|
||||
const bool false = 0;
|
||||
const bool true = 1;
|
||||
|
||||
#endif
|
||||
///\remarks The features provided by this class are now handled at
|
||||
/// the C library layer; thus, the class will be removed from
|
||||
/// future releases.
|
||||
|
||||
class H5_DLLCPP RefCounter {
|
||||
public:
|
||||
// Creates a reference counter to be used by an HDF5 object
|
||||
RefCounter();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Returns the current value of the reference counter.
|
||||
int getCounter () const;
|
||||
|
||||
// Increments the reference counter.
|
||||
void increment();
|
||||
|
||||
// Decrements the reference counter.
|
||||
void decrement();
|
||||
|
||||
// this bool function is used to determine whether to close an
|
||||
// HDF5 object when there are no more reference to that object
|
||||
// This function is used to determine whether to close an
|
||||
// HDF5 object when there are no more reference to that object.
|
||||
bool noReference();
|
||||
|
||||
// Creates a reference counter to be used by an HDF5 object.
|
||||
RefCounter();
|
||||
|
||||
~RefCounter();
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
int counter; // keeps track of number of copies of an object
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5AtomType.h"
|
||||
#include "H5AbstractDs.h"
|
||||
@@ -33,19 +35,45 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// Default constructor
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType default constructor
|
||||
///\brief Default constructor: Creates a stub string datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType::StrType() : AtomType() {}
|
||||
|
||||
// Creates a string type using a predefined type
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType overloaded constructor
|
||||
///\brief Creates a string datatype using a predefined type.
|
||||
///\param pred_type - IN: Predefined datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType::StrType( const PredType& pred_type ) : AtomType()
|
||||
{
|
||||
// use DataType::copy to make a copy of this predefined type
|
||||
copy( pred_type );
|
||||
}
|
||||
|
||||
// Creates a string type with a specified length - 1st argument could
|
||||
// have been skipped, but this constructor will collide with the one
|
||||
// that takes an existing id below
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType overloaded constructor
|
||||
///\brief Creates a string datatype with a specified length
|
||||
///\param existing_id - IN: Id of an existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Description
|
||||
// The 1st argument could have been skipped, but this
|
||||
// constructor will collide with the one that takes an
|
||||
// existing id.
|
||||
//
|
||||
// Update: by passing 'size' by reference will avoid the
|
||||
// clashing problem, so the 1st argument can actually be
|
||||
// omitted. This constructor should be replaced by the
|
||||
// other after announcing. - May, 2004
|
||||
///\note
|
||||
/// This constructor will be obsolete in later releases,
|
||||
/// please use StrType( const size_t& size ) instead.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType::StrType( const PredType& pred_type, const size_t size ) : AtomType()
|
||||
{
|
||||
// use DataType::copy to make a copy of the string predefined type
|
||||
@@ -53,14 +81,37 @@ StrType::StrType( const PredType& pred_type, const size_t size ) : AtomType()
|
||||
copy(pred_type);
|
||||
setSize(size);
|
||||
}
|
||||
StrType::StrType( const size_t& size ) : AtomType()
|
||||
{
|
||||
// use DataType::copy to make a copy of the string predefined type
|
||||
// then set its length
|
||||
copy(H5T_C_S1);
|
||||
setSize(size);
|
||||
}
|
||||
|
||||
// Creates a string datatype using an existing id
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType overloaded constructor
|
||||
///\brief Creates an StrType object using the id of an existing datatype.
|
||||
///\param existing_id - IN: Id of an existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {}
|
||||
|
||||
// Copy constructor: makes copy of the original StrType object
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original StrType object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType::StrType( const StrType& original ) : AtomType ( original ) {}
|
||||
|
||||
// Gets the string datatype of the specified dataset - will reimplement - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: EnumType overloaded constructor
|
||||
///\brief Gets the string datatype of the specified dataset
|
||||
///\param dataset - IN: Dataset that this string datatype associates with
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType::StrType( const DataSet& dataset ) : AtomType ()
|
||||
{
|
||||
// Calls C function H5Dget_type to get the id of the datatype
|
||||
@@ -72,7 +123,14 @@ StrType::StrType( const DataSet& dataset ) : AtomType ()
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the character set type of a string datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType::getCset
|
||||
///\brief Retrieves the character set type of this string datatype.
|
||||
///\return Character set type, which can be:
|
||||
/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_cset_t StrType::getCset() const
|
||||
{
|
||||
H5T_cset_t cset = H5Tget_cset( id );
|
||||
@@ -85,7 +143,14 @@ H5T_cset_t StrType::getCset() const
|
||||
return( cset );
|
||||
}
|
||||
|
||||
// Sets character set to be used.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType::setCset
|
||||
///\brief Sets character set to be used.
|
||||
///\param cset - IN: character set type
|
||||
///\exception H5::DataTypeIException
|
||||
/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void StrType::setCset( H5T_cset_t cset ) const
|
||||
{
|
||||
herr_t ret_value = H5Tset_cset( id, cset );
|
||||
@@ -96,7 +161,16 @@ void StrType::setCset( H5T_cset_t cset ) const
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the string padding method for a string datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType::getCset
|
||||
///\brief Retrieves the storage mechanism for of this string datatype.
|
||||
///\return String storage mechanism, which can be:
|
||||
/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does)
|
||||
/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros
|
||||
/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does)
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5T_str_t StrType::getStrpad() const
|
||||
{
|
||||
H5T_str_t strpad = H5Tget_strpad( id );
|
||||
@@ -110,7 +184,16 @@ H5T_str_t StrType::getStrpad() const
|
||||
return( strpad );
|
||||
}
|
||||
|
||||
// Defines the storage mechanism for character strings.
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType::setStrpad
|
||||
///\brief Defines the storage mechanism for this string datatype.
|
||||
///\param strpad - IN: String padding type
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For detail, please refer to the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetStrpad
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void StrType::setStrpad( H5T_str_t strpad ) const
|
||||
{
|
||||
herr_t ret_value = H5Tset_strpad( id, strpad );
|
||||
@@ -121,7 +204,11 @@ void StrType::setStrpad( H5T_str_t strpad ) const
|
||||
}
|
||||
}
|
||||
|
||||
// This destructor terminates access to the datatype
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: StrType destructor
|
||||
///\brief Properly terminates access to this string datatype.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType::~StrType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -22,36 +22,40 @@ namespace H5 {
|
||||
|
||||
class H5_DLLCPP StrType : public AtomType {
|
||||
public:
|
||||
// default constructor
|
||||
StrType();
|
||||
|
||||
// Creates a string type using a predefined type
|
||||
StrType( const PredType& pred_type );
|
||||
StrType(const PredType& pred_type);
|
||||
|
||||
// Creates a string type with specified length
|
||||
StrType( const PredType& pred_type, const size_t size );
|
||||
StrType(const size_t& size);
|
||||
|
||||
// Creates a string datatype using an existing id
|
||||
StrType( const hid_t existing_id );
|
||||
|
||||
// Copy constructor - makes a copy of the original object
|
||||
StrType( const StrType& original );
|
||||
// Creates a string type with specified length - will be obsolete
|
||||
StrType(const PredType& pred_type, const size_t size);
|
||||
|
||||
// Gets the string datatype of the specified dataset
|
||||
StrType( const DataSet& dataset );
|
||||
StrType(const DataSet& dataset);
|
||||
|
||||
// Retrieves the character set type of this string datatype.
|
||||
H5T_cset_t getCset() const;
|
||||
|
||||
// Sets character set to be used.
|
||||
void setCset( H5T_cset_t cset ) const;
|
||||
void setCset(H5T_cset_t cset) const;
|
||||
|
||||
// Retrieves the string padding method for this string datatype.
|
||||
H5T_str_t getStrpad() const;
|
||||
|
||||
// Defines the storage mechanism for character strings.
|
||||
void setStrpad( H5T_str_t strpad ) const;
|
||||
void setStrpad(H5T_str_t strpad) const;
|
||||
|
||||
// default constructor
|
||||
StrType();
|
||||
|
||||
// Creates a string datatype using an existing id
|
||||
StrType(const hid_t existing_id);
|
||||
|
||||
// Copy constructor - makes a copy of the original object
|
||||
StrType(const StrType& original);
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~StrType();
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
85
c++/src/H5VarLenType.cpp
Normal file
85
c++/src/H5VarLenType.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5RefCounter.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5VarLenType.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: VarLenType default constructor
|
||||
///\brief Default constructor: Creates a stub variable-length datatype.
|
||||
//--------------------------------------------------------------------------
|
||||
VarLenType::VarLenType() : DataType() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: VarLenType overloaded constructor
|
||||
///\brief Creates an VarLenType object using an existing id.
|
||||
///\param existing_id - IN: Id of an existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: VarLenType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original VarLenType object.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
VarLenType::VarLenType(const VarLenType& original) : DataType(original) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: VarLenType overloaded constructor
|
||||
///\brief Creates a new variable-length datatype based on the specified
|
||||
/// \a base_type.
|
||||
///\param base_type - IN: Pointer to existing datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Description
|
||||
// DataType passed by pointer to avoid clashing with copy
|
||||
// constructor.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
VarLenType::VarLenType(const DataType* base_type) : DataType()
|
||||
{
|
||||
id = H5Tvlen_create(base_type->getId());
|
||||
if (id <= 0)
|
||||
{
|
||||
throw DataTypeIException("VarLenType constructor",
|
||||
"H5Tvlen_create returns negative value");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: VarLenType destructor
|
||||
///\brief Properly terminates access to this datatype.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
VarLenType::~VarLenType() {}
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
#endif
|
||||
47
c++/src/H5VarLenType.h
Normal file
47
c++/src/H5VarLenType.h
Normal file
@@ -0,0 +1,47 @@
|
||||
// C++ informative line for the emacs editor: -*- C++ -*-
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class VarLenType inherits from DataType and provides wrappers for
|
||||
// the HDF5 C's Variable-length Datatypes.
|
||||
|
||||
#ifndef _H5VarLenType_H
|
||||
#define _H5VarLenType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
class H5_DLLCPP VarLenType : public DataType {
|
||||
public:
|
||||
// Constructor that creates a variable-length datatype based
|
||||
// on the specified base type.
|
||||
VarLenType(const DataType* base_type);
|
||||
|
||||
// Copy constructor - makes copy of the original object
|
||||
VarLenType( const VarLenType& original );
|
||||
|
||||
// Default destructor
|
||||
virtual ~VarLenType();
|
||||
|
||||
protected:
|
||||
// Default constructor
|
||||
VarLenType();
|
||||
|
||||
// Constructor that takes an existing id
|
||||
VarLenType( const hid_t existing_id );
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -38,7 +38,8 @@ LIB_SRC=H5Exception.cpp H5RefCounter.cpp H5IdComponent.cpp H5Library.cpp
|
||||
H5FcreatProp.cpp H5DcreatProp.cpp H5DxferProp.cpp H5DataType.cpp \
|
||||
H5DataSpace.cpp H5AbstractDs.cpp H5AtomType.cpp H5PredType.cpp \
|
||||
H5EnumType.cpp H5IntType.cpp H5FloatType.cpp H5StrType.cpp \
|
||||
H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp H5File.cpp
|
||||
H5ArrayType.cpp H5VarLenType.cpp H5CompType.cpp H5DataSet.cpp \
|
||||
H5CommonFG.cpp H5Group.cpp H5File.cpp
|
||||
LIB_OBJ=$(LIB_SRC:.cpp=.lo)
|
||||
|
||||
PUB_HDR=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h H5Classes.h \
|
||||
@@ -46,12 +47,15 @@ PUB_HDR=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h H5Classes.h
|
||||
H5DcreatProp.h H5DxferProp.h H5EnumType.h H5Exception.h H5FaccProp.h \
|
||||
H5FcreatProp.h H5File.h H5FloatType.h H5Group.h H5IdComponent.h \
|
||||
H5Include.h H5IntType.h H5Library.h H5Object.h H5PredType.h \
|
||||
H5PropList.h H5RefCounter.h H5StrType.h
|
||||
H5PropList.h H5RefCounter.h H5StrType.h H5CppDoc.h H5ArrayType.h \
|
||||
H5VarLenType.h
|
||||
|
||||
PUB_PROGS=h5c++
|
||||
|
||||
ARFLAGS=rs
|
||||
|
||||
## h5c++ is generated during configure time. Remove it only when distclean.
|
||||
DISTCLEAN=h5c++
|
||||
## libhdf5.settings is generated during configure. Remove it when distclean.
|
||||
DISTCLEAN=h5c++ libhdf5.settings
|
||||
|
||||
@CONCLUDE@
|
||||
|
||||
212
c++/src/cpp_doc_config
Normal file
212
c++/src/cpp_doc_config
Normal file
@@ -0,0 +1,212 @@
|
||||
# Doxyfile 1.3.7
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME =
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY = C:\HDF\cpplus_RM
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = YES
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF =
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = YES
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = NO
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT =
|
||||
FILE_PATTERNS =
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH = ../examples
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER = header.html
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
@@ -74,6 +74,7 @@ usage() {
|
||||
echo " -prefix=DIR Prefix directory to find HDF5 lib/ and include/"
|
||||
echo " subdirectories [default: $prefix]"
|
||||
echo " -show Show the commands without executing them"
|
||||
echo " -showconfig Show the HDF5 library configuration summary"
|
||||
echo " "
|
||||
echo " <compile line> - the normal compile line options for your compiler."
|
||||
echo " $prog_name uses the same compiler you used to compile"
|
||||
@@ -90,6 +91,17 @@ usage() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Show the configuration summary of the library recorded in the
|
||||
# libhdf5.settings file reside in the lib directory.
|
||||
showconfigure()
|
||||
{
|
||||
cat ${libdir}/libhdf5.settings
|
||||
status=$?
|
||||
}
|
||||
|
||||
# Main
|
||||
status=0
|
||||
|
||||
if test "$#" = "0"; then
|
||||
# No parameters specified, issue usage statement and exit.
|
||||
usage
|
||||
@@ -164,6 +176,10 @@ for arg in $@ ; do
|
||||
-show)
|
||||
SHOW="echo"
|
||||
;;
|
||||
-showconfig)
|
||||
showconfigure
|
||||
exit $status
|
||||
;;
|
||||
-help)
|
||||
usage
|
||||
;;
|
||||
|
||||
322
c++/src/header.html
Normal file
322
c++/src/header.html
Normal file
@@ -0,0 +1,322 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml"
|
||||
xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||||
xmlns="http://www.w3.org/TR/REC-html40">
|
||||
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
|
||||
<meta name=ProgId content=Word.Document>
|
||||
<meta name=Generator content="Microsoft Word 10">
|
||||
<meta name=Originator content="Microsoft Word 10">
|
||||
<link rel=File-List href="header_files/filelist.xml">
|
||||
<link rel=Edit-Time-Data href="header_files/editdata.mso">
|
||||
<!--[if !mso]>
|
||||
<style>
|
||||
v\:* {behavior:url(#default#VML);}
|
||||
o\:* {behavior:url(#default#VML);}
|
||||
w\:* {behavior:url(#default#VML);}
|
||||
.shape {behavior:url(#default#VML);}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<title>Main Page</title>
|
||||
<!--[if gte mso 9]><xml>
|
||||
<o:DocumentProperties>
|
||||
<o:Author>Randy Ribler</o:Author>
|
||||
<o:Template>Normal</o:Template>
|
||||
<o:LastAuthor>Randy Ribler</o:LastAuthor>
|
||||
<o:Revision>6</o:Revision>
|
||||
<o:TotalTime>16</o:TotalTime>
|
||||
<o:Created>2004-07-23T05:34:00Z</o:Created>
|
||||
<o:LastSaved>2004-07-23T06:03:00Z</o:LastSaved>
|
||||
<o:Pages>1</o:Pages>
|
||||
<o:Words>5</o:Words>
|
||||
<o:Characters>32</o:Characters>
|
||||
<o:Company>LC</o:Company>
|
||||
<o:Lines>1</o:Lines>
|
||||
<o:Paragraphs>1</o:Paragraphs>
|
||||
<o:CharactersWithSpaces>36</o:CharactersWithSpaces>
|
||||
<o:Version>10.2625</o:Version>
|
||||
</o:DocumentProperties>
|
||||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||||
<w:WordDocument>
|
||||
<w:SpellingState>Clean</w:SpellingState>
|
||||
<w:GrammarState>Clean</w:GrammarState>
|
||||
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
|
||||
</w:WordDocument>
|
||||
</xml><![endif]-->
|
||||
<link rel=Stylesheet type="text/css" media=all href=doxygen.css>
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";
|
||||
mso-believe-normal-left:yes;}
|
||||
h1
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
text-align:center;
|
||||
mso-pagination:widow-orphan;
|
||||
mso-outline-level:1;
|
||||
font-size:24.0pt;
|
||||
font-family:"Times New Roman";
|
||||
font-weight:bold;}
|
||||
h2
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
mso-outline-level:2;
|
||||
font-size:18.0pt;
|
||||
font-family:"Times New Roman";
|
||||
font-weight:bold;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:#252E78;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:#3D2185;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
address
|
||||
{margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
font-style:italic;}
|
||||
pre
|
||||
{margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
|
||||
font-size:10.0pt;
|
||||
font-family:"Courier New";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.formuladsp, li.formuladsp, div.formuladsp
|
||||
{mso-style-name:formuladsp;
|
||||
mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
text-align:center;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.mdtable, li.mdtable, div.mdtable
|
||||
{mso-style-name:mdtable;
|
||||
mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
background:#F4F4FB;
|
||||
border:none;
|
||||
mso-border-alt:solid #868686 .75pt;
|
||||
padding:0in;
|
||||
mso-padding-alt:0in 0in 0in 0in;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.mdrow, li.mdrow, div.mdrow
|
||||
{mso-style-name:mdrow;
|
||||
mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.mdescleft, li.mdescleft, div.mdescleft
|
||||
{mso-style-name:mdescleft;
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
background:#FAFAFA;
|
||||
font-size:10.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";
|
||||
font-style:italic;}
|
||||
p.mdescright, li.mdescright, div.mdescright
|
||||
{mso-style-name:mdescright;
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
background:#FAFAFA;
|
||||
font-size:10.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";
|
||||
font-style:italic;}
|
||||
p.memitemleft, li.memitemleft, div.memitemleft
|
||||
{mso-style-name:memitemleft;
|
||||
margin:3.0pt;
|
||||
mso-pagination:widow-orphan;
|
||||
background:#FAFAFA;
|
||||
border:none;
|
||||
mso-border-top-alt:solid #E0E0E0 .75pt;
|
||||
padding:0in;
|
||||
mso-padding-alt:1.0pt 0in 0in 0in;
|
||||
font-size:9.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.memitemright, li.memitemright, div.memitemright
|
||||
{mso-style-name:memitemright;
|
||||
margin:3.0pt;
|
||||
mso-pagination:widow-orphan;
|
||||
background:#FAFAFA;
|
||||
border:none;
|
||||
mso-border-top-alt:solid #E0E0E0 .75pt;
|
||||
padding:0in;
|
||||
mso-padding-alt:1.0pt 0in 0in 0in;
|
||||
font-size:10.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.search, li.search, div.search
|
||||
{mso-style-name:search;
|
||||
mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";
|
||||
font-weight:bold;}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style>
|
||||
<!--[if gte mso 10]>
|
||||
<style>
|
||||
/* Style Definitions */
|
||||
table.MsoNormalTable
|
||||
{mso-style-name:"Table Normal";
|
||||
mso-tstyle-rowband-size:0;
|
||||
mso-tstyle-colband-size:0;
|
||||
mso-style-noshow:yes;
|
||||
mso-style-parent:"";
|
||||
mso-padding-alt:0in 5.4pt 0in 5.4pt;
|
||||
mso-para-margin:0in;
|
||||
mso-para-margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:10.0pt;
|
||||
font-family:"Times New Roman";}
|
||||
table.MsoTableGrid
|
||||
{mso-style-name:"Table Grid";
|
||||
mso-tstyle-rowband-size:0;
|
||||
mso-tstyle-colband-size:0;
|
||||
border:solid windowtext 1.0pt;
|
||||
mso-border-alt:solid windowtext .5pt;
|
||||
mso-padding-alt:0in 5.4pt 0in 5.4pt;
|
||||
mso-border-insideh:.5pt solid windowtext;
|
||||
mso-border-insidev:.5pt solid windowtext;
|
||||
mso-para-margin:0in;
|
||||
mso-para-margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:10.0pt;
|
||||
font-family:"Times New Roman";}
|
||||
</style>
|
||||
<![endif]--><![if mso 9]>
|
||||
<style>
|
||||
p.MsoNormal
|
||||
{margin-left:15.0pt;}
|
||||
</style>
|
||||
<![endif]><!--[if gte mso 9]><xml>
|
||||
<o:shapedefaults v:ext="edit" spidmax="4098">
|
||||
<o:colormru v:ext="edit" colors="#060"/>
|
||||
<o:colormenu v:ext="edit" strokecolor="#060"/>
|
||||
</o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml>
|
||||
<o:shapelayout v:ext="edit">
|
||||
<o:idmap v:ext="edit" data="1"/>
|
||||
</o:shapelayout></xml><![endif]-->
|
||||
</head>
|
||||
|
||||
<body bgcolor=white lang=EN-US link="#252E78" vlink="#3D2185" style='tab-interval:
|
||||
.5in;margin-left:15.0pt;margin-right:15.0pt'>
|
||||
|
||||
<div class=Section1>
|
||||
|
||||
<p class=MsoNormal style='margin-top:0in;margin-right:15.0pt;margin-bottom:
|
||||
0in;margin-left:15.0pt;margin-bottom:.0001pt'><!--[if gte vml 1]><v:shapetype
|
||||
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
|
||||
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
|
||||
<v:stroke joinstyle="miter"/>
|
||||
<v:formulas>
|
||||
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
|
||||
<v:f eqn="sum @0 1 0"/>
|
||||
<v:f eqn="sum 0 0 @1"/>
|
||||
<v:f eqn="prod @2 1 2"/>
|
||||
<v:f eqn="prod @3 21600 pixelWidth"/>
|
||||
<v:f eqn="prod @3 21600 pixelHeight"/>
|
||||
<v:f eqn="sum @0 0 1"/>
|
||||
<v:f eqn="prod @6 1 2"/>
|
||||
<v:f eqn="prod @7 21600 pixelWidth"/>
|
||||
<v:f eqn="sum @8 21600 0"/>
|
||||
<v:f eqn="prod @7 21600 pixelHeight"/>
|
||||
<v:f eqn="sum @10 21600 0"/>
|
||||
</v:formulas>
|
||||
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
|
||||
<o:lock v:ext="edit" aspectratio="t"/>
|
||||
</v:shapetype><v:shape id="_x0000_s1026" type="#_x0000_t75" style='position:absolute;
|
||||
left:0;text-align:left;margin-left:30pt;margin-top:9pt;width:72.75pt;height:57.75pt;
|
||||
z-index:1'>
|
||||
<v:imagedata src="header_files/image001.jpg" o:title="NCSAlogo"/>
|
||||
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:
|
||||
absolute;z-index:1;left:0px;margin-left:40px;margin-top:12px;width:97px;
|
||||
height:77px'><img width=97 height=77 src="header_files/image002.jpg" v:shapes="_x0000_s1026"></span><![endif]><span
|
||||
style='mso-spacerun:yes'> </span><b style='mso-bidi-font-weight:normal'><span
|
||||
style='font-size:22.0pt'><o:p></o:p></span></b></p>
|
||||
|
||||
<div align=center>
|
||||
|
||||
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
|
||||
style='margin-left:103.45pt;border-collapse:collapse;border:none;mso-border-bottom-alt:
|
||||
solid #006600 2.25pt;mso-yfti-tbllook:480;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
|
||||
<tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes;height:29.25pt'>
|
||||
<td width=443 valign=top style='width:332.6pt;border:none;border-bottom:solid #006600 2.25pt;
|
||||
padding:0in 5.4pt 0in 5.4pt;height:29.25pt'>
|
||||
<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
|
||||
style='font-size:22.0pt'>HDF5 C++ API Reference Manual</span></b></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<p class=MsoNormal><o:p> </o:p></p>
|
||||
|
||||
<p class=MsoNormal><o:p> </o:p></p>
|
||||
|
||||
<p class=MsoNormal><o:p> </o:p></p>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
6
c++/src/header_files/filelist.xml
Normal file
6
c++/src/header_files/filelist.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<xml xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
<o:MainFile HRef="../header.html"/>
|
||||
<o:File HRef="image001.jpg"/>
|
||||
<o:File HRef="image002.jpg"/>
|
||||
<o:File HRef="filelist.xml"/>
|
||||
</xml>
|
||||
BIN
c++/src/header_files/image001.jpg
Normal file
BIN
c++/src/header_files/image001.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
BIN
c++/src/header_files/image002.jpg
Normal file
BIN
c++/src/header_files/image002.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -22,6 +22,7 @@ srcdir=@srcdir@
|
||||
|
||||
hdf5_srcdir=$(top_srcdir)/src
|
||||
hdf5_builddir=$(top_builddir)/src
|
||||
hdf5_testdir=$(top_builddir)/test
|
||||
|
||||
## Add include directory to the cpp preprocessor flags; note that the
|
||||
## hdf5/test directory is needed for the use of h5test
|
||||
@@ -30,6 +31,7 @@ CPPFLAGS=-I. -I../src -I$(srcdir)/../src -I$(top_srcdir)/test -I$(hdf5_builddir)
|
||||
## Add the C++ API library and the hdf5 library to the library lists
|
||||
LIB=../src/libhdf5_cpp.la
|
||||
LIBHDF5=$(hdf5_builddir)/libhdf5.la
|
||||
LIBH5TEST=$(hdf5_testdir)/libh5test.la
|
||||
|
||||
LT_LINK_LIB=$(LT) --mode=link $(CXX) -rpath $(libdir)
|
||||
|
||||
@@ -49,12 +51,12 @@ TEST_SCRIPTS=
|
||||
|
||||
DISTCLEAN=$(TEST_PROGS_SRC:.cpp=.lo) $(TEST_PROGS_SRC:.cpp=.o)
|
||||
|
||||
$(TEST_PROGS): $(LIB) $(LIBHDF5)
|
||||
$(TEST_PROGS): $(LIB) $(LIBHDF5) $(LIBH5TEST)
|
||||
|
||||
testhdf5: $(TEST_OBJ)
|
||||
@$(LT_LINK_EXE) $(CFLAGS) -o $@ $(TESTHDF5_OBJ) $(LIB) $(LIBHDF5) $(LDFLAGS) $(LIBS) $(DEFAULT_LIBS)
|
||||
@$(LT_LINK_EXE) $(CFLAGS) -o $@ $(TESTHDF5_OBJ) $(LIB) $(LIBH5TEST) $(LIBHDF5) $(LDFLAGS) $(LIBS) $(DEFAULT_LIBS)
|
||||
|
||||
dsets: dsets.lo h5cpputil.lo
|
||||
@$(LT_LINK_EXE) $(CFLAGS) -o $@ dsets.lo h5cpputil.lo $(hdf5_builddir)/../test/h5test.lo $(LIB) $(LIBHDF5) $(LDFLAGS) $(LIBS) $(DEFAULT_LIBS)
|
||||
@$(LT_LINK_EXE) $(CFLAGS) -o $@ dsets.lo h5cpputil.lo $(hdf5_builddir)/../test/h5test.lo $(LIB) $(LIBH5TEST) $(LIBHDF5) $(LDFLAGS) $(LIBS) $(DEFAULT_LIBS)
|
||||
|
||||
@CONCLUDE@
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#include "H5Cpp.h"
|
||||
#include "h5test.h"
|
||||
#include "testhdf5.h"
|
||||
#include "h5test.h"
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
@@ -42,11 +42,7 @@ using namespace H5;
|
||||
|
||||
#include "h5cpputil.h"
|
||||
|
||||
const char *FILENAME[] = {
|
||||
"dataset",
|
||||
NULL
|
||||
};
|
||||
|
||||
const string FILE1("dataset.h5");
|
||||
#define DSET_DEFAULT_NAME "default"
|
||||
#define DSET_CHUNKED_NAME "chunked"
|
||||
#define DSET_SIMPLE_IO_NAME "simple_io"
|
||||
@@ -56,9 +52,10 @@ const char *FILENAME[] = {
|
||||
|
||||
#define H5Z_FILTER_BOGUS 305
|
||||
|
||||
/* Local prototypes for filter functions */
|
||||
// Local prototypes
|
||||
static size_t bogus(unsigned int flags, size_t cd_nelmts,
|
||||
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
|
||||
void cleanup_dsets(void);
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -113,7 +110,7 @@ test_create( H5File& file)
|
||||
(DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space));
|
||||
// continuation here, that means no exception has been thrown
|
||||
H5_FAILED();
|
||||
cout << " Library allowed overwrite of existing dataset." << endl;
|
||||
cerr << " Library allowed overwrite of existing dataset." << endl;
|
||||
goto error;
|
||||
}
|
||||
catch (FileIException E ) // catching invalid creating dataset
|
||||
@@ -136,7 +133,7 @@ test_create( H5File& file)
|
||||
dataset = new DataSet (file.openDataSet( "does_not_exist" ));
|
||||
// continuation here, that means no exception has been thrown
|
||||
H5_FAILED();
|
||||
cout << " Opened a non-existent dataset." << endl;
|
||||
cerr << " Opened a non-existent dataset." << endl;
|
||||
goto error;
|
||||
}
|
||||
catch (FileIException E ) // catching creating non-existent dataset
|
||||
@@ -203,8 +200,8 @@ check_values (hsize_t i, hsize_t j, int apoint, int acheck)
|
||||
if (apoint != acheck)
|
||||
{
|
||||
H5_FAILED();
|
||||
cout << " Read different values than written.\n" << endl;
|
||||
cout << " At index " << (unsigned long)i << "," <<
|
||||
cerr << " Read different values than written.\n" << endl;
|
||||
cerr << " At index " << (unsigned long)i << "," <<
|
||||
(unsigned long)j << endl;
|
||||
return -1;
|
||||
}
|
||||
@@ -353,14 +350,14 @@ test_tconv( H5File& file)
|
||||
in[4*i+3]!=out[4*i+0])
|
||||
{
|
||||
H5_FAILED();
|
||||
cout << " Read with byte order conversion failed." << endl;
|
||||
cerr << " Read with byte order conversion failed." << endl;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
delete [] out;
|
||||
delete [] in;
|
||||
cout << " PASSED" << endl;
|
||||
cerr << " PASSED" << endl;
|
||||
return 0;
|
||||
} // end try
|
||||
|
||||
@@ -493,8 +490,8 @@ test_compression(H5File& file)
|
||||
for (j=0; j<size[1]; j++) {
|
||||
if (0!=check[i][j]) {
|
||||
H5_FAILED();
|
||||
cout << " Read a non-zero value." << endl;
|
||||
cout << " At index " << (unsigned long)i << "," <<
|
||||
cerr << " Read a non-zero value." << endl;
|
||||
cerr << " At index " << (unsigned long)i << "," <<
|
||||
(unsigned long)j << endl;
|
||||
goto error;
|
||||
}
|
||||
@@ -620,12 +617,12 @@ test_compression(H5File& file)
|
||||
if (points[hs_offset[0]+i][hs_offset[1]+j] !=
|
||||
check[hs_offset[0]+i][hs_offset[1]+j]) {
|
||||
H5_FAILED();
|
||||
cout << " Read different values than written.\n" << endl;
|
||||
cout << " At index " << (unsigned long)(hs_offset[0]+i) <<
|
||||
cerr << " Read different values than written.\n" << endl;
|
||||
cerr << " At index " << (unsigned long)(hs_offset[0]+i) <<
|
||||
"," << (unsigned long)(hs_offset[1]+j) << endl;
|
||||
|
||||
cout << " At original: " << (int)points[hs_offset[0]+i][hs_offset[1]+j] << endl;
|
||||
cout << " At returned: " << (int)check[hs_offset[0]+i][hs_offset[1]+j] << endl;
|
||||
cerr << " At original: " << (int)points[hs_offset[0]+i][hs_offset[1]+j] << endl;
|
||||
cerr << " At returned: " << (int)check[hs_offset[0]+i][hs_offset[1]+j] << endl;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
@@ -638,7 +635,7 @@ test_compression(H5File& file)
|
||||
#else
|
||||
TESTING("deflate filter");
|
||||
SKIPPED();
|
||||
cout << not_supported << endl;
|
||||
cerr << not_supported << endl;
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
@@ -750,7 +747,7 @@ test_multiopen (H5File& file)
|
||||
if (cur_size[0]!=tmp_size[0])
|
||||
{
|
||||
H5_FAILED();
|
||||
cout << " Got " << (int)tmp_size[0] << " instead of "
|
||||
cerr << " Got " << (int)tmp_size[0] << " instead of "
|
||||
<< (int)cur_size[0] << "!" << endl;
|
||||
delete space;
|
||||
goto error;
|
||||
@@ -845,7 +842,7 @@ test_types(H5File& file)
|
||||
|
||||
// catch exceptions thrown in try block of bitfield_1
|
||||
catch (Exception E) {
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
goto error;
|
||||
}
|
||||
@@ -866,7 +863,7 @@ test_types(H5File& file)
|
||||
try { dset->write (buf, type); }
|
||||
catch(DataSetIException E)
|
||||
{
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
delete dset;
|
||||
goto error;
|
||||
@@ -876,7 +873,7 @@ test_types(H5File& file)
|
||||
|
||||
// catch exceptions thrown in try block of bitfield_2
|
||||
catch (Exception E) {
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
goto error;
|
||||
}
|
||||
@@ -908,12 +905,12 @@ test_types(H5File& file)
|
||||
// catch exceptions thrown in try block of opaque_1
|
||||
catch (DataSetIException E) {
|
||||
delete optype;
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
goto error;
|
||||
}
|
||||
catch (Exception E) {
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
goto error;
|
||||
}
|
||||
@@ -943,12 +940,12 @@ test_types(H5File& file)
|
||||
} //end try block of opaque_2
|
||||
catch (DataSetIException E) {
|
||||
delete optype;
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
goto error;
|
||||
}
|
||||
catch (Exception E) {
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
goto error;
|
||||
}
|
||||
@@ -958,7 +955,7 @@ test_types(H5File& file)
|
||||
} // end top try block
|
||||
|
||||
catch (Exception E) { // Group and DataType exceptions
|
||||
cout << "Failure in " << E.getFuncName() << " - "
|
||||
cerr << "Failure in " << E.getFuncName() << " - "
|
||||
<< E.getDetailMsg() << endl;
|
||||
goto error;
|
||||
}
|
||||
@@ -995,9 +992,6 @@ main(void)
|
||||
hid_t fapl_id;
|
||||
fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template
|
||||
|
||||
char filename[1024];
|
||||
h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
|
||||
|
||||
int nerrors=0; // keep track of number of failures occurr
|
||||
try
|
||||
{
|
||||
@@ -1010,9 +1004,9 @@ main(void)
|
||||
// list object to pass in H5File::H5File
|
||||
FileAccPropList fapl(fapl_id);
|
||||
|
||||
H5File file( filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl);
|
||||
H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl);
|
||||
|
||||
/* Cause the library to emit initial messages */
|
||||
// Cause the library to emit initial messages
|
||||
Group grp = file.createGroup( "emit diagnostics", 0);
|
||||
grp.setComment( ".", "Causes diagnostic messages to be emitted");
|
||||
|
||||
@@ -1032,10 +1026,31 @@ main(void)
|
||||
{
|
||||
return(test_report(nerrors, string(" Dataset")));
|
||||
}
|
||||
/* use C test utility routine to clean up data files */
|
||||
h5_cleanup(FILENAME, fapl_id);
|
||||
|
||||
/* print out dsets test results */
|
||||
// Clean up data file
|
||||
cleanup_dsets();
|
||||
|
||||
// Print out dsets test results
|
||||
cerr << endl << endl;
|
||||
return(test_report(nerrors, string(" Dataset")));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: cleanup_dsets
|
||||
*
|
||||
* Purpose: Cleanup temporary test files
|
||||
*
|
||||
* Return: none
|
||||
*
|
||||
* Programmer: (use C version)
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
cleanup_dsets(void)
|
||||
{
|
||||
remove(FILE1.c_str());
|
||||
} /* cleanup_dsets */
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
#include "h5cpputil.h"
|
||||
#include "h5test.h"
|
||||
#include "h5cpputil.h"
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_report
|
||||
@@ -58,16 +58,17 @@ int test_report( int nerrors, const string& testname )
|
||||
{
|
||||
nerrors = MAX(1, nerrors);
|
||||
if (1 == nerrors)
|
||||
cout << "***** " << nerrors << testname
|
||||
cerr << "***** " << nerrors << testname
|
||||
<< " TEST FAILED! *****" << endl;
|
||||
else
|
||||
cout << "***** " << nerrors << testname
|
||||
cerr << "***** " << nerrors << testname
|
||||
<< " TESTS FAILED! *****" << endl;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "All" << testname << " tests passed." << endl;
|
||||
cerr << "All" << testname << " tests passed." << endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,27 @@
|
||||
|
||||
#ifndef H5_NO_STD
|
||||
int test_report (int, const std::string&);
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
#else
|
||||
int test_report (int, const string&);
|
||||
#endif
|
||||
|
||||
template <class Type1, class Type2>
|
||||
void verify_val(Type1 x, Type2 value, const char* where, int line, const char* file_name)
|
||||
{
|
||||
if (GetTestVerbosity()>=VERBO_HI)
|
||||
{
|
||||
cerr << " Call to routine: " << where << " at line " << line
|
||||
<< " in " << file_name << " had value " << x << endl;
|
||||
}
|
||||
if (x != value)
|
||||
{
|
||||
cerr << "*** UNEXPECTED VALUE from " << where << " should be "
|
||||
<< value << ", but is " << x << " at line " << line
|
||||
<< " in " << file_name << endl;
|
||||
H5Eprint (stdout);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,288 +35,54 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#include <console.h>
|
||||
#endif /* __MWERKS__ */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#define MAXNUMOFTESTS 30
|
||||
#define HDF5_TEST_MASTER
|
||||
|
||||
/* Internal Variables */
|
||||
static int Index = 0;
|
||||
|
||||
/* Global variables */
|
||||
int num_errs = 0;
|
||||
int Verbosity;
|
||||
|
||||
// Use C version of the header file testhdf5.h instead of re-coding it
|
||||
#include "testhdf5.h"
|
||||
|
||||
#ifdef OLD_HEADER_FILENAME
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#endif /* !H5_NO_NAMESPACE */
|
||||
|
||||
#include "h5cpputil.h"
|
||||
|
||||
struct TestStruct {
|
||||
int NumErrors;
|
||||
char Description[64];
|
||||
int SkipFlag;
|
||||
char Name[16];
|
||||
void (*Call) (void);
|
||||
void (*Cleanup) (void);
|
||||
} Test[MAXNUMOFTESTS];
|
||||
|
||||
static void InitTest(const char *, void (*) (void), void (*) (void), const char *TheDescr);
|
||||
static void usage(void);
|
||||
|
||||
static void InitTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), const char *TheDescr)
|
||||
{
|
||||
if (Index >= MAXNUMOFTESTS) {
|
||||
print_func("Uh-oh, too many tests added, increase MAXNUMOFTEST!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
HDstrcpy(Test[Index].Description, TheDescr);
|
||||
HDstrcpy(Test[Index].Name, TheName);
|
||||
Test[Index].Call = TheCall;
|
||||
Test[Index].Cleanup = Cleanup;
|
||||
Test[Index].NumErrors = -1;
|
||||
Test[Index].SkipFlag = 0;
|
||||
Index++;
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
print_func("Usage: testhdf5 [-v[erbose] (l[ow]|m[edium]|h[igh]|0-10)] \n");
|
||||
print_func(" [-[e]x[clude] name+] \n");
|
||||
print_func(" [-o[nly] name+] \n");
|
||||
print_func(" [-b[egin] name] \n");
|
||||
print_func(" [-s[ummary]] \n");
|
||||
print_func(" [-c[leanoff]] \n");
|
||||
print_func(" [-n[ocaching]] \n");
|
||||
print_func(" [-h[elp]] \n");
|
||||
print_func("\n\n");
|
||||
print_func("verbose controls the amount of information displayed\n");
|
||||
print_func("exclude to exclude tests by name\n");
|
||||
print_func("only to name tests which should be run\n");
|
||||
print_func("begin start at the name of the test givin\n");
|
||||
print_func("summary prints a summary of test results at the end\n");
|
||||
print_func("cleanoff does not delete *.hdf files after execution of tests\n");
|
||||
print_func("nocaching do not turn on low-level DD caching\n");
|
||||
print_func("help print out this information\n");
|
||||
print_func("\n\n");
|
||||
print_func("This program currently tests the following: \n\n");
|
||||
print_func("%16s %s\n", "Name", "Description");
|
||||
print_func("%16s %s\n", "----", "-----------");
|
||||
|
||||
for (int i = 0; i < Index; i++)
|
||||
print_func("%16s %s\n", Test[i].Name, Test[i].Description);
|
||||
|
||||
print_func("\n\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine is designed to provide equivalent functionality to 'printf'
|
||||
* and allow easy replacement for environments which don't have stdin/stdout
|
||||
* available. (i.e. Windows & the Mac)
|
||||
*/
|
||||
int
|
||||
print_func(const char *format,...)
|
||||
{
|
||||
va_list arglist;
|
||||
int ret_value;
|
||||
|
||||
va_start(arglist, format);
|
||||
ret_value = vprintf(format, arglist);
|
||||
va_end(arglist);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int CLLoop; /* Command Line Loop */
|
||||
int Loop, Loop1;
|
||||
int Summary = 0;
|
||||
int CleanUp = 1;
|
||||
int Cache = 1;
|
||||
|
||||
#ifdef __MWERKS__
|
||||
argc = ccommand(&argv);
|
||||
#endif /* __MWERKS__ */
|
||||
|
||||
#if !(defined MAC || defined __MWERKS__ || defined SYMANTEC_C)
|
||||
/* Un-buffer the stdout and stderr */
|
||||
setbuf(stderr, NULL);
|
||||
setbuf(stdout, NULL);
|
||||
#endif /* !(MAC || __MWERKS__ || SYMANTEC_C) */
|
||||
|
||||
/*
|
||||
* Turn off automatic error reporting since we do it ourselves. Besides,
|
||||
* half the functions this test calls are private, so automatic error
|
||||
* reporting wouldn't do much good since it's triggered at the API layer.
|
||||
*/
|
||||
Exception::dontPrint();
|
||||
/* Initialize testing framework */
|
||||
TestInit(argv[0], NULL, NULL);
|
||||
|
||||
// testing file creation and opening in tfile.cpp
|
||||
InitTest("file", test_file, cleanup_file, "File I/O Operations");
|
||||
AddTest("file", test_file, cleanup_file, "File I/O Operations", NULL);
|
||||
// testing dataspace functionalities in th5s.cpp
|
||||
InitTest("h5s", test_h5s, cleanup_h5s, "Dataspaces");
|
||||
AddTest("h5s", test_h5s, cleanup_h5s, "Dataspaces", NULL);
|
||||
|
||||
/* Comment out tests that are not done yet. - BMR, Feb 2001
|
||||
InitTest("attr", test_attr, cleanup_attr, "Attributes");
|
||||
InitTest("select", test_select, cleanup_select, "Selections");
|
||||
InitTest("time", test_time, cleanup_time, "Time Datatypes");
|
||||
InitTest("reference", test_reference, cleanup_reference, "References");
|
||||
InitTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes");
|
||||
InitTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings");
|
||||
InitTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration");
|
||||
InitTest("array", test_array, cleanup_array, "Array Datatypes");
|
||||
InitTest("genprop", test_genprop, cleanup_genprop, "Generic Properties");
|
||||
/* Comment out tests that are not done yet. - BMR, Feb 2001
|
||||
AddTest("attr", test_attr, cleanup_attr, "Attributes", NULL);
|
||||
AddTest("select", test_select, cleanup_select, "Selections", NULL);
|
||||
AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL);
|
||||
AddTest("reference", test_reference, cleanup_reference, "References", NULL);
|
||||
AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL);
|
||||
AddTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL);
|
||||
AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL);
|
||||
AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL);
|
||||
AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL);
|
||||
Comment out tests that are not done yet */
|
||||
|
||||
Verbosity = 4; /* Default Verbosity is Low */
|
||||
unsigned major, minor, release;
|
||||
H5Library::getLibVersion( major, minor, release);
|
||||
/* Display testing information */
|
||||
TestInfo(argv[0]);
|
||||
|
||||
print_func("\nFor help use: testhdf5 -help\n");
|
||||
print_func("Linked with hdf5 version %u.%u release %u\n",
|
||||
(unsigned)major, (unsigned)minor, (unsigned)release);
|
||||
/* Parse command line arguments */
|
||||
TestParseCmdLine(argc,argv);
|
||||
|
||||
for (CLLoop = 1; CLLoop < argc; CLLoop++) {
|
||||
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-verbose") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-v") == 0))) {
|
||||
if (argv[CLLoop + 1][0] == 'l')
|
||||
Verbosity = 4;
|
||||
else if (argv[CLLoop + 1][0] == 'm')
|
||||
Verbosity = 6;
|
||||
else if (argv[CLLoop + 1][0] == 'h')
|
||||
Verbosity = 10;
|
||||
else
|
||||
Verbosity = atoi(argv[CLLoop + 1]);
|
||||
}
|
||||
/* Perform requested testing */
|
||||
PerformTests();
|
||||
|
||||
if ((argc > CLLoop) && ((HDstrcmp(argv[CLLoop], "-summary") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-s") == 0)))
|
||||
Summary = 1;
|
||||
/* Display test summary, if requested */
|
||||
if (GetTestSummary())
|
||||
TestSummary();
|
||||
|
||||
if ((argc > CLLoop) && ((HDstrcmp(argv[CLLoop], "-help") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-h") == 0))) {
|
||||
usage();
|
||||
exit(0);
|
||||
}
|
||||
/* Clean up test files, if allowed */
|
||||
if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
|
||||
TestCleanup();
|
||||
|
||||
if ((argc > CLLoop) && ((HDstrcmp(argv[CLLoop], "-cleanoff") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-c") == 0)))
|
||||
CleanUp = 0;
|
||||
|
||||
if ((argc > CLLoop) && ((HDstrcmp(argv[CLLoop], "-nocache") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-n") == 0))) {
|
||||
Cache = 0;
|
||||
printf ("Cache = %d\n", Cache);
|
||||
}
|
||||
|
||||
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-exclude") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-x") == 0))) {
|
||||
Loop = CLLoop + 1;
|
||||
|
||||
while ((Loop < argc) && (argv[Loop][0] != '-')) {
|
||||
for (Loop1 = 0; Loop1 < Index; Loop1++)
|
||||
if (HDstrcmp(argv[Loop], Test[Loop1].Name) == 0)
|
||||
Test[Loop1].SkipFlag = 1;
|
||||
|
||||
Loop++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-begin") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-b") == 0))) {
|
||||
Loop = CLLoop + 1;
|
||||
|
||||
while ((Loop < argc) && (argv[Loop][0] != '-')) {
|
||||
for (Loop1 = 0; Loop1 < Index; Loop1++) {
|
||||
if (HDstrcmp(argv[Loop], Test[Loop1].Name) != 0)
|
||||
Test[Loop1].SkipFlag = 1;
|
||||
if (HDstrcmp(argv[Loop], Test[Loop1].Name) == 0)
|
||||
Loop1 = Index;
|
||||
}
|
||||
|
||||
Loop++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-only") == 0) ||
|
||||
(HDstrcmp(argv[CLLoop], "-o") == 0))) {
|
||||
for (Loop = 0; Loop < Index; Loop++)
|
||||
Test[Loop].SkipFlag = 1;
|
||||
Loop = CLLoop + 1;
|
||||
while ((Loop < argc) && (argv[Loop][0] != '-')) {
|
||||
for (Loop1 = 0; Loop1 < Index; Loop1++)
|
||||
if (HDstrcmp(argv[Loop], Test[Loop1].Name) == 0)
|
||||
Test[Loop1].SkipFlag = 0;
|
||||
Loop++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NOT_YET
|
||||
if (Cache) /* turn on caching, unless we were instucted not to */
|
||||
Hcache(CACHE_ALL_FILES, TRUE);
|
||||
#endif /* NOT_YET */
|
||||
|
||||
for (Loop = 0; Loop < Index; Loop++) {
|
||||
if (Test[Loop].SkipFlag) {
|
||||
MESSAGE(2, ("Skipping -- %s \n", Test[Loop].Description));
|
||||
} else {
|
||||
MESSAGE(2, ("Testing -- %s (%s) \n", Test[Loop].Description,
|
||||
Test[Loop].Name));
|
||||
MESSAGE(5, ("===============================================\n"));
|
||||
Test[Loop].NumErrors = num_errs;
|
||||
(*Test[Loop].Call) ();
|
||||
Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors;
|
||||
MESSAGE(5, ("===============================================\n"));
|
||||
MESSAGE(5, ("There were %d errors detected.\n\n", (int) Test[Loop].NumErrors));
|
||||
}
|
||||
}
|
||||
|
||||
MESSAGE(2, ("\n\n"))
|
||||
test_report(num_errs, string(" HDF5 Base"));
|
||||
if (Summary) {
|
||||
print_func("Summary of Test Results:\n");
|
||||
print_func("Name of Test Errors Description of Test\n");
|
||||
print_func("---------------- ------ --------------------------------------\n");
|
||||
|
||||
for (Loop = 0; Loop < Index; Loop++) {
|
||||
if (Test[Loop].NumErrors == -1)
|
||||
print_func("%16s %6s %s\n", Test[Loop].Name, "N/A", Test[Loop].Description);
|
||||
else
|
||||
print_func("%16s %6d %s\n", Test[Loop].Name, (int) Test[Loop].NumErrors,
|
||||
Test[Loop].Description);
|
||||
}
|
||||
|
||||
print_func("\n\n");
|
||||
}
|
||||
|
||||
if (CleanUp && !getenv("HDF5_NOCLEANUP")) {
|
||||
MESSAGE(2, ("\nCleaning Up temp files...\n\n"));
|
||||
|
||||
/* call individual cleanup routines in each source module */
|
||||
for (Loop = 0; Loop < Index; Loop++)
|
||||
if (!Test[Loop].SkipFlag && Test[Loop].Cleanup!=NULL)
|
||||
(*Test[Loop].Cleanup) ();
|
||||
}
|
||||
|
||||
return num_errs;
|
||||
return (GetTestNumErrs());
|
||||
}
|
||||
|
||||
@@ -18,13 +18,12 @@
|
||||
|
||||
EXTERNAL ROUTINES/VARIABLES:
|
||||
These routines are in the test directory of the C library:
|
||||
h5_reset() -- in h5test.c, resets the library by closing it
|
||||
h5_fileaccess() -- in h5test.c, returns a file access template
|
||||
h5_fixname() -- in h5test.c, create a file name from a file base name
|
||||
h5_cleanup() -- in h5test.c, cleanup temporary test files
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef OLD_HEADER_FILENAME
|
||||
#include <iostream.h>
|
||||
#else
|
||||
@@ -33,6 +32,7 @@
|
||||
|
||||
#include "H5Cpp.h"
|
||||
#include "testhdf5.h"
|
||||
#include "h5cpputil.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
@@ -43,21 +43,24 @@ using namespace H5;
|
||||
#define F1_LENGTH_SIZE sizeof(hsize_t)
|
||||
#define F1_SYM_LEAF_K 4
|
||||
#define F1_SYM_INTERN_K 16
|
||||
#define FILE1 "tfile1.h5"
|
||||
const char* FILE1 = "tfile1.h5";
|
||||
|
||||
#define F2_USERBLOCK_SIZE (hsize_t)512
|
||||
#define F2_OFFSET_SIZE 8
|
||||
#define F2_LENGTH_SIZE 8
|
||||
#define F2_SYM_LEAF_K 8
|
||||
#define F2_SYM_INTERN_K 32
|
||||
#define FILE2 "tfile2.h5"
|
||||
const char* FILE2 = "tfile2.h5";
|
||||
|
||||
#define F3_USERBLOCK_SIZE (hsize_t)0
|
||||
#define F3_OFFSET_SIZE F2_OFFSET_SIZE
|
||||
#define F3_LENGTH_SIZE F2_LENGTH_SIZE
|
||||
#define F3_SYM_LEAF_K F2_SYM_LEAF_K
|
||||
#define F3_SYM_INTERN_K F2_SYM_INTERN_K
|
||||
#define FILE3 "tfile3.h5"
|
||||
const char* FILE3 = "tfile3.h5";
|
||||
|
||||
#define KB 1024
|
||||
const char* FILE4 = "tfile4.h5";
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -88,46 +91,47 @@ test_file_create(void)
|
||||
remove(FILE1);
|
||||
|
||||
try {
|
||||
H5File* fid1 = new H5File (FILE1, H5F_ACC_EXCL);
|
||||
H5File* file1 = new H5File (FILE1, H5F_ACC_EXCL);
|
||||
|
||||
/*
|
||||
* try to create the same file with H5F_ACC_TRUNC. This should fail
|
||||
* because fid1 is the same file and is currently open.
|
||||
* because file1 is the same file and is currently open.
|
||||
*/
|
||||
try {
|
||||
H5File fid2 (FILE1, H5F_ACC_TRUNC); // should throw E
|
||||
H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E
|
||||
|
||||
// Should FAIL but didn't - BMR (Note 1): a macro, with a diff
|
||||
// name, that skips the comparison b/w the 1st & 2nd args would
|
||||
// be more appropriate, but VERIFY can be used for now - Mar 13, 01
|
||||
// also, more text about what is testing would be better.
|
||||
VERIFY(fid2.getId(), FAIL, "H5File constructor");
|
||||
VERIFY(file2.getId(), FAIL, "H5File constructor");
|
||||
}
|
||||
catch( FileIException E ) {} // do nothing, FAIL expected
|
||||
|
||||
// Close file fid1
|
||||
delete fid1;
|
||||
// Close file file1
|
||||
|
||||
delete file1;
|
||||
|
||||
/*
|
||||
* Try again with H5F_ACC_EXCL. This should fail because the file already
|
||||
* exists from the previous steps.
|
||||
*/
|
||||
try {
|
||||
fid1 = new H5File( FILE1, H5F_ACC_EXCL ); // should throw E
|
||||
VERIFY(fid1->getId(), FAIL, "H5File constructor");
|
||||
file1 = new H5File( FILE1, H5F_ACC_EXCL ); // should throw E
|
||||
VERIFY(file1->getId(), FAIL, "H5File constructor");
|
||||
}
|
||||
catch( FileIException E ) {} // do nothing, FAIL expected
|
||||
|
||||
// Test create with H5F_ACC_TRUNC. This will truncate the existing file.
|
||||
fid1 = new H5File (FILE1, H5F_ACC_TRUNC);
|
||||
file1 = new H5File (FILE1, H5F_ACC_TRUNC);
|
||||
|
||||
/*
|
||||
* Try to truncate first file again. This should fail because fid1 is the
|
||||
* Try to truncate first file again. This should fail because file1 is the
|
||||
* same file and is currently open.
|
||||
*/
|
||||
try {
|
||||
H5File fid2 (FILE1, H5F_ACC_TRUNC); // should throw E
|
||||
VERIFY(fid2.getId(), FAIL, "H5File constructor");
|
||||
H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E
|
||||
VERIFY(file2.getId(), FAIL, "H5File constructor");
|
||||
}
|
||||
catch( FileIException E ) {} // do nothing, FAIL expected
|
||||
|
||||
@@ -136,13 +140,13 @@ test_file_create(void)
|
||||
* exists.
|
||||
*/
|
||||
try {
|
||||
H5File fid3 (FILE1, H5F_ACC_EXCL); // should throw E
|
||||
VERIFY(fid3.getId(), FAIL, "H5File constructor");
|
||||
H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E
|
||||
VERIFY(file3.getId(), FAIL, "H5File constructor");
|
||||
}
|
||||
catch( FileIException E ) {} // do nothing, FAIL expected
|
||||
|
||||
/* Get the file-creation template */
|
||||
FileCreatPropList tmpl1 = fid1->getCreatePlist();
|
||||
FileCreatPropList tmpl1 = file1->getCreatePlist();
|
||||
|
||||
hsize_t ublock = tmpl1.getUserblock();
|
||||
VERIFY(ublock, F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock");
|
||||
@@ -166,7 +170,7 @@ test_file_create(void)
|
||||
// caught in the catch block
|
||||
|
||||
/* Close first file */
|
||||
delete fid1;
|
||||
delete file1;
|
||||
}
|
||||
catch( PropListIException E ) {
|
||||
CHECK(FAIL, FAIL, E.getCFuncName());
|
||||
@@ -189,13 +193,13 @@ test_file_create(void)
|
||||
* Try to create second file, with non-standard file-creation template
|
||||
* params.
|
||||
*/
|
||||
H5File fid2( FILE2, H5F_ACC_TRUNC, *tmpl1 );
|
||||
H5File file2( FILE2, H5F_ACC_TRUNC, *tmpl1 );
|
||||
|
||||
/* Release file-creation template */
|
||||
delete tmpl1;
|
||||
|
||||
/* Get the file-creation template */
|
||||
tmpl1 = new FileCreatPropList (fid2.getCreatePlist());
|
||||
tmpl1 = new FileCreatPropList (file2.getCreatePlist());
|
||||
|
||||
/* Get the file-creation parameters */
|
||||
hsize_t ublock = tmpl1->getUserblock();
|
||||
@@ -230,10 +234,10 @@ test_file_create(void)
|
||||
* Try to create second file, with non-standard file-creation template
|
||||
* params
|
||||
*/
|
||||
H5File fid3( FILE3, H5F_ACC_TRUNC, tmpl2 );
|
||||
H5File file3( FILE3, H5F_ACC_TRUNC, tmpl2 );
|
||||
|
||||
/* Get the file-creation template */
|
||||
tmpl1 = new FileCreatPropList (fid3.getCreatePlist());
|
||||
tmpl1 = new FileCreatPropList (file3.getCreatePlist());
|
||||
|
||||
/* Get the file-creation parameters */
|
||||
ublock = tmpl1->getUserblock();
|
||||
@@ -279,10 +283,10 @@ test_file_open(void)
|
||||
try {
|
||||
|
||||
/* Open first file */
|
||||
H5File fid1 (FILE2, H5F_ACC_RDWR );
|
||||
H5File file1 (FILE2, H5F_ACC_RDWR );
|
||||
|
||||
/* Get the file-creation template */
|
||||
FileCreatPropList tmpl1 = fid1.getCreatePlist();
|
||||
FileCreatPropList tmpl1 = file1.getCreatePlist();
|
||||
|
||||
/* Get the file-creation parameters */
|
||||
hsize_t ublock = tmpl1.getUserblock();
|
||||
@@ -309,6 +313,149 @@ test_file_open(void)
|
||||
}
|
||||
} /* test_file_open() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_file_size
|
||||
*
|
||||
* Purpose: Test file size.
|
||||
*
|
||||
* Return: None
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* June, 2004
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
test_file_size(void)
|
||||
{
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing File Size\n"));
|
||||
|
||||
hid_t fapl_id;
|
||||
fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template
|
||||
|
||||
try {
|
||||
// Use the file access template id to create a file access prop.
|
||||
// list object to pass in H5File::H5File
|
||||
FileAccPropList fapl(fapl_id);
|
||||
|
||||
// Set to sec2 driver. Do we want to test other file drivers?
|
||||
// They're not tested in C++.
|
||||
// File drivers seem not implemented.
|
||||
//fapl.setSec2();
|
||||
|
||||
// Create a file
|
||||
H5File file4( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl);
|
||||
|
||||
// Get file size
|
||||
hsize_t file_size = file4.getFileSize();
|
||||
|
||||
// Check if file size is reasonable. It's supposed to be 2KB now.
|
||||
if(file_size<1*KB || file_size>4*KB)
|
||||
CHECK(FAIL, FAIL, "H5File::getFileSize");
|
||||
} // end of try block
|
||||
|
||||
catch( Exception E ) {
|
||||
CHECK(FAIL, FAIL, E.getCFuncName());
|
||||
}
|
||||
|
||||
// use C test utility routine to close property list.
|
||||
H5Pclose(fapl_id);
|
||||
|
||||
} /* test_file_size() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_file_name
|
||||
*
|
||||
* Purpose: Test getting file's name.
|
||||
*
|
||||
* Return: None
|
||||
*
|
||||
* Programmer: Binh-Minh Ribler
|
||||
* July, 2004
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
const int RANK = 2;
|
||||
const int NX = 4;
|
||||
const int NY = 5;
|
||||
const string GROUPNAME ("group");
|
||||
const string DSETNAME ("dataset");
|
||||
const string ATTRNAME ("attribute");
|
||||
const string DTYPENAME ("compound");
|
||||
|
||||
/* Compound datatype */
|
||||
typedef struct s1_t {
|
||||
unsigned int a;
|
||||
float b;
|
||||
} s1_t;
|
||||
|
||||
static void
|
||||
test_file_name()
|
||||
{
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing File Name\n"));
|
||||
|
||||
string file_name;
|
||||
try {
|
||||
// Create a file using default properties.
|
||||
H5File file4(FILE4, H5F_ACC_TRUNC);
|
||||
|
||||
// Get file name from the file instance.
|
||||
file_name = file4.getFileName();
|
||||
verify_val(file_name, FILE4, "H5File::getFileName", __LINE__, __FILE__);
|
||||
|
||||
/* Create a group in the root group */
|
||||
Group group(file4.createGroup(GROUPNAME, 0));
|
||||
|
||||
/* Get and verify file name */
|
||||
file_name = group.getFileName();
|
||||
verify_val(file_name, FILE4, "Group::getFileName", __LINE__, __FILE__);
|
||||
|
||||
/* Create the data space */
|
||||
hsize_t dims[RANK] = {NX, NY};
|
||||
DataSpace space(RANK, dims);
|
||||
|
||||
/* Create a new dataset */
|
||||
DataSet dataset(file4.createDataSet (DSETNAME, PredType::NATIVE_INT, space));
|
||||
|
||||
/* Get and verify file name */
|
||||
file_name = dataset.getFileName();
|
||||
verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__);
|
||||
|
||||
/* Create an attribute for the dataset */
|
||||
Attribute attr(dataset.createAttribute(ATTRNAME, PredType::NATIVE_INT, space));
|
||||
|
||||
/* Get and verify file name */
|
||||
file_name = attr.getFileName();
|
||||
verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__);
|
||||
|
||||
/* Create a compound datatype */
|
||||
CompType comp_type (sizeof(s1_t));
|
||||
|
||||
/* Insert fields */
|
||||
comp_type.insertMember("a", HOFFSET(s1_t, a), PredType::NATIVE_INT);
|
||||
comp_type.insertMember("b", HOFFSET(s1_t, b), PredType::NATIVE_FLOAT);
|
||||
|
||||
/* Save it on file */
|
||||
comp_type.commit(file4, DTYPENAME);
|
||||
|
||||
/* Get and verify file name */
|
||||
comp_type.getFileName();
|
||||
verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__);
|
||||
} // end of try block
|
||||
catch (Exception E) {
|
||||
CHECK(FAIL, FAIL, E.getCFuncName());
|
||||
}
|
||||
|
||||
} /* test_file_name() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_file
|
||||
@@ -332,6 +479,8 @@ test_file(void)
|
||||
|
||||
test_file_create(); /* Test file creation (also creation templates) */
|
||||
test_file_open(); /* Test file opening */
|
||||
test_file_size(); /* Test file size */
|
||||
test_file_name(); /* Test getting file's name */
|
||||
} /* test_file() */
|
||||
|
||||
|
||||
@@ -354,4 +503,5 @@ cleanup_file(void)
|
||||
remove(FILE1);
|
||||
remove(FILE2);
|
||||
remove(FILE3);
|
||||
remove(FILE4);
|
||||
} /* cleanup_file */
|
||||
|
||||
@@ -27,15 +27,15 @@
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#include "H5Cpp.h"
|
||||
#include "testhdf5.h"
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#endif /* !H5_NO_NAMESPACE */
|
||||
|
||||
#define TESTFILE "th5s.h5"
|
||||
#define DATAFILE "th5s1.h5"
|
||||
const char* TESTFILE = "th5s.h5";
|
||||
const char* DATAFILE = "th5s1.h5";
|
||||
|
||||
/* 3-D dataset with fixed dimensions */
|
||||
#define SPACE1_NAME "Space1"
|
||||
@@ -77,7 +77,7 @@ struct space4_struct {
|
||||
unsigned u;
|
||||
float f;
|
||||
char c2;
|
||||
} space4_data={'v',987123,-3.14,'g'}; /* Test data for 4th dataspace */
|
||||
} space4_data={'v',987123,(float)-3.14,'g'}; /* Test data for 4th dataspace */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
@@ -203,7 +203,7 @@ test_h5s_basic(void)
|
||||
// catch exception thrown by H5File constructor
|
||||
catch( FileIException error ) {
|
||||
CHECK_I(FAIL, error.getCFuncName());
|
||||
cout << "***cannot open the pre-created H5S_MAX_RANK test file" <<
|
||||
cerr << "***cannot open the pre-created H5S_MAX_RANK test file" <<
|
||||
testfile << endl;
|
||||
}
|
||||
|
||||
@@ -468,15 +468,14 @@ test_h5s_compound_scalar_read(void)
|
||||
// Verify read data
|
||||
if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct)))
|
||||
{
|
||||
cout << "scalar data different: space4_data.c1="
|
||||
cerr << "scalar data different: space4_data.c1="
|
||||
<< space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl;
|
||||
cout << "scalar data different: space4_data.u="
|
||||
cerr << "scalar data different: space4_data.u="
|
||||
<< space4_data.u << ", read_data4.u=" << rdata.u << endl;
|
||||
cout << "scalar data different: space4_data.f="
|
||||
cerr << "scalar data different: space4_data.f="
|
||||
<< space4_data.f << ", read_data4.f=" << rdata.f << endl;
|
||||
cout << "scalar data different: space4_data.c1="
|
||||
<< space4_data.c1 << ", read_data4.c1=" << rdata.c2 << endl;
|
||||
num_errs++;
|
||||
TestErrPrintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",
|
||||
space4_data.c1, rdata.c2);
|
||||
} /* end if */
|
||||
} // end of try block
|
||||
catch (Exception error)
|
||||
|
||||
@@ -28,13 +28,14 @@ CP=cp
|
||||
INSTALL=@INSTALL@
|
||||
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
||||
INSTALL_DATA=@INSTALL_DATA@
|
||||
PARALLEL=@PARALLEL@
|
||||
RUNSERIAL=@RUNSERIAL@
|
||||
RUNPARALLEL=@RUNPARALLEL@
|
||||
RUNTEST=$(RUNSERIAL)
|
||||
TRACE=:
|
||||
|
||||
## Installation points
|
||||
prefix?=@prefix@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
libdir=@libdir@
|
||||
|
||||
@@ -36,7 +36,7 @@ TAGS: $(LIB_SRC)
|
||||
##
|
||||
tests: $(TEST_PROGS) $(TEST_PROGS_PARA) $(TEST_SCRIPTS) $(LIB)
|
||||
check test _test: tests
|
||||
@echo "===Tests begin `date`==="
|
||||
@echo "===Tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="
|
||||
@for test in $(TEST_PROGS) dummy; do \
|
||||
if test $$test != dummy; then \
|
||||
echo "============================"; \
|
||||
@@ -87,7 +87,7 @@ check test _test: tests
|
||||
fi; \
|
||||
done; \
|
||||
test $$test = dummy || false
|
||||
@echo "===Tests ended `date`==="
|
||||
@echo "===Tests in `echo ${PWD} | sed -e s:.*/::` ended `date`==="
|
||||
@for d in X $(SUBDIRS); do \
|
||||
if test $$d != X; then \
|
||||
(set -x; cd $$d && $(MAKE) tests) || exit 1; \
|
||||
@@ -145,7 +145,17 @@ install: $(AUX_LIB) $(PUB_LIB) $(PUB_HDR) $(PUB_PROGS) $(libdir) $(includedir) $
|
||||
done
|
||||
@for f in X $(PUB_PROGS); do \
|
||||
if test $$f != X; then \
|
||||
($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
|
||||
if test "X$(PARALLEL)" != "Xno"; then \
|
||||
if test $$f = "h5cc"; then \
|
||||
($(LT_INSTALL_PROG) $$f $(bindir)/h5pcc || exit 1); \
|
||||
elif test $$f = "h5fc"; then \
|
||||
($(LT_INSTALL_PROG) $$f $(bindir)/h5pfc || exit 1); \
|
||||
else \
|
||||
($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
|
||||
fi; \
|
||||
else \
|
||||
($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
@for d in X $(SUBDIRS); do \
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user