My Project  1.10.8
H5PropList.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 H5PropList_H
16 #define H5PropList_H
17 
18 namespace H5 {
19 
24 // Inheritance: IdComponent
25 class H5_DLLCPP PropList : public IdComponent {
26  public:
28  static const PropList &DEFAULT;
29 
30  // Creates a property list of a given type or creates a copy of an
31  // existing property list giving the property list id.
32  PropList(const hid_t plist_id);
33 
34  // Make a copy of the given property list using assignment statement
35  PropList &operator=(const PropList &rhs);
36 
37  // Compares this property list or class against the given list or class.
38  bool operator==(const PropList &rhs) const;
39 
40  // Close this property list.
41  virtual void close();
42 
43  // Close a property list class.
44  void closeClass() const;
45 
46  // Makes a copy of the given property list.
47  void copy(const PropList &like_plist);
48 
49  // Copies a property from this property list or class to another
50  void copyProp(PropList &dest, const char *name) const;
51  void copyProp(PropList &dest, const H5std_string &name) const;
52 
53  // Copies a property from one property list or property class to another
54  void copyProp(PropList &dest, PropList &src, const char *name) const;
55  void copyProp(PropList &dest, PropList &src, const H5std_string &name) const;
56 
57  // Gets the class of this property list, i.e. H5P_FILE_CREATE,
58  // H5P_FILE_ACCESS, ...
59  hid_t getClass() const;
60 
61  // Return the name of a generic property list class.
62  H5std_string getClassName() const;
63 
64  // Returns the parent class of a generic property class.
65  PropList getClassParent() const;
66 
67  // Returns the number of properties in this property list or class.
68  size_t getNumProps() const;
69 
70  // Query the value of a property in a property list.
71  void getProperty(const char *name, void *value) const;
72  void getProperty(const H5std_string &name, void *value) const;
73  H5std_string getProperty(const char *name) const;
74  H5std_string getProperty(const H5std_string &name) const;
75 
76  // Set a property's value in a property list.
77  void setProperty(const char *name, const char *charptr) const;
78  void setProperty(const char *name, const void *value) const;
79  void setProperty(const char *name, const H5std_string &strg) const;
80  void setProperty(const H5std_string &name, const void *value) const;
81  void setProperty(const H5std_string &name, const H5std_string &strg) const;
82  // Deprecated after 1.10.1, missing const
83  void setProperty(const char *name, void *value) const;
84  void setProperty(const char *name, H5std_string &strg) const;
85  void setProperty(const H5std_string &name, void *value) const;
86  void setProperty(const H5std_string &name, H5std_string &strg) const;
87 
88  // Query the size of a property in a property list or class.
89  size_t getPropSize(const char *name) const;
90  size_t getPropSize(const H5std_string &name) const;
91 
92  // Determines whether a property list is a certain class.
93  bool isAClass(const PropList &prop_class) const;
94 
96  bool propExist(const char *name) const;
97  bool propExist(const H5std_string &name) const;
98 
99  // Removes a property from a property list.
100  void removeProp(const char *name) const;
101  void removeProp(const H5std_string &name) const;
102 
104  virtual H5std_string
105  fromClass() const
106  {
107  return ("PropList");
108  }
109 
110  // Default constructor: creates a stub PropList object.
111  PropList();
112 
113  // Copy constructor: same as the original PropList.
114  PropList(const PropList &original);
115 
116  // Gets the property list id.
117  virtual hid_t getId() const;
118 
119  // Destructor: properly terminates access to this property list.
120  virtual ~PropList();
121 
122 #ifndef DOXYGEN_SHOULD_SKIP_THIS
123 
124  // Deletes the PropList global constant
125  static void deleteConstants();
126 
127  protected:
128  hid_t id; // HDF5 property list id
129 
130  // Sets the property list id.
131  virtual void p_setId(const hid_t new_id);
132 
133  private:
134  static PropList *DEFAULT_;
135 
136  // Dynamically allocates the PropList global constant
137  static PropList *getConstant();
138 
139  // Friend function to set PropList id. For library use only.
140  friend void f_PropList_setId(PropList *plist, hid_t new_id);
141 
142 #endif // DOXYGEN_SHOULD_SKIP_THIS
143 
144 }; // end of PropList
145 } // namespace H5
146 
147 #endif // H5PropList_H
Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier.
Definition: H5IdComponent.h:27
Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list.
Definition: H5PropList.h:25
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5PropList.h:105
static const PropList & DEFAULT
Default property list.
Definition: H5PropList.h:28
Definition: H5AbstractDs.cpp:34


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