h5cpp  0.5.2
A modern C++ wrapper for the HDF5 C library
hdf5::node::Link Class Reference

an HDF5 link More...

#include <link.hpp>

Public Member Functions

 Link (const file::File &file, const Path &parent_path, const std::string &link_name)
 Construct a new Link object. More...
 
 Link ()=default
 default constructor More...
 
Path path () const
 get path of the link More...
 
LinkTarget target (const property::LinkAccessList &lapl=property::LinkAccessList()) const
 path to reference object More...
 
LinkType type (const property::LinkAccessList &lapl=property::LinkAccessList()) const
 get type of link More...
 
Group parent () const
 get reference to parent group More...
 
const file::Filefile () const
 
Node operator* () const
 get the node that the link references More...
 
bool exists () const
 returns true if the given link exists More...
 
bool is_resolvable () const
 returns true if the object reference by the link exists More...
 

Friends

bool operator== (const Link &lhs, const Link &rhs)
 equality operator for links More...
 

Detailed Description

Class representing a link to an object within an HDF5 file. In order to store links in a container they have to be default constructable. A default constructed link has the type LinkType::Error. Instead of a node type only the handle to the parent is stored. Thus, the parent can also be a File which would identify the link as the link to the root group.

Constructor & Destructor Documentation

◆ Link() [1/2]

hdf5::node::Link::Link ( const file::File file,
const Path parent_path,
const std::string &  link_name 
)
Parameters
filereference to the file object the link is locate in
parent_pathpath to the parent group for the link
link_namethe name of the link

◆ Link() [2/2]

hdf5::node::Link::Link ( )
default

Leaves a link of type LinkType::Error.

Member Function Documentation

◆ exists()

bool hdf5::node::Link::exists ( ) const

◆ file()

const file::File& hdf5::node::Link::file ( ) const

◆ is_resolvable()

bool hdf5::node::Link::is_resolvable ( ) const

◆ operator*()

Node hdf5::node::Link::operator* ( ) const

Return an instance to the node referenced by this particular link.

Precondition
all intermediate links exist and the final link must be resolvable.

◆ parent()

Group hdf5::node::Link::parent ( ) const

Return a const reference to the parent group of the link.

◆ path()

Path hdf5::node::Link::path ( ) const

Return the actual path of the link in the file. This is basically the path of the parent group with the name of the link as a top element.

◆ target()

LinkTarget hdf5::node::Link::target ( const property::LinkAccessList lapl = property::LinkAccessList()) const

Return the path to the object which is reference by this link.

◆ type()

LinkType hdf5::node::Link::type ( const property::LinkAccessList lapl = property::LinkAccessList()) const

Friends And Related Function Documentation

◆ operator==

bool operator== ( const Link lhs,
const Link rhs 
)
friend

Two links are considered equal under the following conditions

  • they both share the same parent file
  • their parent paths are equal
  • their names are equal
Parameters
lhsleft hanside of the operator
rhsright handside of the operator
Returns
true if the links are equal, false otherwise

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