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
object_id.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2017 DESY,ESS
3 //
4 // This file is part of h5pp.
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: Martin Shetty <martin.shetty@esss.se>
23 //
24 #pragma once
25 
26 #include <h5cpp/core/hdf5_capi.hpp>
27 #include <string>
28 #include <sstream>
29 #include <boost/filesystem.hpp>
30 #include <h5cpp/core/windows.hpp>
32 
33 namespace hdf5
34 {
35 
49 {
50  public:
57  ObjectId() {}
58 
68  ObjectId(const ObjectHandle &handle);
69 
77  ObjectId(const ObjectId &id) = default;
78 
82  bool operator== (const ObjectId& other) const;
83 
87  bool operator!= (const ObjectId& other) const;
88 
93  bool operator< (const ObjectId& other) const;
94 
95  DLL_EXPORT friend std::ostream & operator<<(std::ostream &os, const ObjectId& p);
96 
105  unsigned long file_number() const noexcept;
106 
115  haddr_t object_address() const noexcept;
116 
125  boost::filesystem::path file_name() const noexcept;
126 
131  static std::string get_file_name(const ObjectHandle &handle);
132 
137  static H5O_info_t get_info(const ObjectHandle &handle);
138 
139 
140  private:
141  unsigned long file_num_ {0};
142  haddr_t obj_addr_ {0};
143  boost::filesystem::path file_name_;
144 };
145 
146 
147 }
Wrapper for hid_t object identifiers.
Definition: object_handle.hpp:66
ObjectId()
default constructor
Definition: object_id.hpp:57
DLL_EXPORT std::ostream & operator<<(std::ostream &stream, const IterationIndex &index)
DLL_EXPORT bool operator!=(const ObjectHandle &lhs, const ObjectHandle &rhs)
not equal to operator
Definition: attribute.hpp:43
#define DLL_EXPORT
Definition: windows.hpp:35
Unique ID of an HDF5 object.
Definition: object_id.hpp:48
DLL_EXPORT bool operator==(const ObjectHandle &lhs, const ObjectHandle &rhs)
equality operator