Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/
HDF5 Last Updated on 2025-12-13
The HDF5 Field Guide
Loading...
Searching...
No Matches
PropList Class Reference

#include <c++/src/H5PropList.h>

Detailed Description

Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list.

+ Inheritance diagram for PropList:

Public Member Functions

virtual void close () override
 Closes the property list if it is not a default one.
 
void closeClass () const
 Close a property list class.
 
void copy (const PropList &like_plist)
 Makes a copy of an existing property list.
 
void copyProp (PropList &dest, const char *name) const
 Copies a property from this property list or class to another.
 
void copyProp (PropList &dest, const std::string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void copyProp (PropList &dest, PropList &src, const char *name) const
 Copies a property from one list or class to another - Obsolete.
 
void copyProp (PropList &dest, PropList &src, const std::string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts. - Obsolete.
 
virtual std::string fromClass () const override
 Returns this class name.
 
hid_t getClass () const
 Returns the class of this property list, i.e. H5P_FILE_CREATE...
 
std::string getClassName () const
 Return the name of a generic property list class.
 
PropList getClassParent () const
 Returns the parent class of a generic property class.
 
virtual hid_t getId () const override
 Get the id of this property list.
 
size_t getNumProps () const
 Returns the number of properties in this property list or class.
 
std::string getProperty (const char *name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void getProperty (const char *name, void *value) const
 Query the value of a property in a property list.
 
std::string getProperty (const std::string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void getProperty (const std::string &name, void *value) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
size_t getPropSize (const char *name) const
 Query the size of a property in a property list or class.
 
size_t getPropSize (const std::string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
bool isAClass (const PropList &prop_class) const
 Determines whether a property list is a certain class.
 
PropListoperator= (const PropList &rhs)
 Assignment operator.
 
bool operator== (const PropList &rhs) const
 Compares this property list or class against the given list or class.
 
bool propExist (const char *name) const
 Query the existence of a property in a property object.
 
bool propExist (const std::string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
 PropList ()
 Default constructor: creates a stub property list object.
 
 PropList (const hid_t plist_id)
 Creates a property list using the id of an existing property.
 
 PropList (const PropList &original)
 Copy constructor: same HDF5 object as original.
 
void removeProp (const char *name) const
 Removes a property from a property list.
 
void removeProp (const std::string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void setProperty (const char *name, const char *charptr) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void setProperty (const char *name, const std::string &strg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void setProperty (const char *name, const void *value) const
 Set a property's value in a property list.
 
void setProperty (const char *name, std::string &strg) const
 Deprecated due to missing const in prototype. (1.10.1)
 
void setProperty (const char *name, void *value) const
 Deprecated due to missing const in prototype. (1.10.1)
 
void setProperty (const std::string &name, const std::string &strg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void setProperty (const std::string &name, const void *value) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
 
void setProperty (const std::string &name, std::string &strg) const
 Deprecated due to missing const in prototype. (1.10.1)
 
void setProperty (const std::string &name, void *value) const
 Deprecated due to missing const in prototype. (1.10.1)
 
virtual ~PropList () override
 Properly terminates access to this property list.
 
- Public Member Functions inherited from IdComponent
void decRefCount () const
 Decrement reference counter for the id of this object.
 
void decRefCount (const hid_t obj_id) const
 Decrement reference counter for a given id.
 
int getCounter () const
 Returns the reference counter for the id of this object.
 
int getCounter (const hid_t obj_id) const
 Returns the reference counter for a given id.
 
H5I_type_t getHDFObjType () const
 Returns the type of the object. It is an overloaded function of the above function.
 
void incRefCount () const
 Increment reference counter for the id of this object.
 
void incRefCount (const hid_t obj_id) const
 Increment reference counter for a given id.
 
std::string inMemFunc (const char *func_name) const
 Makes and returns string "<class-name>::<func_name>".
 
IdComponentoperator= (const IdComponent &rhs)
 Assignment operator.
 
void setId (const hid_t new_id)
 Sets the identifier of this object to a new value.
 
virtual ~IdComponent ()=default
 

Static Public Member Functions

static void deleteConstants ()
 
- Static Public Member Functions inherited from IdComponent
static H5I_type_t getHDFObjType (const hid_t obj_id)
 Given an id, returns the type of the object.
 
static hsize_t getNumMembers (H5I_type_t type)
 Returns the number of members of the given type.
 
static bool isValid (hid_t an_id)
 Checks if the given ID is valid.
 
static bool typeExists (H5I_type_t type)
 Queries if a given type is currently registered with the library.
 

Static Public Attributes

static const PropListDEFAULT = *getConstant()
 Default property list.
 

Protected Member Functions

virtual void p_setId (const hid_t new_id) override
 Sets the identifier of this object to a new value.
 
- Protected Member Functions inherited from IdComponent
 IdComponent ()
 Default constructor.
 
std::string p_get_file_name () const
 

Protected Attributes

hid_t id
 

Friends

void f_PropList_setId (PropList *plist, hid_t new_id)
 

Additional Inherited Members

- Static Protected Member Functions inherited from IdComponent
static bool p_valid_id (const hid_t obj_id)
 
- Static Protected Attributes inherited from IdComponent
static bool H5dontAtexit_called = false
 

Constructor & Destructor Documentation

◆ PropList() [1/3]

PropList ( const hid_t plist_id)

Creates a property list using the id of an existing property.

Parameters
plist_id- IN: Id of the existing property list
Exceptions
H5::PropListIException

◆ PropList() [2/3]

PropList ( )

Default constructor: creates a stub property list object.

◆ PropList() [3/3]

PropList ( const PropList & original)

Copy constructor: same HDF5 object as original.

Parameters
original- IN: The original property list to copy

◆ ~PropList()

~PropList ( )
overridevirtual

Properly terminates access to this property list.

Member Function Documentation

◆ close()

void close ( )
overridevirtual

Closes the property list if it is not a default one.

Exceptions
H5::PropListIException

Implements IdComponent.

◆ closeClass()

void closeClass ( ) const

Close a property list class.

Exceptions
H5::PropListIException
Description
Releases memory and detaches a class from the property list class hierarchy.

◆ copy()

void copy ( const PropList & like_plist)

Makes a copy of an existing property list.

Parameters
like_plist- IN: Reference to the existing property list
Exceptions
H5::PropListIException

◆ copyProp() [1/4]

void copyProp ( PropList & dest,
const char * name ) const

Copies a property from this property list or class to another.

Parameters
dest- IN: Destination property list or class
name- IN: Name of the property to copy - char pointer
Exceptions
H5::PropListIException

◆ copyProp() [2/4]

void copyProp ( PropList & dest,
const std::string & name ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
dest- IN: Destination property list or class
name- IN: Name of the property to copy - H5std_string

◆ copyProp() [3/4]

void copyProp ( PropList & dest,
PropList & src,
const char * name ) const

Copies a property from one list or class to another - Obsolete.

Parameters
dest- IN: Destination property list or class
src- IN: Source property list or class
name- IN: Name of the property to copy - char pointer
Note
This member function will be removed in the next release
Exceptions
H5::PropListIException

◆ copyProp() [4/4]

void copyProp ( PropList & dest,
PropList & src,
const std::string & name ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts. - Obsolete.

Parameters
dest- IN: Destination property list or class
src- IN: Source property list or class
name- IN: Name of the property to copy - H5std_string

◆ deleteConstants()

void deleteConstants ( )
static

◆ fromClass()

virtual std::string fromClass ( ) const
overridevirtual

◆ getClass()

hid_t getClass ( ) const

Returns the class of this property list, i.e. H5P_FILE_CREATE...

Returns
The property list class if it is not equal to H5P_ROOT
Exceptions
H5::PropListIException

◆ getClassName()

std::string getClassName ( ) const

Return the name of a generic property list class.

Returns
A string containing the class name, if success, otherwise, an empty string.

◆ getClassParent()

PropList getClassParent ( ) const

Returns the parent class of a generic property class.

Returns
The parent class of a property class
Exceptions
H5::PropListIException

◆ getId()

hid_t getId ( ) const
overridevirtual

Get the id of this property list.

Returns
Property list identifier

Implements IdComponent.

◆ getNumProps()

size_t getNumProps ( ) const

Returns the number of properties in this property list or class.

Returns
Size of the property.
Exceptions
H5::PropListIException

◆ getProperty() [1/4]

std::string getProperty ( const char * name) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to query - char pointer
Returns
The property that is a H5std_string.
Exceptions
H5::PropListIException

◆ getProperty() [2/4]

void getProperty ( const char * name,
void * value ) const

Query the value of a property in a property list.

Parameters
name- IN: Name of property to query - char pointer
value- OUT: Pointer to the buffer for the property value
Exceptions
H5::PropListIException
Description
Retrieves a copy of the value for a property in a property list. The property name must exist or this routine will throw an exception.

◆ getProperty() [3/4]

std::string getProperty ( const std::string & name) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to query - H5std_string
Returns
The property that is a H5std_string.

◆ getProperty() [4/4]

void getProperty ( const std::string & name,
void * value ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to query - H5std_string
value- OUT: Pointer to the buffer for the property value

◆ getPropSize() [1/2]

size_t getPropSize ( const char * name) const

Query the size of a property in a property list or class.

Parameters
name- IN: Name of property to query
Returns
Size of the property
Exceptions
H5::PropListIException
Description
This routine retrieves the size of a property's value in bytes. Zero-sized properties are allowed and the return value will be of 0. This function works for both property lists and classes.

◆ getPropSize() [2/2]

size_t getPropSize ( const std::string & name) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to query - H5std_string

◆ isAClass()

bool isAClass ( const PropList & prop_class) const

Determines whether a property list is a certain class.

Parameters
prop_class- IN: Property class to query
Returns
true if the property list is a member of the property list class, and false, otherwise.
Exceptions
H5::PropListIException

◆ operator=()

PropList & operator= ( const PropList & rhs)

Assignment operator.

Parameters
rhs- IN: Reference to the existing property list
Returns
Reference to PropList instance
Exceptions
H5::PropListIException

◆ operator==()

bool operator== ( const PropList & rhs) const

Compares this property list or class against the given list or class.

Parameters
rhs- IN: Reference to the property list to compare
Returns
true if the property lists or classes are equal, and false, otherwise.
Exceptions
H5::PropListIException

◆ p_setId()

void p_setId ( const hid_t new_id)
overrideprotectedvirtual

Sets the identifier of this object to a new value.

Exceptions
H5::IdComponentExceptionwhen the attempt to close the HDF5 object fails

Implements IdComponent.

◆ propExist() [1/2]

bool propExist ( const char * name) const

Query the existence of a property in a property object.

Queries the existence of a property in a property object.

Parameters
name- IN: Name of property to check for - char pointer
Returns
true if the property exists in the property object, and false, otherwise.
Exceptions
H5::PropListIException
Description
This routine checks if a property exists within a property list or class.

◆ propExist() [2/2]

bool propExist ( const std::string & name) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to check for - H5std_string

◆ removeProp() [1/2]

void removeProp ( const char * name) const

Removes a property from a property list.

Parameters
name- IN: Name of property to remove - char pointer
Exceptions
H5::PropListIException

◆ removeProp() [2/2]

void removeProp ( const std::string & name) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to remove - H5std_string

◆ setProperty() [1/9]

void setProperty ( const char * name,
const char * charptr ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to set - char pointer
charptr- IN: Char pointer to the value for the property

◆ setProperty() [2/9]

void setProperty ( const char * name,
const std::string & strg ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to set - char pointer
strg- IN: Value for the property is a H5std_string

◆ setProperty() [3/9]

void setProperty ( const char * name,
const void * value ) const

Set a property's value in a property list.

Parameters
name- IN: Name of property to set - char pointer
value- IN: Void pointer to the value for the property
Exceptions
H5::PropListIException

◆ setProperty() [4/9]

void setProperty ( const char * name,
std::string & strg ) const

Deprecated due to missing const in prototype. (1.10.1)

◆ setProperty() [5/9]

void setProperty ( const char * name,
void * value ) const

Deprecated due to missing const in prototype. (1.10.1)

◆ setProperty() [6/9]

void setProperty ( const std::string & name,
const std::string & strg ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to set - H5std_string
strg- IN: Value for the property is a H5std_string

◆ setProperty() [7/9]

void setProperty ( const std::string & name,
const void * value ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters
name- IN: Name of property to set - H5std_string
value- IN: Void pointer to the value for the property

◆ setProperty() [8/9]

void setProperty ( const std::string & name,
std::string & strg ) const

Deprecated due to missing const in prototype. (1.10.1)

◆ setProperty() [9/9]

void setProperty ( const std::string & name,
void * value ) const

Deprecated due to missing const in prototype. (1.10.1)

Friends And Related Symbol Documentation

◆ f_PropList_setId

void f_PropList_setId ( PropList * plist,
hid_t new_id )
friend

Field Documentation

◆ DEFAULT

const PropList & DEFAULT = *getConstant()
static

Default property list.

◆ id

hid_t id
protected

The documentation for this class was generated from the following files: