h5cpp  0.3.3
A modern C++ wrapper for the HDF5 C library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
file.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2017 DESY,ESS
3 //
4 // This file is part of h5cpp.
5 //
6 // This library is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published
8 // by the Free Software Foundation; either version 2.1 of the License, or
9 // (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the
18 // Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
19 // Boston, MA 02110-1301 USA
20 // ===========================================================================
21 //
22 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
23 // Created on: Sep 8, 2017
24 //
25 #pragma once
26 
27 #include <h5cpp/file/types.hpp>
28 #include <boost/filesystem.hpp>
29 #include <h5cpp/core/windows.hpp>
31 #include <h5cpp/core/object_id.hpp>
33 
34 namespace hdf5 {
35 namespace node {
36 class Group;
37 }
38 }
39 
40 namespace hdf5 {
41 namespace file {
42 
44 {
45  public:
56  File() = default;
57 
63  File(const File &) = default;
64 
70  File(File &&) = default;
71 
79  explicit File(ObjectHandle &&handle);
80 
81  File &operator=(const File &) = default;
82 
88  AccessFlags intent() const;
89 
95  size_t size() const;
96 
103  void flush(Scope scope) const;
104 
110  void close();
111 
117  boost::filesystem::path path() const;
118 
124  size_t count_open_objects(SearchFlags flag) const;
125  size_t count_open_objects(SearchFlagsBase flags) const;
126 
138 
139  explicit operator hid_t() const
140  {
141  return static_cast<hid_t>(handle_);
142  }
143 
152  bool is_valid() const;
153 
159  ObjectId id() const;
160 
161  private:
162  ObjectHandle handle_;
163 
164 };
165 
166 } // namespace file
167 } // namespace hdf5
Definition: group_access.hpp:35
Wrapper for hid_t object identifiers.
Definition: object_handle.hpp:66
Definition: group.hpp:46
SearchFlags
flags controlling object search in a file
Definition: types.hpp:61
Definition: attribute.hpp:43
Scope
file scope
Definition: types.hpp:83
#define DLL_EXPORT
Definition: windows.hpp:35
std::underlying_type< SearchFlags >::type SearchFlagsBase
Definition: types.hpp:72
Definition: file.hpp:43
Unique ID of an HDF5 object.
Definition: object_id.hpp:48
AccessFlags
flags controlling file opening and creation
Definition: types.hpp:37