HDF5 C++ API  1.8.18
 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 files COPYING and Copyright.html. COPYING can be found at the root *
10  * of the source code distribution tree; Copyright.html can be found at the *
11  * root level of an installed copy of the electronic HDF5 document set and *
12  * is linked from the top-level documents page. It can also be found at *
13  * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
14  * access to either file, you may request a copy from help@hdfgroup.org. *
15  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 
17 #ifndef __H5PropList_H
18 #define __H5PropList_H
19 
20 namespace H5 {
21 
23 class H5_DLLCPP PropList : public IdComponent {
24  public:
26  static const PropList& DEFAULT;
27 
28  // Creates a property list of a given type or creates a copy of an
29  // existing property list giving the property list id.
30  PropList(const hid_t plist_id);
31 
32  // Make a copy of the given property list using assignment statement
33  PropList& operator=( const PropList& rhs );
34 
35  // Compares this property list or class against the given list or class.
36  bool operator==(const PropList& rhs) const;
37 
38  // Close this property list.
39  virtual void close();
40 
41  // Close a property list class.
42  void closeClass() const;
43 
44  // Makes a copy of the given property list.
45  void copy( const PropList& like_plist );
46 
47  // Copies a property from this property list or class to another
48  void copyProp( PropList& dest, const char* name) const;
49  void copyProp( PropList& dest, const H5std_string& name) const;
50 
51  // Copies a property from one property list or property class to another
52  void copyProp( PropList& dest, PropList& src, const char* name) const;
53  void copyProp( PropList& dest, PropList& src, const H5std_string& name) const;
54 
55  // Gets the class of this property list, i.e. H5P_FILE_CREATE,
56  // H5P_FILE_ACCESS, ...
57  hid_t getClass() const;
58 
59  // Return the name of a generic property list class.
60  H5std_string getClassName() const;
61 
62  // Returns the parent class of a generic property class.
63  PropList getClassParent() const;
64 
65  // Returns the number of properties in this property list or class.
66  size_t getNumProps() const;
67 
68  // Query the value of a property in a property list.
69  void getProperty(const char* name, void* value) const;
70  void getProperty(const H5std_string& name, void* value) const;
71  H5std_string getProperty(const char* name) const;
72  H5std_string getProperty(const H5std_string& name) const;
73 
74  // Set a property's value in a property list.
75  void setProperty(const char* name, void* value) const;
76  void setProperty(const char* name, const char* charptr) const;
77  void setProperty(const char* name, H5std_string& strg) const;
78  void setProperty(const H5std_string& name, void* value) const;
79  void setProperty(const H5std_string& name, H5std_string& strg) const;
80 
81  // Query the size of a property in a property list or class.
82  size_t getPropSize(const char *name) const;
83  size_t getPropSize(const H5std_string& name) const;
84 
85  // Determines whether a property list is a certain class.
86  bool isAClass(const PropList& prop_class) const;
87 
89  bool propExist(const char* name) const;
90  bool propExist(const H5std_string& name) const;
91 
92  // Removes a property from a property list.
93  void removeProp(const char *name) const;
94  void removeProp(const H5std_string& name) const;
95 
97  virtual H5std_string fromClass () const { return("PropList"); }
98 
99  // Default constructor: creates a stub PropList object.
100  PropList();
101 
102  // Copy constructor: creates a copy of a PropList object.
103  PropList(const PropList& original);
104 
105  // Gets the property list id.
106  virtual hid_t getId() const;
107 
108  // Destructor: properly terminates access to this property list.
109  virtual ~PropList();
110 
111 #ifndef DOXYGEN_SHOULD_SKIP_THIS
112 
113  // Deletes the PropList global constant
114  static void deleteConstants();
115 
116  protected:
117  hid_t id; // HDF5 property list id
118 
119  // Sets the property list id.
120  virtual void p_setId(const hid_t new_id);
121 
122  private:
123  static PropList* DEFAULT_;
124 
125  // Dynamically allocates the PropList global constant
126  static PropList* getConstant();
127 
128  // Friend function to set PropList id. For library use only.
129  friend void f_PropList_setId(PropList* plist, hid_t new_id);
130 
131 #endif // DOXYGEN_SHOULD_SKIP_THIS
132 };
133 
134 }
135 #endif // __H5PropList_H
Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier.
Definition: H5IdComponent.h:32
Class PropList provides operations for generic property lists.
Definition: H5PropList.h:23
static const PropList & DEFAULT
Default property list.
Definition: H5PropList.h:26
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5PropList.h:97


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