#ifndef FESA_IO_HDF5_MITC4_FILE_HOOKS_H_ #define FESA_IO_HDF5_MITC4_FILE_HOOKS_H_ #include #include #include #include #include "fesa/core/status.h" namespace fesa { class Domain; class AnalysisState; class NonlinearAnalysisState; class DynamicAnalysisState; struct EigenAnalysisState; struct Diagnostic; namespace hdf5_internal { // Private lifecycle fault seams. Production uses real closers and no callback. // Injected closers must release the handle even when reporting failure. struct Mitc4FileHooks { herr_t (*candidate_close)(hid_t) = H5Fclose; herr_t (*reader_close)(hid_t) = H5Fclose; std::function before_self_check; }; Status WriteStaticFile(const std::filesystem::path&, const Domain&, const AnalysisState&, const std::vector&, const Mitc4FileHooks& = {}); Status WriteNonlinearFile(const std::filesystem::path&, const Domain&, const NonlinearAnalysisState&, const std::vector&, const Mitc4FileHooks& = {}); Status WriteDynamicFile(const std::filesystem::path&, const Domain&, const DynamicAnalysisState&, const std::vector&, const Mitc4FileHooks& = {}); Status WriteEigenFile(const std::filesystem::path&, const Domain&, const EigenAnalysisState&, const std::vector&, const Mitc4FileHooks& = {}); } // namespace hdf5_internal } // namespace fesa #endif // FESA_IO_HDF5_MITC4_FILE_HOOKS_H_