My Project  1.12.2
H5IdComponent.h
1 // C++ informative line for the emacs editor: -*- C++ -*-
2 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3  * Copyright by The HDF Group. *
4  * Copyright by the Board of Trustees of the University of Illinois. *
5  * All rights reserved. *
6  * *
7  * This file is part of HDF5. The full HDF5 copyright notice, including *
8  * terms governing use, modification, and redistribution, is contained in *
9  * the COPYING file, which can be found at the root of the source code *
10  * distribution tree, or in https://www.hdfgroup.org/licenses. *
11  * If you do not have access to either file, you may request a copy from *
12  * help@hdfgroup.org. *
13  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 
15 #ifndef H5IdComponent_H
16 #define H5IdComponent_H
17 
18 namespace H5 {
19 
27 class H5_DLLCPP IdComponent {
28  public:
29  // Increment reference counter.
30  void incRefCount(const hid_t obj_id) const;
31  void incRefCount() const;
32 
33  // Decrement reference counter.
34  void decRefCount(const hid_t obj_id) const;
35  void decRefCount() const;
36 
37  // Get the reference counter to this identifier.
38  int getCounter(const hid_t obj_id) const;
39  int getCounter() const;
40 
41  // Returns an HDF5 object type, given the object id.
42  static H5I_type_t getHDFObjType(const hid_t obj_id);
43 
44  // Returns an HDF5 object type of this object.
45  H5I_type_t getHDFObjType() const;
46 
47  // Returns the number of members in a type.
48  static hsize_t getNumMembers(H5I_type_t type);
49 
50  // Checks if the given ID is valid.
51  static bool isValid(hid_t an_id);
52 
53  // Determines if an type exists.
54  static bool typeExists(H5I_type_t type);
55 
56  // Assignment operator.
57  IdComponent &operator=(const IdComponent &rhs);
58 
59  // Sets the identifier of this object to a new value.
60  void setId(const hid_t new_id);
61 
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 
64  // Gets the identifier of this object.
65  virtual hid_t getId() const = 0;
66 
67  // Pure virtual function for there are various H5*close for the
68  // subclasses.
69  virtual void close() = 0;
70 
71  // Makes and returns the string "<class-name>::<func_name>";
72  // <class-name> is returned by fromClass().
73  H5std_string inMemFunc(const char *func_name) const;
74 
76  virtual H5std_string
77  fromClass() const
78  {
79  return ("IdComponent");
80  }
81 
82 #endif // DOXYGEN_SHOULD_SKIP_THIS
83 
84  // Destructor
85  virtual ~IdComponent();
86 
87 #ifndef DOXYGEN_SHOULD_SKIP_THIS
88 
89  protected:
90  // Default constructor.
91  IdComponent();
92 
93  // Gets the name of the file, in which an HDF5 object belongs.
94  H5std_string p_get_file_name() const;
95 
96  // Verifies that the given id is valid.
97  static bool p_valid_id(const hid_t obj_id);
98 
99  // Sets the identifier of this object to a new value. - this one
100  // doesn't increment reference count
101  virtual void p_setId(const hid_t new_id) = 0;
102 
103  // This flag is used to decide whether H5dont_atexit should be called
104  static bool H5dontAtexit_called;
105 
106  private:
107  // This flag indicates whether H5Library::initH5cpp has been called
108  // to register various terminating functions with atexit()
109  static bool H5cppinit;
110 
111 #endif // DOXYGEN_SHOULD_SKIP_THIS
112 
113 }; // end class IdComponent
114 } // namespace H5
115 
116 #endif // H5IdComponent_H
Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier.
Definition: H5IdComponent.h:27
Definition: H5AbstractDs.cpp:34


The HDF Group Help Desk:
  Copyright by The HDF Group
and the Board of Trustees of the University of Illinois