Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/

| HDF5 Last Updated on 2026-07-28 The HDF5 Field Guide

Loading...
Searching...
No Matches
H5Location Class Reference

`#include <c++/src/H5Location.h>`

## Detailed Description

H5Location is an abstract base class, added in version 1.8.12.

It provides a collection of wrappers for the C functions that take a location identifier to specify the HDF5 object. The location identifier can be either file, group, dataset, attribute, or named datatype.

Inheritance diagram for H5Location:

## Public Member Functions
H5O_type_t | childObjType (const char *objname) const
| Returns the type of an object in this file/group, given the object's name.
H5O_type_t | childObjType (const std::string &objname) const
| This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name.
H5O_type_t | childObjType (hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char *objname=".") const
| Returns the type of an object in this file/group, given the object's index and its type and order.
unsigned | childObjVersion (const char *objname) const
| Returns the object header version of an object in this file/group, given the object's name.
unsigned | childObjVersion (const std::string &objname) const
| This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name.
void | copyLink (const char *src_name, const char *dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Copies a link from a group in the same location.
void | copyLink (const char *src_name, const Group &dst, const char *dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Copies a link from one group to another.
void | copyLink (const std::string &src_name, const Group &dst, const std::string &dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.
void | copyLink (const std::string &src_name, const std::string &dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.
DataSet | createDataSet (const char *name, const DataType &data_type, const DataSpace &data_space, const DSetCreatPropList &create_plist=DSetCreatPropList::DEFAULT, const DSetAccPropList &dapl=DSetAccPropList::DEFAULT, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT) const
| Creates a new dataset at this location.
DataSet | createDataSet (const std::string &name, const DataType &data_type, const DataSpace &data_space, const DSetCreatPropList &create_plist=DSetCreatPropList::DEFAULT, const DSetAccPropList &dapl=DSetAccPropList::DEFAULT, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
Group | createGroup (const char *name, const LinkCreatPropList &lcpl) const
| Creates a new group at this location, which can be a file, group, dataset, attribute, or named datatype.
Group | createGroup (const char *name, size_t size_hint=0) const
| Creates a new group at this location, which can be a file, group, dataset, attribute, or named datatype.
Group | createGroup (const std::string &name, const LinkCreatPropList &lcpl) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
Group | createGroup (const std::string &name, size_t size_hint=0) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | dereference (const H5Location &loc, const void *ref, H5R_type_t ref_type=H5R_OBJECT, const PropList &plist=PropList::DEFAULT)
| Dereferences a reference into an HDF5 object, given an HDF5 object.
bool | exists (const char *name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Deprecated in favor of nameExists.
bool | exists (const std::string &name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Deprecated in favor of nameExists.
void | flush (H5F_scope_t scope) const
| Flushes all buffers associated with a location to disk.
ssize_t | getComment (const char *name, size_t buf_size, char *comment) const
| Retrieves the comment for this location, returning its length.
std::string | getComment (const char *name, size_t buf_size=0) const
| Returns the comment as string for this location, returning its length.
std::string | getComment (const std::string &name, size_t buf_size=0) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
std::string | getFileName () const
| Gets the name of the file, in which an HDF5 object at this location belongs.
H5L_info2_t | getLinkInfo (const char *link_name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Returns the information of the named link.
H5L_info2_t | getLinkInfo (const std::string &link_name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for link_name.
std::string | getLinkval (const char *link_name, size_t size=0) const
| Returns the name of the object that the symbolic link points to.
std::string | getLinkval (const std::string &link_name, size_t size=0) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | getNativeObjinfo (const char *grp_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, H5O_native_info_t &objinfo, unsigned fields=H5O_NATIVE_INFO_HDR, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Retrieves native information about an HDF5 object given its index.
void | getNativeObjinfo (const char *name, H5O_native_info_t &objinfo, unsigned fields=H5O_NATIVE_INFO_HDR, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Retrieves native information about an HDF5 object given its name.
void | getNativeObjinfo (const std::string &grp_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, H5O_native_info_t &objinfo, unsigned fields=H5O_NATIVE_INFO_HDR, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for grp_name.
void | getNativeObjinfo (const std::string &name, H5O_native_info_t &objinfo, unsigned fields=H5O_NATIVE_INFO_HDR, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for name.
void | getNativeObjinfo (H5O_native_info_t &objinfo, unsigned fields=H5O_NATIVE_INFO_HDR) const
| Retrieves native information about an HDF5 object.
hsize_t | getNumObjs () const
| Deprecated - moved to H5::Group in 1.10.2.
void | getObjinfo (const char *grp_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, H5O_info2_t &objinfo, unsigned fields=H5O_INFO_BASIC, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Retrieves information about an HDF5 object given its index.
void | getObjinfo (const char *name, bool follow_link, H5G_stat_t &statbuf) const
| Returns information about an object.
void | getObjinfo (const char *name, H5G_stat_t &statbuf) const
| This is an overloaded member function, provided for convenience. It differs from the above functions in that it doesn't have the parameter follow_link.
void | getObjinfo (const char *name, H5O_info2_t &objinfo, unsigned fields=H5O_INFO_BASIC, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Retrieves information about an HDF5 object given its name.
void | getObjinfo (const std::string &grp_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, H5O_info2_t &objinfo, unsigned fields=H5O_INFO_BASIC, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for name.
void | getObjinfo (const std::string &name, bool follow_link, H5G_stat_t &statbuf) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | getObjinfo (const std::string &name, H5G_stat_t &statbuf) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | getObjinfo (const std::string &name, H5O_info2_t &objinfo, unsigned fields=H5O_INFO_BASIC, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for name.
void | getObjinfo (H5O_info2_t &objinfo, unsigned fields=H5O_INFO_BASIC) const
| Retrieves information about an HDF5 object.
std::string | getObjnameByIdx (hsize_t idx) const
| Returns the name of an object in this group, given the object's index.
ssize_t | getObjnameByIdx (hsize_t idx, char *name, size_t size) const
| Retrieves the name of an object in this group, given the object's index.
ssize_t | getObjnameByIdx (hsize_t idx, std::string &name, size_t size) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
H5G_obj_t | getObjType (void *ref, H5R_type_t ref_type=H5R_OBJECT) const
| Retrieves the type of object that an object reference points to.
H5G_obj_t | getObjTypeByIdx (hsize_t idx) const
| Returns the type of an object in this group, given the object's index. (Deprecated).
H5G_obj_t | getObjTypeByIdx (hsize_t idx, char *type_name) const
| This is an overloaded member function, provided for convenience. It differs from the above function because it also provides the returned object type in text (char*) (Deprecated).
H5G_obj_t | getObjTypeByIdx (hsize_t idx, std::string &type_name) const
| This is an overloaded member function, provided for convenience. It differs from the above function because it also provides the returned object type in text (H5std_string&) (Deprecated).
H5O_type_t | getRefObjType (void *ref, H5R_type_t ref_type=H5R_OBJECT) const
| Retrieves the type of object that an object reference points to.
DataSpace | getRegion (void *ref, H5R_type_t ref_type=H5R_DATASET_REGION) const
| Retrieves a dataspace with the region pointed to selected.
| H5Location ()
int | iterateElems (const char *name, int *idx, H5G_iterate_t op, void *op_data)
| Iterates a user's function over the entries of a group.
int | iterateElems (const std::string &name, int *idx, H5G_iterate_t op, void *op_data)
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | link (const char *curr_name, const Group &new_loc, const char *new_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Creates a hard link from new_name to curr_name.
void | link (const char *curr_name, const hid_t same_loc, const char *new_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Creates a hard link from new_name to curr_name - can be used to pass in H5L_SAME_LOC.
void | link (const char *target_name, const char *link_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Creates a soft link from link_name to target_name.
void | link (const std::string &curr_name, const Group &new_loc, const std::string &new_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for curr_name and new_name.
void | link (const std::string &curr_name, const hid_t same_loc, const std::string &new_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for curr_name and new_name.
void | link (const std::string &target_name, const std::string &link_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for target_name and link_name.
void | link (H5L_type_t link_type, const char *curr_name, const char *new_name) const
| Creates a link of the specified type from new_name to curr_name.
void | link (H5L_type_t link_type, const std::string &curr_name, const std::string &new_name) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for curr_name and new_name.
void | mount (const char *name, const H5File &child, const PropList &plist) const
| Mounts the file child onto this group.
void | mount (const std::string &name, const H5File &child, const PropList &plist) const
| This is an overloaded member function, provided for convenience. It takes an `H5std_string` for name.
void | move (const char *src, const char *dst) const
| Renames an object at this location. - Deprecated in favor of moveLink().
void | move (const std::string &src, const std::string &dst) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src and dst. - Deprecated in favor of moveLink().
void | moveLink (const char *src_name, const char *dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Renames a link in this group.
void | moveLink (const char *src_name, const Group &dst, const char *dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Renames a link in this group and moves it to a new location.
void | moveLink (const std::string &src_name, const Group &dst, const std::string &dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.
void | moveLink (const std::string &src_name, const std::string &dst_name, const LinkCreatPropList &lcpl=LinkCreatPropList::DEFAULT, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.
bool | nameExists (const char *name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Checks if a link of a given name exists in a location.
bool | nameExists (const std::string &name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Checks if a link of a given name exists in a location.
DataSet | openDataSet (const char *name, const DSetAccPropList &dapl=DSetAccPropList::DEFAULT) const
| Opens an existing dataset at this location.
DataSet | openDataSet (const std::string &name, const DSetAccPropList &dapl=DSetAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
Group | openGroup (const char *name) const
| Opens an existing group in a location which can be a file or another group.
Group | openGroup (const std::string &name) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | reference (void *ref, const char *name, const DataSpace &dataspace, H5R_type_t ref_type=H5R_DATASET_REGION) const
| Creates a reference to an HDF5 object or a dataset region.
void | reference (void *ref, const char *name, H5R_type_t ref_type=H5R_OBJECT) const
| This is an overloaded function, provided for your convenience. It differs from the above function in that it does not take a DataSpace object and the reference type must be specified.
void | reference (void *ref, const std::string &name, const DataSpace &dataspace, H5R_type_t ref_type=H5R_DATASET_REGION) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | reference (void *ref, const std::string &name, H5R_type_t ref_type=H5R_OBJECT) const
| This is an overloaded function, provided for your convenience. It differs from the above function in that it takes an `H5std_string` for the object's name.
void | removeComment (const char *name) const
| Removes the comment from an object specified by its name.
void | removeComment (const std::string &name) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | setComment (const char *comment) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it doesn't take an object name.
void | setComment (const char *name, const char *comment) const
| Sets or resets the comment for an object specified by its name.
void | setComment (const std::string &comment) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for comment.
void | setComment (const std::string &name, const std::string &comment) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name and comment.
virtual void | throwException (const std::string &func_name, const std::string &msg) const
| For subclasses, H5File and Group, to throw appropriate exception.
void | unlink (const char *link_name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| Removes the specified link from this group.
void | unlink (const std::string &link_name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
void | unmount (const char *name) const
| Unmounts the specified file.
void | unmount (const std::string &name) const
| This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.
Public Member Functions inherited from IdComponent
virtual void | close ()=0
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.
virtual std::string | fromClass () const
| Returns this class name.
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.
virtual hid_t | getId () const =0
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>".
IdComponent & | operator= (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

## Protected Member Functions
hid_t | p_dereference (hid_t loc_id, const void *ref, H5R_type_t ref_type, const PropList &plist, const char *from_func)
H5G_obj_t | p_get_obj_type (void *ref, H5R_type_t ref_type) const
H5O_type_t | p_get_ref_obj_type (void *ref, H5R_type_t ref_type) const
void | p_reference (void *ref, const char *name, hid_t space_id, H5R_type_t ref_type) const
virtual | ~H5Location () override=default
Protected Member Functions inherited from IdComponent
| IdComponent ()
| Default constructor.
std::string | p_get_file_name () const
virtual void | p_setId (const hid_t new_id)=0

## Additional Inherited Members
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 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

## ◆ H5Location()

H5Location | ( |  | ) |

## ◆ ~H5Location()

virtual ~H5Location | ( |  | ) |
| override protected virtual default

## Member Function Documentation

## ◆ childObjType() [1/3]

H5O_type_t childObjType | ( | const char * | objname | ) | const

Returns the type of an object in this file/group, given the object's name.

Parameters

  objname | - IN: Name of the object

Returns
  Object type, which can have the following values for group, dataset, and named datatype
  - `H5O_TYPE_GROUP`
  - `H5O_TYPE_DATASET`
  - `H5O_TYPE_NAMED_DATATYPE` For information, please refer to the H5Oget_info_by_name API in the HDF5 C Reference Manual.

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException | Exception will be thrown when: an error returned by the C API object type is not one of the valid values above

## ◆ childObjType() [2/3]

H5O_type_t childObjType | ( | const std::string & | objname | ) | const

This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name.

Returns the type of an object in this group, given the object's name.

Parameters

  objname | - IN: Name of the object (H5std_string&)

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ childObjType() [3/3]

H5O_type_t childObjType | ( | hsize_t | index,
|  | H5_index_t | index_type = H5_INDEX_NAME,
|  | H5_iter_order_t | order = H5_ITER_INC,
|  | const char * | objname = "." ) const

Returns the type of an object in this file/group, given the object's index and its type and order.

Parameters

  index | - IN: Position of the object
  index_type | - IN: Type of the index, default to H5_INDEX_NAME
  order | - IN: Traversing order, default to H5_ITER_INC
  objname | - IN: Name of the object, default to "."

Returns
  Object type, which can have the following values for group, dataset, and named datatype
  - `H5O_TYPE_GROUP`
  - `H5O_TYPE_DATASET`
  - `H5O_TYPE_NAMED_DATATYPE` For information, please refer to the H5Oget_info_by_idx API in the HDF5 C Reference Manual.

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException | Exception will be thrown when: an error returned by the C API object type is not one of the valid values above

## ◆ childObjVersion() [1/2]

unsigned childObjVersion | ( | const char * | objname | ) | const

Returns the object header version of an object in this file/group, given the object's name.

Parameters

  objname | - IN: Name of the object

Returns
  Object version, which can have the following values:
  - `H5O_VERSION_1`
  - `H5O_VERSION_2`

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException | Exception will be thrown when: an error returned by the C API version number is not one of the valid values above

## ◆ childObjVersion() [2/2]

unsigned childObjVersion | ( | const std::string & | objname | ) | const

This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name.

Returns the type of an object in this group, given the object's name.

Parameters

  objname | - IN: Name of the object (H5std_string&)

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ copyLink() [1/4]

void copyLink | ( | const char * | src_name,
|  | const char * | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Copies a link from a group in the same location.

Parameters

  src_name | - IN: Original name
  dst_name | - IN: New name
  lcpl | - IN: Link creation plist - default LinkCreatPropList::DEFAULT
  lapl | - IN: Link access plist - default LinkAccPropList::DEFAULT

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ copyLink() [2/4]

void copyLink | ( | const char * | src_name,
|  | const Group & | dst,
|  | const char * | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Copies a link from one group to another.

Parameters

  src_name | - IN: Original name
  dst | - IN: Destination location
  dst_name | - IN: New name
  lcpl | - IN: Link creation plist - default LinkCreatPropList::DEFAULT
  lapl | - IN: Link access plist - default LinkAccPropList::DEFAULT

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ copyLink() [3/4]

void copyLink | ( | const std::string & | src_name,
|  | const Group & | dst,
|  | const std::string & | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ copyLink() [4/4]

void copyLink | ( | const std::string & | src_name,
|  | const std::string & | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ createDataSet() [1/2]

DataSet createDataSet | ( | const char * | name,
|  | const DataType & | data_type,
|  | const DataSpace & | data_space,
|  | const DSetCreatPropList & | dcpl = DSetCreatPropList::DEFAULT,
|  | const DSetAccPropList & | dapl = DSetAccPropList::DEFAULT,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT ) const

Creates a new dataset at this location.

Parameters

  name | - IN: Name of the dataset to create
  data_type | - IN: Datatype of the dataset
  data_space | - IN: Dataspace for the dataset
  dcpl | - IN: Dataset creation property list
  lcpl | - IN: Link creation property list
  dapl | - IN: Dataset access property list

Returns
  DataSet instance

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ createDataSet() [2/2]

DataSet createDataSet | ( | const std::string & | name,
|  | const DataType & | data_type,
|  | const DataSpace & | data_space,
|  | const DSetCreatPropList & | create_plist = DSetCreatPropList::DEFAULT,
|  | const DSetAccPropList & | dapl = DSetAccPropList::DEFAULT,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ createGroup() [1/4]

Group createGroup | ( | const char * | name,
|  | const LinkCreatPropList & | lcpl ) const

Creates a new group at this location, which can be a file, group, dataset, attribute, or named datatype.

Parameters

  name | - IN: Name of the group to create
  lcpl | - IN: Link creation property list

Returns
  Group instance

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

Description
  The optional size_hint specifies how much file space to reserve for storing the names that will appear in this new group. If a non-positive value is provided for the size_hint then a default size is chosen.

## ◆ createGroup() [2/4]

Group createGroup | ( | const char * | name,
|  | size_t | size_hint = 0 ) const

Creates a new group at this location, which can be a file, group, dataset, attribute, or named datatype.

Parameters

  name | - IN: Name of the group to create
  size_hint | - IN: Indicates the number of bytes to reserve for the names that will appear in the group

Returns
  Group instance

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

Description
  The optional size_hint specifies how much file space to reserve for storing the names that will appear in this new group. If a non-positive value is provided for the size_hint then a default size is chosen.

## ◆ createGroup() [3/4]

Group createGroup | ( | const std::string & | name,
|  | const LinkCreatPropList & | lcpl ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ createGroup() [4/4]

Group createGroup | ( | const std::string & | name,
|  | size_t | size_hint = 0 ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ dereference()

void dereference | ( | const H5Location & | loc,
|  | const void * | ref,
|  | H5R_type_t | ref_type = H5R_OBJECT,
|  | const PropList & | plist = PropList::DEFAULT )

Dereferences a reference into an HDF5 object, given an HDF5 object.

Parameters

  loc | - IN: Location of the referenced object
  ref | - IN: Reference pointer
  ref_type | - IN: Reference type
  plist | - IN: Property list - default to PropList::DEFAULT

Exceptions

  H5::ReferenceException |

## ◆ exists() [1/2]

bool exists | ( | const char * | name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Deprecated in favor of nameExists.

Parameters

  name | - IN: Searched name
  lapl | - IN: Link access property list

Exceptions

  H5::LocationException |

## ◆ exists() [2/2]

bool exists | ( | const std::string & | name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Deprecated in favor of nameExists.

Parameters

  name | - IN: Searched name
  lapl | - IN: Link access property list

Exceptions

  H5::LocationException |

## ◆ flush()

void flush | ( | H5F_scope_t | scope | ) | const

Flushes all buffers associated with a location to disk.

Parameters

  scope | - IN: Specifies the scope of the flushing action, which can be either of these values: `H5F_SCOPE_GLOBAL` - Flushes the entire virtual file `H5F_SCOPE_LOCAL` - Flushes only the specified file

Exceptions

  H5::LocationException |

Description
  This location is used to identify the file to be flushed.

## ◆ getComment() [1/3]

ssize_t getComment | ( | const char * | name,
|  | size_t | buf_size,
|  | char * | comment ) const

Retrieves the comment for this location, returning its length.

Parameters

  name | - IN: Name of the object
  buf_size | - IN: Length of the comment to retrieve
  comment | - OUT: Retrieved comment

Returns
  Actual length of the comment

Exceptions

  H5::LocationException |

Description
  This function retrieves buf_size characters of the comment including the null terminator. Thus, if the actual length of the comment is more than buf_size-1, the retrieved comment will be truncated to accommodate the null terminator.

## ◆ getComment() [2/3]

std::string getComment | ( | const char * | name,
|  | size_t | buf_size = 0 ) const

Returns the comment as string for this location, returning its length.

Parameters

  name | - IN: Name of the object
  buf_size | - IN: Length of the comment to retrieve, default to 0

Returns
  Comment string

Exceptions

  H5::LocationException |

## ◆ getComment() [3/3]

std::string getComment | ( | const std::string & | name,
|  | size_t | buf_size = 0 ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ getFileName()

std::string getFileName | ( |  | ) | const

Gets the name of the file, in which an HDF5 object at this location belongs.

Returns
  File name

Exceptions

  H5::LocationException |

## ◆ getLinkInfo() [1/2]

H5L_info2_t getLinkInfo | ( | const char * | link_name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Returns the information of the named link.

Parameters

  link_name | - IN: Symbolic link to the object
  lapl | - IN: Link access property list

Returns
  Name of the object

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ getLinkInfo() [2/2]

H5L_info2_t getLinkInfo | ( | const std::string & | link_name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for link_name.

## ◆ getLinkval() [1/2]

std::string getLinkval | ( | const char * | name,
|  | size_t | size = 0 ) const

Returns the name of the object that the symbolic link points to.

Parameters

  name | - IN: Symbolic link to the object
  size | - IN: Maximum number of characters of value to be returned

Returns
  Name of the object

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ getLinkval() [2/2]

std::string getLinkval | ( | const std::string & | link_name,
|  | size_t | size = 0 ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ getNativeObjinfo() [1/5]

void getNativeObjinfo | ( | const char * | grp_name,
|  | H5_index_t | idx_type,
|  | H5_iter_order_t | order,
|  | hsize_t | idx,
|  | H5O_native_info_t & | objinfo,
|  | unsigned | fields = H5O_NATIVE_INFO_HDR,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Retrieves native information about an HDF5 object given its index.

Parameters

  grp_name | - IN: Group name where the object belongs - `char` *
  idx_type | - IN: Type of index
  order | - IN: Order to traverse
  idx | - IN: Object position
  objinfo | - OUT: Struct containing the native object info
  fields | - IN: Indicates the group of information to be retrieved default to H5O_INFO_HDR
  lapl | - IN: Link access property list

Description
  Valid values of fields are as follows:
  - `H5O_INFO_HDR` (default)
  - `H5O_INFO_META_SIZE`
  - `H5O_INFO_ALL`

## ◆ getNativeObjinfo() [2/5]

void getNativeObjinfo | ( | const char * | name,
|  | H5O_native_info_t & | objinfo,
|  | unsigned | fields = H5O_NATIVE_INFO_HDR,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Retrieves native information about an HDF5 object given its name.

Parameters

  name | - IN: Name of the object to be queried - `char` *
  objinfo | - OUT: Struct containing the native object info
  fields | - IN: Indicates the group of information to be retrieved default to H5O_INFO_HDR
  lapl | - IN: Link access property list

Description
  Valid values of fields are as follows:
  - `H5O_INFO_HDR` (default)
  - `H5O_INFO_META_SIZE`
  - `H5O_INFO_ALL`

## ◆ getNativeObjinfo() [3/5]

void getNativeObjinfo | ( | const std::string & | grp_name,
|  | H5_index_t | idx_type,
|  | H5_iter_order_t | order,
|  | hsize_t | idx,
|  | H5O_native_info_t & | objinfo,
|  | unsigned | fields = H5O_NATIVE_INFO_HDR,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for grp_name.

Parameters

  grp_name | - IN: Group name where the object belongs - `H5std_string`
  idx_type | - IN: Type of index
  order | - IN: Order to traverse
  idx | - IN: Object position
  objinfo | - OUT: Struct containing the native object info
  fields | - IN: Indicates the group of information to be retrieved default to H5O_INFO_HDR
  lapl | - IN: Link access property list

Description
  Valid values of fields are as follows:
  - `H5O_INFO_HDR` (default)
  - `H5O_INFO_META_SIZE`
  - `H5O_INFO_ALL`

## ◆ getNativeObjinfo() [4/5]

void getNativeObjinfo | ( | const std::string & | name,
|  | H5O_native_info_t & | objinfo,
|  | unsigned | fields = H5O_NATIVE_INFO_HDR,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for name.

Parameters

  name | - IN: Name of the object to be queried - `H5std_string`
  objinfo | - OUT: Struct containing the native object info
  fields | - IN: Indicates the group of information to be retrieved default to H5O_INFO_HDR
  lapl | - IN: Link access property list

## ◆ getNativeObjinfo() [5/5]

void getNativeObjinfo | ( | H5O_native_info_t & | objinfo,
|  | unsigned | fields = H5O_NATIVE_INFO_HDR ) const

Retrieves native information about an HDF5 object.

Parameters

  objinfo | - OUT: Struct containing the native object info
  fields | - IN: Indicates the group of information to be retrieved

Description
  Valid values of fields are as follows:
  - `H5O_INFO_HDR` (default)
  - `H5O_INFO_META_SIZE`
  - `H5O_INFO_ALL`

## ◆ getNumObjs()

hsize_t getNumObjs | ( |  | ) | const

Deprecated - moved to H5::Group in 1.10.2.

Returns
  Deprecated

Exceptions

  Deprecated |

## ◆ getObjinfo() [1/9]

void getObjinfo | ( | const char * | grp_name,
|  | H5_index_t | idx_type,
|  | H5_iter_order_t | order,
|  | hsize_t | idx,
|  | H5O_info2_t & | objinfo,
|  | unsigned | fields = H5O_INFO_BASIC,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Retrieves information about an HDF5 object given its index.

Parameters

  grp_name | - IN: Group name where the object belongs - `char` *
  idx_type | - IN: Type of index
  order | - IN: Order to traverse
  idx | - IN: Object position
  objinfo | - OUT: Struct containing the object info
  fields | - IN: Indicates the group of information to be retrieved default to H5O_INFO_BASIC
  lapl | - IN: Link access property list

Description
  Valid values of fields are as follows:
  - `H5O_INFO_BASIC` (default)
  - `H5O_INFO_TIME`
  - `H5O_INFO_NUM_ATTRS`
  - `H5O_INFO_HDR`
  - `H5O_INFO_META_SIZE`
  - `H5O_INFO_ALL`

## ◆ getObjinfo() [2/9]

void getObjinfo | ( | const char * | name,
|  | bool | follow_link,
|  | H5G_stat_t & | statbuf ) const

Returns information about an object.

Parameters

  name | - IN: Name of the object
  follow_link | - IN: Link flag
  statbuf | - OUT: Buffer to return information about the object

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

Description
  For information, please refer to the H5Gget_objinfo API in the HDF5 C Reference Manual.

## ◆ getObjinfo() [3/9]

void getObjinfo | ( | const char * | name,
|  | H5G_stat_t & | statbuf ) const

This is an overloaded member function, provided for convenience. It differs from the above functions in that it doesn't have the parameter follow_link.

## ◆ getObjinfo() [4/9]

void getObjinfo | ( | const char * | name,
|  | H5O_info2_t & | objinfo,
|  | unsigned | fields = H5O_INFO_BASIC,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Retrieves information about an HDF5 object given its name.

Parameters

  name | - IN: Name of the object to be queried - `char` *
  objinfo | - OUT: Struct containing the object info
  fields | - IN: Indicates the group of information to be retrieved default to H5O_INFO_BASIC
  lapl | - IN: Link access property list

Description
  Valid values of fields are as follows:
  - `H5O_INFO_BASIC` (default)
  - `H5O_INFO_TIME`
  - `H5O_INFO_NUM_ATTRS`
  - `H5O_INFO_HDR`
  - `H5O_INFO_META_SIZE`
  - `H5O_INFO_ALL`

## ◆ getObjinfo() [5/9]

void getObjinfo | ( | const std::string & | grp_name,
|  | H5_index_t | idx_type,
|  | H5_iter_order_t | order,
|  | hsize_t | idx,
|  | H5O_info2_t & | objinfo,
|  | unsigned | fields = H5O_INFO_BASIC,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for name.

Parameters

  grp_name | - IN: Group name where the object belongs - `H5std_string`
  idx_type | - IN: Type of index
  order | - IN: Order to traverse
  idx | - IN: Object position
  objinfo | - OUT: Struct containing the object info
  fields | - IN: Indicates a group of information to be retrieved default to H5O_INFO_BASIC
  lapl | - IN: Link access property list

## ◆ getObjinfo() [6/9]

void getObjinfo | ( | const std::string & | name,
|  | bool | follow_link,
|  | H5G_stat_t & | statbuf ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ getObjinfo() [7/9]

void getObjinfo | ( | const std::string & | name,
|  | H5G_stat_t & | statbuf ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ getObjinfo() [8/9]

void getObjinfo | ( | const std::string & | name,
|  | H5O_info2_t & | objinfo,
|  | unsigned | fields = H5O_INFO_BASIC,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an `H5std_string` for name.

Parameters

  name | - IN: Name of the object to be queried - `H5std_string`
  objinfo | - OUT: Struct containing the object info
  fields | - IN: Indicates the group of information to be retrieved default to H5O_INFO_BASIC
  lapl | - IN: Link access property list

## ◆ getObjinfo() [9/9]

void getObjinfo | ( | H5O_info2_t & | objinfo,
|  | unsigned | fields = H5O_INFO_BASIC ) const

Retrieves information about an HDF5 object.

Parameters

  objinfo | - OUT: Struct containing the object info
  fields | - IN: Indicates the group of information to be retrieved

Description
  Valid values of fields are as follows:
  - `H5O_INFO_BASIC` (default)
  - `H5O_INFO_TIME`
  - `H5O_INFO_NUM_ATTRS`
  - `H5O_INFO_HDR`
  - `H5O_INFO_META_SIZE`
  - `H5O_INFO_ALL`

## ◆ getObjnameByIdx() [1/3]

std::string getObjnameByIdx | ( | hsize_t | idx | ) | const

Returns the name of an object in this group, given the object's index.

Parameters

  idx | - IN: Transient index of the object

Returns
  Object name

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

Description
  The value of idx can be any nonnegative number less than the total number of objects in the group, which is returned by the function `H5Location::getNumObjs`. Note that this is a transient index; thus, an object may have a different index each time the group is opened.

## ◆ getObjnameByIdx() [2/3]

ssize_t getObjnameByIdx | ( | hsize_t | idx,
|  | char * | name,
|  | size_t | size ) const

Retrieves the name of an object in this group, given the object's index.

Parameters

  idx | - IN: Transient index of the object
  name | - IN/OUT: Retrieved name of the object
  size | - IN: Length to retrieve

Returns
  Actual size of the object name or 0, if object has no name

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

Description
  The value of idx can be any nonnegative number less than the total number of objects in the group, which is returned by the function `H5Location::getNumObjs`. Note that this is a transient index; thus, an object may have a different index each time the group is opened.

## ◆ getObjnameByIdx() [3/3]

ssize_t getObjnameByIdx | ( | hsize_t | idx,
|  | std::string & | name,
|  | size_t | size ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ getObjType()

H5G_obj_t getObjType | ( | void * | ref,
|  | H5R_type_t | ref_type = H5R_OBJECT ) const

Retrieves the type of object that an object reference points to.

Parameters

  ref_type | - IN: Type of reference to query, valid values are: `H5R_OBJECT` - Reference is an object reference. `H5R_DATASET_REGION` - Reference is a dataset region reference.
  ref | - IN: Reference to query

Returns
  An object type, which can be one of the following:
  - `H5G_UNKNOWN` - A failure occurs. (-1)
  - `H5G_GROUP` - Object is a group.
  - `H5G_DATASET` - Object is a dataset.
  - `H5G_TYPE` Object - is a named datatype
  - `H5G_LINK` - Object is a symbolic link.
  - `H5G_UDLINK` - Object is a user-defined link.

Exceptions

  H5::ReferenceException |

## ◆ getObjTypeByIdx() [1/3]

H5G_obj_t getObjTypeByIdx | ( | hsize_t | idx | ) | const

Returns the type of an object in this group, given the object's index. (Deprecated).

Parameters

  idx | - IN: Transient index of the object

Returns
  Object type

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ getObjTypeByIdx() [2/3]

H5G_obj_t getObjTypeByIdx | ( | hsize_t | idx,
|  | char * | type_name ) const

This is an overloaded member function, provided for convenience. It differs from the above function because it also provides the returned object type in text (char*) (Deprecated).

Parameters

  idx | - IN: Transient index of the object
  type_name | - OUT: Object type in text

Returns
  Object type

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ getObjTypeByIdx() [3/3]

H5G_obj_t getObjTypeByIdx | ( | hsize_t | idx,
|  | std::string & | type_name ) const

This is an overloaded member function, provided for convenience. It differs from the above function because it also provides the returned object type in text (H5std_string&) (Deprecated).

Parameters

  idx | - IN: Transient index of the object
  type_name | - OUT: Object type in text

Returns
  Object type

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ getRefObjType()

H5O_type_t getRefObjType | ( | void * | ref,
|  | H5R_type_t | ref_type = H5R_OBJECT ) const

Retrieves the type of object that an object reference points to.

Parameters

  ref | - IN: Reference to query
  ref_type | - IN: Type of reference to query, valid values are: `H5R_OBJECT` - Reference is an object reference. `H5R_DATASET_REGION` - Reference is a dataset region reference.

Returns
  An object type, which can be one of the following:
  - `H5O_TYPE_UNKNOWN` - Unknown object type (-1)
  - `H5O_TYPE_GROUP` - Object is a group
  - `H5O_TYPE_DATASET` - Object is a dataset
  - `H5O_TYPE_NAMED_DATATYPE` - Object is a named datatype
  - `H5O_TYPE_NTYPES` - Number of different object types

Exceptions

  H5::ReferenceException |

## ◆ getRegion()

DataSpace getRegion | ( | void * | ref,
|  | H5R_type_t | ref_type = H5R_DATASET_REGION ) const

Retrieves a dataspace with the region pointed to selected.

Parameters

  ref | - IN: Reference to get region of
  ref_type | - IN: Type of reference to get region of - default

Returns
  DataSpace object

Exceptions

  H5::ReferenceException |

## ◆ iterateElems() [1/2]

int iterateElems | ( | const char * | name,
|  | int * | idx,
|  | H5G_iterate_t | op,
|  | void * | op_data )

Iterates a user's function over the entries of a group.

Parameters

  name | - IN : Name of group to iterate over
  idx | - IN/OUT: Starting (IN) and ending (OUT) entry indices
  op | - IN : User's function to operate on each entry
  op_data | - IN/OUT: Data associated with the operation

Returns
  The return value of the first operator that returns non-zero, or zero if all members were processed with no operator returning non-zero.

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ iterateElems() [2/2]

int iterateElems | ( | const std::string & | name,
|  | int * | idx,
|  | H5G_iterate_t | op,
|  | void * | op_data )

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ link() [1/8]

void link | ( | const char * | curr_name,
|  | const Group & | new_loc,
|  | const char * | new_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Creates a hard link from new_name to curr_name.

Parameters

  curr_name | - IN: Name of the existing object
  new_loc | - IN: New group or root group
  new_name | - IN: New name for the object
  lcpl | - IN: Link creation plist - default to LinkCreatPropList::DEFAULT
  lapl | - IN: Link access plist - default to LinkAccPropList::DEFAULT

Exceptions

  H5::FileIException | or H5::GroupIException

Description
  Note that both names are interpreted relative to the specified location. For information on creating a hard link, please refer to the H5Lcreate_hard APIs in the HDF5 C Reference Manual.

## ◆ link() [2/8]

void link | ( | const char * | curr_name,
|  | const hid_t | same_loc,
|  | const char * | new_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Creates a hard link from new_name to curr_name - can be used to pass in H5L_SAME_LOC.

Parameters

  curr_name | - IN: Name of the existing object
  same_loc | - IN: Group or root group ID, or H5L_SAME_LOC
  new_name | - IN: New name for the link
  lcpl | - IN: Link creation plist - default to LinkCreatPropList::DEFAULT
  lapl | - IN: Link access plist - default to LinkAccPropList::DEFAULT

Exceptions

  H5::FileIException | or H5::GroupIException

Description
  Note that both names are interpreted relative to the specified location. For information on creating a hard link, please refer to the H5Lcreate_hard APIs in the HDF5 C Reference Manual.

## ◆ link() [3/8]

void link | ( | const char * | target_name,
|  | const char * | link_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Creates a soft link from link_name to target_name.

Parameters

  target_name | - IN: Name of object, can be a non-existing object
  link_name | - IN: Link name for the target name
  lcpl | - IN: Link creation plist - default to LinkCreatPropList::DEFAULT
  lapl | - IN: Link access plist - default to LinkAccPropList::DEFAULT

Exceptions

  H5::FileIException | or H5::GroupIException

Description
  Note that both names are interpreted relative to the current location. For information on creating a soft link, please refer to the H5Lcreate_soft APIs in the HDF5 C Reference Manual.

## ◆ link() [4/8]

void link | ( | const std::string & | curr_name,
|  | const Group & | new_loc,
|  | const std::string & | new_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for curr_name and new_name.

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ link() [5/8]

void link | ( | const std::string & | curr_name,
|  | const hid_t | same_loc,
|  | const std::string & | new_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for curr_name and new_name.

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ link() [6/8]

void link | ( | const std::string & | target_name,
|  | const std::string & | link_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for target_name and link_name.

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ link() [7/8]

void link | ( | H5L_type_t | link_type,
|  | const char * | curr_name,
|  | const char * | new_name ) const

Creates a link of the specified type from new_name to curr_name.

Parameters

  link_type | - IN: Link type; possible values are `H5G_LINK_HARD` `H5G_LINK_SOFT`
  curr_name | - IN: Name of the existing object if link is a hard link; can be anything for the soft link
  new_name | - IN: New name for the object

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

Description
  Note that both names are interpreted relative to the specified location. For information on creating hard link and soft link, please refer to the H5Lcreate_hard and H5Lcreate_soft APIs in the HDF5 C Reference Manual.

## ◆ link() [8/8]

void link | ( | H5L_type_t | link_type,
|  | const std::string & | curr_name,
|  | const std::string & | new_name ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for curr_name and new_name.

## ◆ mount() [1/2]

void mount | ( | const char * | name,
|  | const H5File & | child,
|  | const PropList & | plist ) const

Mounts the file child onto this group.

Parameters

  name | - IN: Name of the group
  child | - IN: File to mount
  plist | - IN: Property list to use

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ mount() [2/2]

void mount | ( | const std::string & | name,
|  | const H5File & | child,
|  | const PropList & | plist ) const

This is an overloaded member function, provided for convenience. It takes an `H5std_string` for name.

## ◆ move() [1/2]

void move | ( | const char * | src,
|  | const char * | dst ) const

Renames an object at this location. - Deprecated in favor of moveLink().

Parameters

  src | - IN: Object's original name
  dst | - IN: Object's new name

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

Note
  Exercise care in moving groups as it is possible to render data in a file inaccessible with H5Location::move. Please refer to the Group Interface in the HDF5 User's Guide for details.

## ◆ move() [2/2]

void move | ( | const std::string & | src,
|  | const std::string & | dst ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src and dst. - Deprecated in favor of moveLink().

## ◆ moveLink() [1/4]

void moveLink | ( | const char * | src_name,
|  | const char * | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Renames a link in this group.

Parameters

  src_name | - IN: Original name
  dst_name | - IN: New name
  lcpl | - IN: Link creation plist - default LinkCreatPropList::DEFAULT
  lapl | - IN: Link access plist - default LinkAccPropList::DEFAULT

Exceptions

  H5::FileIException | or H5::GroupIException

Note
  Exercise care in moving groups as it is possible to render data in a file inaccessible with H5Location::moveLink. Please refer to the Group Interface in the HDF5 User's Guide for details.

## ◆ moveLink() [2/4]

void moveLink | ( | const char * | src_name,
|  | const Group & | dst,
|  | const char * | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Renames a link in this group and moves it to a new location.

Parameters

  src_name | - IN: Original name
  dst | - IN: Destination location
  dst_name | - IN: New name
  lcpl | - IN: Link creation plist - default LinkCreatPropList::DEFAULT
  lapl | - IN: Link access plist - default LinkAccPropList::DEFAULT

Exceptions

  H5::FileIException | or H5::GroupIException

Note
  Exercise care in moving groups as it is possible to render data in a file inaccessible with H5Location::moveLink. Please refer to the Group Interface in the HDF5 User's Guide for details.

## ◆ moveLink() [3/4]

void moveLink | ( | const std::string & | src_name,
|  | const Group & | dst,
|  | const std::string & | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ moveLink() [4/4]

void moveLink | ( | const std::string & | src_name,
|  | const std::string & | dst_name,
|  | const LinkCreatPropList & | lcpl = LinkCreatPropList::DEFAULT,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for src_name and dst_name.

Exceptions

  H5::FileIException | or H5::GroupIException

## ◆ nameExists() [1/2]

bool nameExists | ( | const char * | name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Checks if a link of a given name exists in a location.

Parameters

  name | - IN: Searched name
  lapl | - IN: Link access property list

Exceptions

  H5::LocationException |

## ◆ nameExists() [2/2]

bool nameExists | ( | const std::string & | name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Checks if a link of a given name exists in a location.

Parameters

  name | - IN: Searched name
  lapl | - IN: Link access property list

Exceptions

  H5::LocationException |

## ◆ openDataSet() [1/2]

DataSet openDataSet | ( | const char * | name,
|  | const DSetAccPropList & | dapl = DSetAccPropList::DEFAULT ) const

Opens an existing dataset at this location.

Parameters

  name | - IN: Name of the dataset to open
  dapl | - IN: Dataset access property list

Returns
  DataSet instance

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ openDataSet() [2/2]

DataSet openDataSet | ( | const std::string & | name,
|  | const DSetAccPropList & | dapl = DSetAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ openGroup() [1/2]

Group openGroup | ( | const char * | name | ) | const

Opens an existing group in a location which can be a file or another group.

Parameters

  name | - IN: Name of the group to open

Returns
  Group instance

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ openGroup() [2/2]

Group openGroup | ( | const std::string & | name | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ p_dereference()

hid_t p_dereference | ( | hid_t | loc_id,
|  | const void * | ref,
|  | H5R_type_t | ref_type,
|  | const PropList & | plist,
|  | const char * | from_func )
| protected

## ◆ p_get_obj_type()

H5G_obj_t p_get_obj_type | ( | void * | ref,
|  | H5R_type_t | ref_type ) const
| protected

## ◆ p_get_ref_obj_type()

H5O_type_t p_get_ref_obj_type | ( | void * | ref,
|  | H5R_type_t | ref_type ) const
| protected

## ◆ p_reference()

void p_reference | ( | void * | ref,
|  | const char * | name,
|  | hid_t | space_id,
|  | H5R_type_t | ref_type ) const
| protected

## ◆ reference() [1/4]

void reference | ( | void * | ref,
|  | const char * | name,
|  | const DataSpace & | dataspace,
|  | H5R_type_t | ref_type = H5R_DATASET_REGION ) const

Creates a reference to an HDF5 object or a dataset region.

Parameters

  ref | - IN: Reference pointer
  name | - IN: Name of the object to be referenced
  dataspace | - IN: Dataspace with selection
  ref_type | - IN: Type of reference to query, valid values are: `H5R_OBJECT` - Reference is an object reference. `H5R_DATASET_REGION` - Reference is a dataset region reference. (default)

Exceptions

  H5::ReferenceException |

Note
  This method is more suitable for a dataset region reference.

## ◆ reference() [2/4]

void reference | ( | void * | ref,
|  | const char * | name,
|  | H5R_type_t | ref_type = H5R_OBJECT ) const

This is an overloaded function, provided for your convenience. It differs from the above function in that it does not take a DataSpace object and the reference type must be specified.

Parameters

  ref | - IN: Reference pointer
  name | - IN: Name of the object to be referenced
  ref_type | - IN: Type of reference to query, valid values are: `H5R_OBJECT` - Reference is an object reference (default) `H5R_DATASET_REGION` - Reference is a dataset region

Exceptions

  H5::ReferenceException |

Note
  This method is more suitable for an object reference.

## ◆ reference() [3/4]

void reference | ( | void * | ref,
|  | const std::string & | name,
|  | const DataSpace & | dataspace,
|  | H5R_type_t | ref_type = H5R_DATASET_REGION ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

Parameters

  ref | - IN: Reference pointer
  name | - IN: Name of the object to be referenced
  dataspace | - IN: Dataspace with selection
  ref_type | - IN: Type of reference to query, valid values are: `H5R_OBJECT` - Reference is an object reference. `H5R_DATASET_REGION` - Reference is a dataset region reference. (default)

Exceptions

  H5::ReferenceException |

Note
  This method is more suitable for a dataset region reference.

## ◆ reference() [4/4]

void reference | ( | void * | ref,
|  | const std::string & | name,
|  | H5R_type_t | ref_type = H5R_OBJECT ) const

This is an overloaded function, provided for your convenience. It differs from the above function in that it takes an `H5std_string` for the object's name.

Parameters

  ref | - IN: Reference pointer
  name | - IN: Name of the object to be referenced - `H5std_string`
  ref_type | - IN: Type of reference to query, valid values are: `H5R_OBJECT` - Reference is an object reference (default) `H5R_DATASET_REGION` - Reference is a dataset region

Note
  This method is more suitable for an object reference.

## ◆ removeComment() [1/2]

void removeComment | ( | const char * | name | ) | const

Removes the comment from an object specified by its name.

Parameters

  name | - IN: Name of the object

Exceptions

  H5::LocationException |

## ◆ removeComment() [2/2]

void removeComment | ( | const std::string & | name | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ setComment() [1/4]

void setComment | ( | const char * | comment | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function in that it doesn't take an object name.

## ◆ setComment() [2/4]

void setComment | ( | const char * | name,
|  | const char * | comment ) const

Sets or resets the comment for an object specified by its name.

Parameters

  name | - IN: Name of the object
  comment | - IN: New comment

Exceptions

  H5::LocationException |

Description
  If comment is an empty string or a null pointer, the comment message is removed from the object. Comments should be relatively short, null-terminated, ASCII strings. They can be attached to any object that has an object header, e.g., data sets, groups, named data types, and data spaces, but not symbolic links.

## ◆ setComment() [3/4]

void setComment | ( | const std::string & | comment | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for comment.

## ◆ setComment() [4/4]

void setComment | ( | const std::string & | name,
|  | const std::string & | comment ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name and comment.

## ◆ throwException()

void throwException | ( | const std::string & | func_name,
|  | const std::string & | msg ) const
| virtual

For subclasses, H5File and Group, to throw appropriate exception.

Invokes subclass' throwException.

Parameters

  func_name | - Name of the function where failure occurs
  msg | - Message describing the failure

Exceptions

  H5::GroupIException |

Reimplemented in Group, and H5File.

## ◆ unlink() [1/2]

void unlink | ( | const char * | name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

Removes the specified link from this group.

Parameters

  name | - IN: Name of the object to be removed
  lapl | - IN: Link access property list

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ unlink() [2/2]

void unlink | ( | const std::string & | link_name,
|  | const LinkAccPropList & | lapl = LinkAccPropList::DEFAULT ) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

## ◆ unmount() [1/2]

void unmount | ( | const char * | name | ) | const

Unmounts the specified file.

Parameters

  name | - IN: Name of the file to unmount

Exceptions

  H5::FileIException/H5::GroupIException/H5::LocationException |

## ◆ unmount() [2/2]

void unmount | ( | const std::string & | name | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an `H5std_string` for name.

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

- c++/src/H5Location.h
- c++/src/H5Location.cpp