HighFive  2.2.2
HighFive - Header-only C++ HDF5 interface
H5File.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c), 2017, Adrien Devresse <adrien.devresse@epfl.ch>
3  *
4  * Distributed under the Boost Software License, Version 1.0.
5  * (See accompanying file LICENSE_1_0.txt or copy at
6  * http://www.boost.org/LICENSE_1_0.txt)
7  *
8  */
9 #ifndef H5FILE_HPP
10 #define H5FILE_HPP
11 
12 #include <string>
13 
14 #include "H5FileDriver.hpp"
15 #include "H5Object.hpp"
17 #include "bits/H5Node_traits.hpp"
18 
19 namespace HighFive {
20 
24 class File : public Object,
25  public NodeTraits<File>,
26  public AnnotateTraits<File> {
27  public:
28 
30 
31  enum : unsigned {
33  ReadOnly = 0x00u,
35  ReadWrite = 0x01u,
37  Truncate = 0x02u,
39  Excl = 0x04u,
41  Debug = 0x08u,
43  Create = 0x10u,
48  };
49 
57  explicit File(const std::string& filename, unsigned openFlags = ReadOnly,
58  const FileAccessProps& fileAccessProps = FileDriver());
59 
63  const std::string& getName() const noexcept;
64 
70  void flush();
71 
72  private:
73  std::string _filename;
74 };
75 
76 } // namespace HighFive
77 
78 // H5File is the main user constructible -> bring in implementation headers
79 #include "bits/H5Annotate_traits_misc.hpp"
80 #include "bits/H5File_misc.hpp"
82 
83 #endif // H5FILE_HPP
Definition: H5Annotate_traits.hpp:19
file driver base concept
Definition: H5FileDriver.hpp:19
File class.
Definition: H5File.hpp:26
void flush()
flush
Definition: H5File_misc.hpp:83
File(const std::string &filename, unsigned openFlags=ReadOnly, const FileAccessProps &fileAccessProps=FileDriver())
File.
Definition: H5File_misc.hpp:41
@ OpenOrCreate
Derived open flag: Opens RW or exclusively creates.
Definition: H5File.hpp:47
@ Overwrite
Derived open flag: common write mode (=ReadWrite|Create|Truncate)
Definition: H5File.hpp:45
@ Truncate
Open flag: Truncate a file if already existing.
Definition: H5File.hpp:37
@ Create
Open flag: Create non existing file.
Definition: H5File.hpp:43
@ ReadOnly
Open flag: Read only access.
Definition: H5File.hpp:33
@ ReadWrite
Open flag: Read Write access.
Definition: H5File.hpp:35
@ Debug
Open flag: Open in debug mode.
Definition: H5File.hpp:41
@ Excl
Open flag: Open will fail if file already exist.
Definition: H5File.hpp:39
static const ObjectType type
Definition: H5File.hpp:29
const std::string & getName() const noexcept
Return the name of the file.
Definition: H5File_misc.hpp:79
NodeTraits: Base class for Group and File.
Definition: H5Node_traits.hpp:23
Definition: H5Object.hpp:36
Base HDF5 property List.
Definition: H5PropertyList.hpp:46
Definition: H5_definitions.hpp:15
ObjectType
Enum of the types of objects (H5O api)
Definition: H5Object.hpp:25