My Project 1.10.4
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
18namespace H5 {
19
27class 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 // Returns the number of members in a type.
49 static hsize_t getNumMembers(H5I_type_t type);
50
51 // Checks if the given ID is valid.
52 static bool isValid(hid_t an_id);
53
54 // Determines if an type exists.
55 static bool typeExists(H5I_type_t type);
56
57 // Assignment operator.
58 IdComponent& operator=(const IdComponent& rhs);
59
60 // Sets the identifier of this object to a new value.
61 void setId(const hid_t new_id);
62
63#ifndef DOXYGEN_SHOULD_SKIP_THIS
64
65 // Gets the identifier of this object.
66 virtual hid_t getId () const = 0;
67
68 // Pure virtual function for there are various H5*close for the
69 // subclasses.
70 virtual void close() = 0;
71
72 // Makes and returns the string "<class-name>::<func_name>";
73 // <class-name> is returned by fromClass().
74 H5std_string inMemFunc(const char* func_name) const;
75
77 virtual H5std_string fromClass() const { return("IdComponent");}
78
79#endif // DOXYGEN_SHOULD_SKIP_THIS
80
81 // Destructor
82 virtual ~IdComponent();
83
84#ifndef DOXYGEN_SHOULD_SKIP_THIS
85
86 protected:
87 // Default constructor.
89
90 // Gets the name of the file, in which an HDF5 object belongs.
91 H5std_string p_get_file_name() const;
92
93 // Verifies that the given id is valid.
94 static bool p_valid_id(const hid_t obj_id);
95
96 // Sets the identifier of this object to a new value. - this one
97 // doesn't increment reference count
98 virtual void p_setId(const hid_t new_id) = 0;
99
100 // This flag is used to decide whether H5dont_atexit should be called
101 static bool H5dontAtexit_called;
102
103 private:
104 // This flag indicates whether H5Library::initH5cpp has been called
105 // to register various terminating functions with atexit()
106 static bool H5cppinit;
107
108#endif // DOXYGEN_SHOULD_SKIP_THIS
109
110}; // end class IdComponent
111} // namespace H5
112
113#endif // __IdComponent_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