h5gt 0.2.0
C++ wrapper for HDF5 library (based on HighFive project)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
h5gt::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 LinkCreateProps &linkCreateProps=LinkCreateProps(), const DataSetCreateProps &dsetCreateProps=DataSetCreateProps(), const DataSetAccessProps &dsetAccessProps=DataSetAccessProps())
 createDataSet Create a new dataset in the current file of datatype type and of size space
 
template<typename Type >
DataSet createDataSet (const std::string &dataset_name, const DataSpace &space, const LinkCreateProps &linkCreateProps=LinkCreateProps(), const DataSetCreateProps &dsetCreateProps=DataSetCreateProps(), const DataSetAccessProps &dsetAccessProps=DataSetAccessProps())
 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 LinkCreateProps &linkCreateProps=LinkCreateProps(), const DataSetCreateProps &dsetCreateProps=DataSetCreateProps(), const DataSetAccessProps &dsetAccessProps=DataSetAccessProps())
 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 FixedLenStringArray< N > &data, const LinkCreateProps &linkCreateProps=LinkCreateProps(), const DataSetCreateProps &dsetCreateProps=DataSetCreateProps(), const DataSetAccessProps &dsetAccessProps=DataSetAccessProps())
 
DataType getDataType (const std::string &dtype_name, const DataTypeAccessProps &dtypeAccessProps=DataTypeAccessProps()) const
 
DataSet getDataSet (const std::string &dataset_name, const DataSetAccessProps &accessProps=DataSetAccessProps()) const
 get an existing dataset in the current file
 
Group createGroup (const std::string &group_name, const LinkCreateProps &linkCreateProps=LinkCreateProps(), const GroupCreateProps &groupCreateProps=GroupCreateProps(), const GroupAccessProps &groupAccessProps=GroupAccessProps())
 create a new group, and eventually intermediate groups
 
Group getGroup (const std::string &group_name, const GroupAccessProps &groupAccessProps=GroupAccessProps()) const
 open an existing group with the name group_name
 
File getFile () const
 
size_t getNumberObjects () const
 return the number of leaf objects of the node / group
 
std::string getObjectName (size_t index, const LinkAccessProps &linkAccessProps=LinkAccessProps()) const
 return the name of the object with the given index
 
LinkInfo getLinkInfo (const std::string &objName) const
 
std::string unpackSoftLink (const std::string &objName)
 unpackSoftLink retrieve target path object path
 
std::string unpackExternalLink (const std::string &objName, std::string &fileName_out)
 unpackExternalLink retrieve target path object path and file path
 
bool rename (const std::string &src_path, const std::string &dest_path, const LinkCreateProps &linkCreateProps=LinkCreateProps(), const LinkAccessProps &linkAccessProps=LinkAccessProps()) const
 moves an object and its content within an HDF5 file.
 
std::vector< std::string > listObjectNames () const
 list all leaf objects name of the node / group
 
bool exist (const std::string &obj_name, const LinkAccessProps &linkAccessProps=LinkAccessProps(), bool raise_errors=false) const
 check a dataset or group exists in the current node / group
 
bool resolved (const std::string &obj_name, const LinkAccessProps &linkAccessProps=LinkAccessProps(), bool raise_errors=false) const
 resolved Hard links always resolved but Soft/External links may point to unexistant objects
 
bool existAndResolved (const std::string &obj_name, const LinkAccessProps &linkAccessProps=LinkAccessProps(), bool raise_errors=false) const
 existAndResolved invokes exist() and then reoslved()
 
bool hasObject (const std::string &objName, const ObjectType &objType, const LinkAccessProps &linkAccessProps=LinkAccessProps(), bool raise_errors=false) const
 
void unlink (const std::string &obj_name, const LinkAccessProps &linkAccessProps=LinkAccessProps()) const
 unlink the given dataset or group
 
LinkType getLinkType (const std::string &obj_name, const LinkAccessProps &linkAccessProps=LinkAccessProps()) const
 Returns the kind of link of the given name (soft, hard...)
 
ObjectType getObjectType (const std::string &obj_name, const LinkAccessProps &accessProps=LinkAccessProps()) const
 A shorthand to get the kind of object pointed to (group, dataset, type...)
 
Group copy (const Group &obj, const std::string &objNewName, const ObjectCopyProps &copyProps=ObjectCopyProps(), const LinkCreateProps &linkCreateProps=LinkCreateProps(), const GroupAccessProps &groupAccessProps=GroupAccessProps())
 Copies specified object to the new destination (this File/Group) under new name. The destination must not already have the object with the same name (objNewName).
 
DataSet copy (const DataSet &obj, const std::string &objNewName, const ObjectCopyProps &copyProps=ObjectCopyProps(), const LinkCreateProps &linkCreateProps=LinkCreateProps(), const DataSetAccessProps &dsetAccessProps=DataSetAccessProps())
 
DataType copy (const DataType &obj, const std::string &objNewName, const ObjectCopyProps &copyProps=ObjectCopyProps(), const LinkCreateProps &linkCreateProps=LinkCreateProps(), const DataTypeAccessProps &dtypeAccessProps=DataTypeAccessProps())
 Copies commited datatype.
 
template<typename Node , typename std::enable_if< std::is_same< Node, File >::value|std::is_same< Node, Group >::value >::type * = nullptr>
Group createLink (const Node &target, const std::string &linkName, const LinkType &linkType, const std::string &targetPath="", const LinkCreateProps &linkCreateProps=LinkCreateProps(), const LinkAccessProps &linkAccessProps=LinkAccessProps(), const GroupAccessProps &groupAccessProps=GroupAccessProps())
 
DataSet createLink (const DataSet &target, const std::string &linkName, const LinkType &linkType, const std::string &targetPath="", const LinkCreateProps &linkCreateProps=LinkCreateProps(), const LinkAccessProps &linkAccessProps=LinkAccessProps(), const DataSetAccessProps &dsetAccessProps=DataSetAccessProps())
 
DataType createLink (const DataType &target, const std::string &linkName, const LinkType &linkType, const std::string &targetPath="", const LinkCreateProps &linkCreateProps=LinkCreateProps(), const LinkAccessProps &linkAccessProps=LinkAccessProps(), const DataTypeAccessProps &dtypeAccessProps=DataTypeAccessProps())
 

Detailed Description

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

NodeTraits: Base class for Group and File.

Member Function Documentation

◆ copy()

template<typename Derivate >
Group h5gt::NodeTraits< Derivate >::copy ( const Group & obj,
const std::string & objNewName,
const ObjectCopyProps & copyProps = ObjectCopyProps(),
const LinkCreateProps & linkCreateProps = LinkCreateProps(),
const GroupAccessProps & groupAccessProps = GroupAccessProps() )

Copies specified object to the new destination (this File/Group) under new name. The destination must not already have the object with the same name (objNewName).

Returns
Copied object

◆ createDataSet() [1/3]

template<typename Derivate >
DataSet h5gt::NodeTraits< Derivate >::createDataSet ( const std::string & dataset_name,
const DataSpace & space,
const DataType & type,
const LinkCreateProps & linkCreateProps = LinkCreateProps(),
const DataSetCreateProps & dsetCreateProps = DataSetCreateProps(),
const DataSetAccessProps & dsetAccessProps = DataSetAccessProps() )
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 informations
typeType of Data
linkCreatePropsA link property list with data set creation properties
dsetCreatePropsA dataset property list with data set creation properties
dsetAccessPropsA dataset property list with data set access properties
Returns
DataSet Object

◆ createDataSet() [2/3]

template<typename Derivate >
template<typename Type >
DataSet h5gt::NodeTraits< Derivate >::createDataSet ( const std::string & dataset_name,
const DataSpace & space,
const LinkCreateProps & linkCreateProps = LinkCreateProps(),
const DataSetCreateProps & dsetCreateProps = DataSetCreateProps(),
const DataSetAccessProps & dsetAccessProps = DataSetAccessProps() )
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
linkCreatePropsA link property list with data set creation properties
dsetCreatePropsA dataset property list with data set creation properties
dsetAccessPropsA dataset property list with data set access properties
Returns
DataSet Object

◆ createDataSet() [3/3]

template<typename Derivate >
template<typename T >
DataSet h5gt::NodeTraits< Derivate >::createDataSet ( const std::string & dataset_name,
const T & data,
const LinkCreateProps & linkCreateProps = LinkCreateProps(),
const DataSetCreateProps & dsetCreateProps = DataSetCreateProps(),
const DataSetAccessProps & dsetAccessProps = DataSetAccessProps() )
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
linkCreatePropsA link property list with data set creation properties
dsetCreatePropsA dataset property list with data set creation properties
dsetAccessPropsA dataset property list with data set access properties
Returns
DataSet Object

◆ createGroup()

template<typename Derivate >
Group h5gt::NodeTraits< Derivate >::createGroup ( const std::string & group_name,
const LinkCreateProps & linkCreateProps = LinkCreateProps(),
const GroupCreateProps & groupCreateProps = GroupCreateProps(),
const GroupAccessProps & groupAccessProps = GroupAccessProps() )
inline

create a new group, and eventually intermediate groups

Parameters
group_name
linkCreatePropsA link property list with data set creation properties
groupCreatePropsA group property list with data set creation properties
groupAccessPropsA group property list with data set access properties
Returns
the group object

◆ exist()

template<typename Derivate >
bool h5gt::NodeTraits< Derivate >::exist ( const std::string & obj_name,
const LinkAccessProps & linkAccessProps = LinkAccessProps(),
bool raise_errors = false ) const
inline

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

Parameters
obj_namedataset/group name to check
linkAccessPropsA link property list with data set access properties
Returns
true if a dataset/group with the associated name exists, or false

◆ getDataSet()

template<typename Derivate >
DataSet h5gt::NodeTraits< Derivate >::getDataSet ( const std::string & dataset_name,
const DataSetAccessProps & accessProps = DataSetAccessProps() ) 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

◆ getGroup()

template<typename Derivate >
Group h5gt::NodeTraits< Derivate >::getGroup ( const std::string & group_name,
const GroupAccessProps & groupAccessProps = GroupAccessProps() ) const
inline

open an existing group with the name group_name

Parameters
group_name
Returns
the group object

◆ getLinkType()

template<typename Derivate >
LinkType h5gt::NodeTraits< Derivate >::getLinkType ( const std::string & obj_name,
const LinkAccessProps & linkAccessProps = LinkAccessProps() ) const
inline

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

Parameters
obj_nameThe entry to check, path relative to the current group
linkAccessPropsA link property list with data set access properties

◆ getNumberObjects()

template<typename Derivate >
size_t h5gt::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 h5gt::NodeTraits< Derivate >::getObjectName ( size_t index,
const LinkAccessProps & linkAccessProps = LinkAccessProps() ) const
inline

return the name of the object with the given index

Parameters
linkCreatePropsA link property list with data set creation properties
Returns
the name of the object

◆ getObjectType()

template<typename Derivate >
ObjectType h5gt::NodeTraits< Derivate >::getObjectType ( const std::string & obj_name,
const LinkAccessProps & accessProps = LinkAccessProps() ) const
inline

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

Parameters
obj_nameThe entry to check, path relative to the current group
linkAccessPropsA link property list with data set access properties

◆ listObjectNames()

template<typename Derivate >
std::vector< std::string > h5gt::NodeTraits< Derivate >::listObjectNames ( ) const
inline

list all leaf objects name of the node / group

Returns
number of leaf objects

◆ rename()

template<typename Derivate >
bool h5gt::NodeTraits< Derivate >::rename ( const std::string & src_path,
const std::string & dest_path,
const LinkCreateProps & linkCreateProps = LinkCreateProps(),
const LinkAccessProps & linkAccessProps = LinkAccessProps() ) 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
linkCreatePropsA link property list with data set creation properties
linkAccessPropsA link property list with data set access properties
Returns
boolean that is true if the move was successful

◆ resolved()

template<typename Derivate >
bool h5gt::NodeTraits< Derivate >::resolved ( const std::string & obj_name,
const LinkAccessProps & linkAccessProps = LinkAccessProps(),
bool raise_errors = false ) const
inline

resolved Hard links always resolved but Soft/External links may point to unexistant objects

Parameters
obj_name
linkAccessProps
raise_errors
Returns

◆ unlink()

template<typename Derivate >
void h5gt::NodeTraits< Derivate >::unlink ( const std::string & obj_name,
const LinkAccessProps & linkAccessProps = LinkAccessProps() ) const
inline

unlink the given dataset or group

Parameters
obj_namedataset/group name to unlink
linkAccessPropsA link property list with data set access properties

◆ unpackExternalLink()

template<typename Derivate >
std::string h5gt::NodeTraits< Derivate >::unpackExternalLink ( const std::string & objName,
std::string & fileName_out )
inline

unpackExternalLink retrieve target path object path and file path

Parameters
objName
fileName_out
Returns
target object path

◆ unpackSoftLink()

template<typename Derivate >
std::string h5gt::NodeTraits< Derivate >::unpackSoftLink ( const std::string & objName)
inline

unpackSoftLink retrieve target path object path

Parameters
objName
Returns

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