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


The HDF Group Help Desk:
  Copyright by The HDF Group