GEOS
HDFFile.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
16 #ifndef GEOS_HDFFILE_HPP
17 #define GEOS_HDFFILE_HPP
18 
19 #include "common/DataTypes.hpp"
20 
21 namespace geos
22 {
23 
28 class HDFFile
29 {
30 public:
38  HDFFile( string const & fnm, bool deleteExisting, bool parallelAccess, MPI_Comm comm );
39 
44 
50  bool hasDataset( const string & name ) const;
51 
56  operator int64_t() const { return m_fileId; }
57 private:
59  string m_filename;
61  int64_t m_fileId;
63  int64_t m_faplId;
65  bool m_mpioFapl;
67  MPI_Comm m_comm;
68 };
69 
70 }
71 
72 #endif //GEOS_HDFFILE_HPP
HDFFile(string const &fnm, bool deleteExisting, bool parallelAccess, MPI_Comm comm)
Constructor – this creates/opens the target file for read/write.
bool hasDataset(const string &name) const
Whether a dataset/group with the specified name exists in the target.
~HDFFile()
Closes the file and accessors.