#ifndef FESA_IO_HDF5_SOLID_HDF5_SELF_CHECK_H_ #define FESA_IO_HDF5_SOLID_HDF5_SELF_CHECK_H_ #include #include #include #include #include "fesa/results/solid_results_writer.h" #include "io/hdf5/hdf5_raii.h" namespace fesa::hdf5_internal { /// @brief Exact prescribed Solid compound columns; width>1 denotes a fixed /// array. struct SolidColumn { std::string name; std::size_t width{1}; std::variant, std::vector, std::vector, std::vector> values; }; struct SolidTable { std::string path; std::size_t rows{0}; std::vector columns; std::map strings; }; struct SolidData { std::string path; std::vector dimensions; std::vector values; std::map strings; std::map integers; std::map doubles; }; /// @brief Expected RN64 serialization inventory, never a rounded-only physics /// check. struct SolidPlan { std::map metadata; std::vector mask; std::vector tables; std::vector datasets; }; /// @brief Private fault seams around real writes/readback/close/replace. struct SolidFileHooks { herr_t (*candidate_close)(hid_t) = H5Fclose; herr_t (*reader_close)(hid_t) = H5Fclose; std::function before_write; std::function before_self_check; std::function before_finalize; }; using SolidStateView = std::variant, std::reference_wrapper, std::reference_wrapper>; Result BuildSolidPlan(const Domain&, SolidStateView, const std::vector&); Status WriteSolidFile(const std::filesystem::path&, const Domain&, SolidStateView, const std::vector&, const SolidFileHooks& = {}); Status SelfCheckSolidFile(const std::filesystem::path&, const SolidPlan&, herr_t (*reader_close)(hid_t) = H5Fclose); Hdf5Handle SolidColumnType(const SolidColumn&, bool native); } // namespace fesa::hdf5_internal #endif