My Project  1.10.11
H5PropList.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 H5PropList_H
15 #define H5PropList_H
16 
17 namespace H5 {
18 
23 // Inheritance: IdComponent
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
104  fromClass() const
105  {
106  return ("PropList");
107  }
108 
109  // Default constructor: creates a stub PropList object.
110  PropList();
111 
112  // Copy constructor: same as the original PropList.
113  PropList(const PropList &original);
114 
115  // Gets the property list id.
116  virtual hid_t getId() const;
117 
118  // Destructor: properly terminates access to this property list.
119  virtual ~PropList();
120 
121 #ifndef DOXYGEN_SHOULD_SKIP_THIS
122 
123  // Deletes the PropList global constant
124  static void deleteConstants();
125 
126  protected:
127  hid_t id; // HDF5 property list id
128 
129  // Sets the property list id.
130  virtual void p_setId(const hid_t new_id);
131 
132  private:
133  static PropList *DEFAULT_;
134 
135  // Dynamically allocates the PropList global constant
136  static PropList *getConstant();
137 
138  // Friend function to set PropList id. For library use only.
139  friend void f_PropList_setId(PropList *plist, hid_t new_id);
140 
141 #endif // DOXYGEN_SHOULD_SKIP_THIS
142 
143 }; // end of PropList
144 } // namespace H5
145 
146 #endif // H5PropList_H
H5::PropList::getNumProps
size_t getNumProps() const
Returns the number of properties in this property list or class.
Definition: H5PropList.cpp:573
H5::Exception
Exception provides wrappers of HDF5 error handling functions.
Definition: H5Exception.h:27
H5::PropList::propExist
bool propExist(const char *name) const
Query the existence of a property in a property object.
Definition: H5PropList.cpp:376
H5::PropListIException
Definition: H5Exception.h:123
H5::PropList::closeClass
void closeClass() const
Close a property list class.
Definition: H5PropList.cpp:416
H5::IdComponent::incRefCount
void incRefCount() const
Increment reference counter for the id of this object.
Definition: H5IdComponent.cpp:54
H5::PropList::~PropList
virtual ~PropList()
Properly terminates access to this property list.
Definition: H5PropList.cpp:827
H5::PropList::fromClass
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5PropList.h:104
H5::PropList::getPropSize
size_t getPropSize(const char *name) const
Query the size of a property in a property list or class.
Definition: H5PropList.cpp:520
H5::PropList::removeProp
void removeProp(const char *name) const
Removes a property from a property list.
Definition: H5PropList.cpp:754
H5::PropList::operator=
PropList & operator=(const PropList &rhs)
Assignment operator.
Definition: H5PropList.cpp:203
H5::PropList::operator==
bool operator==(const PropList &rhs) const
Compares this property list or class against the given list or class.
Definition: H5PropList.cpp:786
H5::Exception::getDetailMsg
H5std_string getDetailMsg() const
Returns the detailed message set at the time the exception is thrown.
Definition: H5Exception.cpp:264
H5::PropList::PropList
PropList()
Default constructor: creates a stub property list object.
Definition: H5PropList.cpp:89
H5::PropList::getProperty
void getProperty(const char *name, void *value) const
Query the value of a property in a property list.
Definition: H5PropList.cpp:437
H5::PropList::DEFAULT
static const PropList & DEFAULT
Default property list.
Definition: H5PropList.h:27
H5::IdComponent
Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier.
Definition: H5IdComponent.h:26
H5::PropList::getClassParent
PropList getClassParent() const
Returns the parent class of a generic property class.
Definition: H5PropList.cpp:807
H5::PropList::getId
virtual hid_t getId() const
Get the id of this property list.
Definition: H5PropList.cpp:292
H5::PropList::getClass
hid_t getClass() const
Returns the class of this property list, i.e. H5P_FILE_CREATE...
Definition: H5PropList.cpp:354
H5
Definition: H5AbstractDs.cpp:33
H5::PropList::getClassName
H5std_string getClassName() const
Return the name of a generic property list class.
Definition: H5PropList.cpp:552
H5::PropList::setProperty
void setProperty(const char *name, const char *charptr) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: H5PropList.cpp:632
H5::PropList::close
virtual void close()
Closes the property list if it is not a default one.
Definition: H5PropList.cpp:334
H5::PropList::copy
void copy(const PropList &like_plist)
Makes a copy of an existing property list.
Definition: H5PropList.cpp:174
H5::PropList
Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list.
Definition: H5PropList.h:24
H5::PropList::isAClass
bool isAClass(const PropList &prop_class) const
Determines whether a property list is a certain class.
Definition: H5PropList.cpp:733
H5::PropList::copyProp
void copyProp(PropList &dest, const char *name) const
Copies a property from this property list or class to another.
Definition: H5PropList.cpp:219


The HDF Group Help Desk:
  Copyright by The HDF Group