HighFive 2.10.0
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
HighFive::NodeTraits< Derivate > Class Template Reference

NodeTraits: Base class for Group and File. More...

#include <H5Node_traits.hpp>

Public Member Functions

DataSet createDataSet (const std::string &dataset_name, const DataSpace &space, const DataType &type, const DataSetCreateProps &createProps=DataSetCreateProps::Default(), const DataSetAccessProps &accessProps=DataSetAccessProps::Default(), bool parents=true)
 createDataSet Create a new dataset in the current file of datatype type and of size space
 
template<typename T >
DataSet createDataSet (const std::string &dataset_name, const DataSpace &space, const DataSetCreateProps &createProps=DataSetCreateProps::Default(), const DataSetAccessProps &accessProps=DataSetAccessProps::Default(), bool parents=true)
 createDataSet create a new dataset in the current file with a size specified by space
 
template<typename T >
DataSet createDataSet (const std::string &dataset_name, const T &data, const DataSetCreateProps &createProps=DataSetCreateProps::Default(), const DataSetAccessProps &accessProps=DataSetAccessProps::Default(), bool parents=true)
 createDataSet create a new dataset in the current file and write to it, inferring the DataSpace from the data.
 
template<std::size_t N>
DataSet createDataSet (const std::string &dataset_name, const deprecated::FixedLenStringArray< N > &data, const DataSetCreateProps &createProps=DataSetCreateProps::Default(), const DataSetAccessProps &accessProps=DataSetAccessProps::Default(), bool parents=true)
 
DataSet getDataSet (const std::string &dataset_name, const DataSetAccessProps &accessProps=DataSetAccessProps::Default()) const
 get an existing dataset in the current file
 
Group createGroup (const std::string &group_name, bool parents=true)
 create a new group, and eventually intermediate groups
 
Group createGroup (const std::string &group_name, const GroupCreateProps &createProps, bool parents=true)
 create a new group, and eventually intermediate groups
 
Group getGroup (const std::string &group_name) const
 open an existing group with the name group_name
 
DataType getDataType (const std::string &type_name, const DataTypeAccessProps &accessProps=DataTypeAccessProps::Default()) const
 open a commited datatype with the name type_name
 
size_t getNumberObjects () const
 return the number of leaf objects of the node / group
 
std::string getObjectName (size_t index) const
 return the name of the object with the given index
 
bool rename (const std::string &src_path, const std::string &dest_path, bool parents=true) const
 moves an object and its content within an HDF5 file.
 
std::vector< std::string > listObjectNames (IndexType idx_type=IndexType::NAME) const
 list all leaf objects name of the node / group
 
bool exist (const std::string &node_name) const
 check a dataset or group exists in the current node / group
 
void unlink (const std::string &node_name) const
 unlink the given dataset or group
 
LinkType getLinkType (const std::string &node_name) const
 Returns the kind of link of the given name (soft, hard...)
 
ObjectType getObjectType (const std::string &node_name) const
 A shorthand to get the kind of object pointed to (group, dataset, type...)
 
template<typename T , typename = decltype(&T::getPath)>
void createSoftLink (const std::string &linkName, const T &obj)
 A shorthand to create softlink to any object which provides getPath The link will be created with default properties along with required parent groups.
 
void createSoftLink (const std::string &link_name, const std::string &obj_path, LinkCreateProps linkCreateProps=LinkCreateProps(), const LinkAccessProps &linkAccessProps=LinkAccessProps(), const bool parents=true)
 Creates softlinks.
 
void createExternalLink (const std::string &link_name, const std::string &h5_file, const std::string &obj_path, LinkCreateProps linkCreateProps=LinkCreateProps(), const LinkAccessProps &linkAccessProps=LinkAccessProps(), const bool parents=true)
 
template<typename T , typename = decltype(&T::getPath)>
void createHardLink (const std::string &link_name, const T &target_obj, LinkCreateProps linkCreateProps=LinkCreateProps(), const LinkAccessProps &linkAccessProps=LinkAccessProps(), const bool parents=true)
 Creates hardlinks.
 

Detailed Description

template<typename Derivate>
class HighFive::NodeTraits< Derivate >

NodeTraits: Base class for Group and File.

Member Function Documentation

◆ createDataSet() [1/4]

template<typename Derivate >
template<typename T >
DataSet HighFive::NodeTraits< Derivate >::createDataSet ( const std::string & dataset_name,
const DataSpace & space,
const DataSetCreateProps & createProps = DataSetCreateProps::Default(),
const DataSetAccessProps & accessProps = DataSetAccessProps::Default(),
bool parents = true )
inline

createDataSet create a new dataset in the current file with a size specified by space

Parameters
dataset_nameidentifier of the dataset
spaceAssociated DataSpace, see DataSpace for more information
createPropsA property list with data set creation properties
accessPropsA property list with data set access properties
parentsCreate intermediate groups if needed. Default: true.
Returns
DataSet Object

◆ createDataSet() [2/4]

template<typename Derivate >
DataSet HighFive::NodeTraits< Derivate >::createDataSet ( const std::string & dataset_name,
const DataSpace & space,
const DataType & type,
const DataSetCreateProps & createProps = DataSetCreateProps::Default(),
const DataSetAccessProps & accessProps = DataSetAccessProps::Default(),
bool parents = true )
inline

createDataSet Create a new dataset in the current file of datatype type and of size space

Parameters
dataset_nameidentifier of the dataset
spaceAssociated DataSpace, see DataSpace for more information
typeType of Data
createPropsA property list with data set creation properties
accessPropsA property list with data set access properties
parentsCreate intermediate groups if needed. Default: true.
Returns
DataSet Object

◆ createDataSet() [3/4]

template<typename Derivate >
template<std::size_t N>
DataSet HighFive::NodeTraits< Derivate >::createDataSet ( const std::string & dataset_name,
const deprecated::FixedLenStringArray< N > & data,
const DataSetCreateProps & createProps = DataSetCreateProps::Default(),
const DataSetAccessProps & accessProps = DataSetAccessProps::Default(),
bool parents = true )
inline

◆ createDataSet() [4/4]

template<typename Derivate >
template<typename T >
DataSet HighFive::NodeTraits< Derivate >::createDataSet ( const std::string & dataset_name,
const T & data,
const DataSetCreateProps & createProps = DataSetCreateProps::Default(),
const DataSetAccessProps & accessProps = DataSetAccessProps::Default(),
bool parents = true )
inline

createDataSet create a new dataset in the current file and write to it, inferring the DataSpace from the data.

Parameters
dataset_nameidentifier of the dataset
dataAssociated data, must support DataSpace::From, see DataSpace for more information
createPropsA property list with data set creation properties
accessPropsA property list with data set access properties
parentsCreate intermediate groups if needed. Default: true.
Returns
DataSet Object

◆ createExternalLink()

template<typename Derivate >
void HighFive::NodeTraits< Derivate >::createExternalLink ( const std::string & link_name,
const std::string & h5_file,
const std::string & obj_path,
LinkCreateProps linkCreateProps = LinkCreateProps(),
const LinkAccessProps & linkAccessProps = LinkAccessProps(),
const bool parents = true )
inline

◆ createGroup() [1/2]

template<typename Derivate >
Group HighFive::NodeTraits< Derivate >::createGroup ( const std::string & group_name,
bool parents = true )
inline

create a new group, and eventually intermediate groups

Parameters
group_name
parentsCreate intermediate groups if needed. Default: true.
Returns
the group object

◆ createGroup() [2/2]

template<typename Derivate >
Group HighFive::NodeTraits< Derivate >::createGroup ( const std::string & group_name,
const GroupCreateProps & createProps,
bool parents = true )
inline

create a new group, and eventually intermediate groups

Parameters
group_name
createPropsA property list with group creation properties
parentsCreate intermediate groups if needed. Default: true.
Returns
the group object

◆ createHardLink()

template<typename Derivate >
template<typename T , typename >
void HighFive::NodeTraits< Derivate >::createHardLink ( const std::string & link_name,
const T & target_obj,
LinkCreateProps linkCreateProps = LinkCreateProps(),
const LinkAccessProps & linkAccessProps = LinkAccessProps(),
const bool parents = true )
inline

Creates hardlinks.

Parameters
link_nameThe name of the link
target_objThe target object
linkCreatePropsA Link_Create property list. Notice "parents=true" overrides
linkAccessPropsThe Link_Access property list
parentsWhether parent groups should be created: Default: true

◆ createSoftLink() [1/2]

template<typename Derivate >
void HighFive::NodeTraits< Derivate >::createSoftLink ( const std::string & link_name,
const std::string & obj_path,
LinkCreateProps linkCreateProps = LinkCreateProps(),
const LinkAccessProps & linkAccessProps = LinkAccessProps(),
const bool parents = true )
inline

Creates softlinks.

Parameters
link_nameThe name of the link
obj_pathThe target object path
linkCreatePropsA Link_Create property list. Notice "parents=true" overrides
linkAccessPropsThe Link_Access property list
parentsWhether parent groups should be created: Default: true

◆ createSoftLink() [2/2]

template<typename Derivate >
template<typename T , typename = decltype(&T::getPath)>
void HighFive::NodeTraits< Derivate >::createSoftLink ( const std::string & linkName,
const T & obj )
inline

A shorthand to create softlink to any object which provides getPath The link will be created with default properties along with required parent groups.

◆ exist()

template<typename Derivate >
bool HighFive::NodeTraits< Derivate >::exist ( const std::string & node_name) const
inline

check a dataset or group exists in the current node / group

Parameters
node_namedataset/group name to check
Returns
true if a dataset/group with the associated name exists, or false

◆ getDataSet()

template<typename Derivate >
DataSet HighFive::NodeTraits< Derivate >::getDataSet ( const std::string & dataset_name,
const DataSetAccessProps & accessProps = DataSetAccessProps::Default() ) const
inline

get an existing dataset in the current file

Parameters
dataset_name
accessPropsproperty list to configure dataset chunk cache
Returns
return the named dataset, or throw exception if not found

◆ getDataType()

template<typename Derivate >
DataType HighFive::NodeTraits< Derivate >::getDataType ( const std::string & type_name,
const DataTypeAccessProps & accessProps = DataTypeAccessProps::Default() ) const
inline

open a commited datatype with the name type_name

Parameters
type_name
Returns
the datatype object

◆ getGroup()

template<typename Derivate >
Group HighFive::NodeTraits< Derivate >::getGroup ( const std::string & group_name) const
inline

open an existing group with the name group_name

Parameters
group_name
Returns
the group object

◆ getLinkType()

template<typename Derivate >
LinkType HighFive::NodeTraits< Derivate >::getLinkType ( const std::string & node_name) const
inline

Returns the kind of link of the given name (soft, hard...)

Parameters
node_nameThe entry to check, path relative to the current group

◆ getNumberObjects()

template<typename Derivate >
size_t HighFive::NodeTraits< Derivate >::getNumberObjects ( ) const
inline

return the number of leaf objects of the node / group

Returns
number of leaf objects

◆ getObjectName()

template<typename Derivate >
std::string HighFive::NodeTraits< Derivate >::getObjectName ( size_t index) const
inline

return the name of the object with the given index

Returns
the name of the object

◆ getObjectType()

template<typename Derivate >
ObjectType HighFive::NodeTraits< Derivate >::getObjectType ( const std::string & node_name) const
inline

A shorthand to get the kind of object pointed to (group, dataset, type...)

Parameters
node_nameThe entry to check, path relative to the current group

◆ listObjectNames()

template<typename Derivate >
std::vector< std::string > HighFive::NodeTraits< Derivate >::listObjectNames ( IndexType idx_type = IndexType::NAME) const
inline

list all leaf objects name of the node / group

Parameters
idx_typetell if the list should be ordered by Name or CreationOrderTime. CreationOrderTime can be use only if the file/group has been created with the HighFive::LinkCreationTime property.
Returns
number of leaf objects

◆ rename()

template<typename Derivate >
bool HighFive::NodeTraits< Derivate >::rename ( const std::string & src_path,
const std::string & dest_path,
bool parents = true ) const
inline

moves an object and its content within an HDF5 file.

Parameters
src_pathrelative path of the object to current File/Group
dest_pathnew relative path of the object to current File/Group
parentsCreate intermediate groups if needed. Default: true.
Returns
boolean that is true if the move was successful

◆ unlink()

template<typename Derivate >
void HighFive::NodeTraits< Derivate >::unlink ( const std::string & node_name) const
inline

unlink the given dataset or group

Parameters
node_namedataset/group name to unlink

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