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


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