HDF5 C++ API  1.8.20
 All Classes Namespaces Functions Variables Typedefs Friends Pages
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://support.hdfgroup.org/ftp/HDF5/releases. *
11  * If you do not have access to either file, you may request a copy from *
12  * help@hdfgroup.org. *
13  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 
15 #ifndef __IdComponent_H
16 #define __IdComponent_H
17 
18 namespace H5 {
19 
27 class H5_DLLCPP IdComponent {
28  public:
29 
30  // Increment reference counter.
31  void incRefCount(const hid_t obj_id) const;
32  void incRefCount() const;
33 
34  // Decrement reference counter.
35  void decRefCount(const hid_t obj_id) const;
36  void decRefCount() const;
37 
38  // Get the reference counter to this identifier.
39  int getCounter(const hid_t obj_id) const;
40  int getCounter() const;
41 
42  // Returns an HDF5 object type, given the object id.
43  static H5I_type_t getHDFObjType(const hid_t obj_id);
44 
45  // Returns an HDF5 object type of this object.
46  H5I_type_t getHDFObjType() const;
47 
48  // Checks if the given ID is valid.
49  static bool isValid(hid_t an_id);
50 
51  // Assignment operator.
52  IdComponent& operator=(const IdComponent& rhs);
53 
54  // Sets the identifier of this object to a new value.
55  void setId(const hid_t new_id);
56 
57  // *** Deprecation warning ***
58  // The following two constructors are no longer appropriate after the
59  // data member "id" had been moved to the sub-classes.
60  // The copy constructor is a noop and is removed in 1.8.15 and the
61  // other will be removed from 1.10 release, and then from 1.8 if its
62  // removal does not raise any problems in two 1.10 releases.
63 
64  // Creates an object to hold an HDF5 identifier.
65  // IdComponent(const hid_t h5_id); - removed in 1.8.19
66 
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68 
69  // Copy constructor: makes copy of the original IdComponent object.
70  // IdComponent(const IdComponent& original); - removed from 1.8.15
71 
72  // Gets the identifier of this object.
73  virtual hid_t getId () const = 0;
74 
75  // Pure virtual function for there are various H5*close for the
76  // subclasses.
77  virtual void close() = 0;
78 
79  // Makes and returns the string "<class-name>::<func_name>";
80  // <class-name> is returned by fromClass().
81  H5std_string inMemFunc(const char* func_name) const;
82 
84  virtual H5std_string fromClass() const { return("IdComponent");}
85 
86 #endif // DOXYGEN_SHOULD_SKIP_THIS
87 
88  // Destructor
89  virtual ~IdComponent();
90 
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92 
93  protected:
94 
95  // Default constructor.
96  IdComponent();
97 
98  // Gets the name of the file, in which an HDF5 object belongs.
99  H5std_string p_get_file_name() const;
100 
101  // Verifies that the given id is valid.
102  static bool p_valid_id(const hid_t obj_id);
103 
104  // Sets the identifier of this object to a new value. - this one
105  // doesn't increment reference count
106  virtual void p_setId(const hid_t new_id) = 0;
107 
108  // This flag is used to decide whether H5dont_atexit should be called
109  static bool H5dontAtexit_called;
110 
111  private:
112  // This flag indicates whether H5Library::initH5cpp has been called
113  // to register various terminating functions with atexit()
114  static bool H5cppinit;
115 
116 #endif // DOXYGEN_SHOULD_SKIP_THIS
117 
118 }; // end class IdComponent
119 } // namespace H5
120 
121 #endif // __IdComponent_H
Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier.
Definition: H5IdComponent.h:27


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