HighFive
HighFive copied to clipboard
Restructure headers.
Headers currently follow the pattern:
// file: H5*.hpp
// A carefully curated list of HighFive includes.
namespace HighFive {
// declarations.
}
// All definitions go here:
#include "bits/H5*_misc.hpp"
This has certain consequences, such as a not entirely obvious include graph and users can't just include what they need. Users that would like to reduce compilation times would need to be able to pick between declarations and definitions.
The structure I'd like to move towards is that for every public class we have the following files:
- One file for forward declarations
*_fwd.hpp
- One file for declarations
*_decl.hpp
- One file for non-template definitions
*_defn.hpp
- One file for template definitions
*_tmpl.hpp
- One file without suffix that includes the previous four.
Not very picky users would include either highfive/highfive.hpp
or highfive/H5{File,Group,Attribute,...}.hpp
.
Since we now split decl from defn we can include at the top the declarations or forward declarations we need. There's no need for including at the end of the file anymore. As a consequence the correct ordering of which file to include when happens automatically.
Moreover, this should allow users to compile HighFive and only expose the declarations (and template definitions) in their headers.
This would not cause (m)any change to existing code that include highfive/H5File,Group,...}.hpp
carefully and no changes to code that include highfive/highfive.hpp
.