1
- The HighFive library - HDF5 C++
1
+ HighFive - HDF5 header-only C++ Library
2
2
3
- ** Brief
4
- Header-only wrapper to libhdf5 ( HDF5 library ) for C++
3
+ # Brief
4
+
5
+ HighFive is a modern C++/C++11 friendly interface for libhdf5.
6
+
7
+ HighFive supports STL vector/string, Boost::UBLAS and Boost::Multi-array. It handles C++ from/to HDF5 automatic type mapping.
8
+ HighFive does not require an additional library and supports both HDF5 thread safety and Parallel HDF5 (contrary to the official hdf5 cpp)
5
9
6
- ** Dependencies
7
- - libHDF5
8
- - (optional) boost >= 1.41
9
10
11
+ ## Design
12
+ - Simple C++-ish minimalist interface
13
+ - No other dependency than libhdf5
14
+ - Zero overhead
15
+ - Support C++11 ( compatible with C++98 )
10
16
11
- ** Design
12
- - Simple for simple things, advanced for advance things
13
- - Use only what you need: no other dependency than libhdf5 needed
14
- - Support C++11
15
- - Compatible with C++98
16
- - Support for boost::multi_array and boost::ublas::matrix accessible on demand
17
+
18
+ ## Dependencies
19
+ - libhdf5
20
+ - (optional) boost >= 1.41
17
21
18
22
19
- ** Usage
23
+ ## Usage
20
24
21
- **
25
+ ```c++
22
26
using namespace HighFive;
23
27
// we create a new hdf5 file
24
- File file(FILE_NAME , File::ReadWrite | File::Create | File::Truncate);
28
+ File file("/tmp/new_hdf5_file.h5" , File::ReadWrite | File::Create | File::Truncate);
25
29
26
30
std::vector<int> data(50, 1);
27
31
28
32
// lets create a dataset of native interger with the size of the vector 'data'
29
- DataSet dataset = file.createDataSet<int>(DATASET_NAME , DataSpace::From(data));
33
+ DataSet dataset = file.createDataSet<int>("/dataset_one" , DataSpace::From(data));
30
34
31
35
// lets write our vector of int to the HDF5 dataset
32
36
dataset.write(data);
@@ -35,32 +39,40 @@ Header-only wrapper to libhdf5 ( HDF5 library ) for C++
35
39
std::vector<int> result
36
40
dataset.read(result);
37
41
38
- **
42
+ ```
39
43
40
44
See examples/ sub-directory for more infos
41
45
42
- ** Compile
43
- No compilation needed for usage, just add highfive/include/ to your include path
46
+ ## Compile with HighFive
47
+
48
+ c++ -o program -I/path/to/highfive/include source.cpp -lhdf5
49
+
50
+
51
+ ## Test Compilation
52
+ Remember: Compilation is not required. Used only for unit test and examples
53
+
54
+ mkdir build; pushd build
55
+ cmake ../
56
+ make
57
+ make test
44
58
45
- - test compilation
46
- mkdir build; pushd build
47
- cmake ../
48
- make
49
- make test
50
59
60
+ ## Feature support
61
+ - Create/read/write file, dataset, group, dataspace.
62
+ - Automatic memory management / ref counting
63
+ - Automatic convertion of std::vector and nested std::vector from/to any dataset with basic types
64
+ - Automatic convertion of std::string to/from variable length string dataset
65
+ - selection() / slice support
66
+ - support HDF5 attributes
51
67
52
- ** Feature support
53
- - Create/read/write file, dataset, group, datasapce.
54
- - Automatic memory management / ref counting
55
- - Automatic convertion of std::vector and nested std::vector from/to any dataset with basic types
56
- - Automatic convertion of std::string to/from variable length string dataset
57
68
69
+ ## Contributors
70
+ Adrien Devresse <
[email protected] > - Blue Brain Project
71
+ Ali Can Demiralp <
[email protected] >
72
+ Stefan Eilemann <
[email protected] > - Blue Brain Project
58
73
59
- ** Contributors
60
- Adrien Devresse <
[email protected] > - Blue Brain Project
61
- Ali Can Demiralp <
[email protected] >
62
74
63
- ** License
75
+ ## License
64
76
LGPLv2.1+
65
77
66
78
0 commit comments