isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
isce3::io::IGroup Class Reference
Inheritance diagram for isce3::io::IGroup:

Public Member Functions

 IGroup (const H5::Group &group)
 
 IGroup (hid_t group)
 
std::vector< std::string > getAttrs ()
 
std::vector< std::string > find (const std::string name, const std::string start=".", const std::string type="BOTH", const std::string path="FULL")
 Search function for given name in the group. More...
 
std::string getPathname ()
 Return the path of the group from the file root. More...
 
H5::DataSpace getDataSpace (const std::string &name)
 Return the H5::DataSpace of the given attribute. More...
 
int getNumElements (const std::string &name)
 Return the number of elements in the given attribute. More...
 
template<typename T >
void read (T &v, const std::string &att)
 Reading scalar attribute given by name. More...
 
void read (std::string &v, const std::string &att)
 Reading scalar string attribute given by name. More...
 
template<typename T >
void read (T *buf, const std::string &att)
 Reading multi-dimensional attribute in raw pointer. More...
 
void read (std::string *buf, const std::string &att)
 Reading multi-dimensional string attribute in raw pointer. More...
 
template<typename T >
void read (std::vector< T > &buf, const std::string &att)
 Reading multi-dimensional attribute in vector. More...
 
template<typename T >
void read (std::valarray< T > &buf, const std::string &att)
 Reading multi-dimensional attribute in valarray. More...
 
IDataSet openDataSet (const H5std_string &name)
 Open a given dataset. More...
 
IGroup openGroup (const H5std_string &name)
 Open a given group. More...
 
IGroup createGroup (const H5std_string &name)
 Create a group within this group. More...
 
IDataSet createDataSet (const std::string &name, const std::string &data)
 Create a string scalar dataset and simultaneously write the data. More...
 
template<typename T >
IDataSet createDataSet (const std::string &name, const T &data)
 Create a (non-string) scalar dataset and simultaneously write the data.
 
template<typename T >
IDataSet createDataSet (const std::string &name, const std::vector< T > &data)
 Create a dataset (1D) and write the data from a vector container.
 
template<typename T >
IDataSet createDataSet (const std::string &name, const std::valarray< T > &data)
 Create a dataset (1D) and write the data from a valarray container.
 
template<typename T >
IDataSet createDataSet (const std::string &name, const T *buffer, const size_t size)
 Create a dataset (1D) and write a buffer's data.
 
template<typename T , typename T2 , size_t S>
IDataSet createDataSet (const std::string &name, const std::vector< T > &data, const std::array< T2, S > &dims)
 Create a dataset (nD) and write the data from a vector container.
 
template<typename T , typename T2 , size_t S>
IDataSet createDataSet (const std::string &name, const std::valarray< T > &data, const std::array< T2, S > &dims)
 Create a dataset (nD) and write the data from a valarray container.
 
template<typename T , typename T2 , size_t S>
IDataSet createDataSet (const std::string &name, const T *data, const std::array< T2, S > &dims)
 Create a dataset (nD) and write the data from a buffer.
 
template<typename T , typename T2 , size_t S>
IDataSet createDataSet (const std::string &name, const std::array< T2, S > &dims, const int chunk=0, const int shuffle=0, const int deflate=0)
 Create a datatset with compression options.
 
template<typename T >
void createAttribute (const std::string &name, const T &data)
 Creating and writing a scalar as an attribute. More...
 
template<typename T >
void createAttribute (const std::string &name, const std::vector< T > &values)
 Creating and writing a std::vector data as a 1D-array attribute. More...
 
template<typename T >
void createAttribute (const std::string &name, const std::valarray< T > &values)
 Creating and writing a std::valarray data as a 1D-array attribute. More...
 
template<typename T , typename T2 , size_t S>
void createAttribute (const std::string &name, const std::array< T2, S > &dims, const std::vector< T > &values)
 Creating and writing a std::vector data with dimensions (std::array) as an attribute. More...
 
template<typename T , typename T2 , size_t S>
void createAttribute (const std::string &name, const std::array< T2, S > &dims, const std::valarray< T > &values)
 Creating and writing a std::valarray data with dimensions (std::array) as an attribute. More...
 
template<typename T , typename T2 , size_t S>
void createAttribute (const std::string &name, const std::array< T2, S > &dims, const T *buffer)
 Creating and writing a raw pointer to data with dimensions (std::array) as an attribute. More...
 
template<>
void createAttribute (const std::string &name, const H5::DataType &datatype, const H5::DataSpace &dataspace, const std::string *buffer)
 
template<typename T >
isce3::io::IDataSet createDataSet (const std::string &name, const T &data)
 
template<typename T >
isce3::io::IDataSet createDataSet (const std::string &name, const std::vector< T > &data)
 
template<typename T >
isce3::io::IDataSet createDataSet (const std::string &name, const std::valarray< T > &data)
 
template<typename T >
isce3::io::IDataSet createDataSet (const std::string &name, const T *data, const size_t sz)
 
template<typename T , typename T2 , size_t S>
isce3::io::IDataSet createDataSet (const std::string &name, const std::vector< T > &data, const std::array< T2, S > &dims)
 
template<typename T , typename T2 , size_t S>
isce3::io::IDataSet createDataSet (const std::string &name, const std::valarray< T > &data, const std::array< T2, S > &dims)
 
template<typename T , typename T2 , size_t S>
isce3::io::IDataSet createDataSet (const std::string &name, const T *data, const std::array< T2, S > &dims)
 
template<typename T , typename T2 , size_t S>
isce3::io::IDataSet createDataSet (const std::string &name, const std::array< T2, S > &dims, const int chunk, const int shuffle, const int deflate)
 
template<>
void createAttribute (const std::string &name, const std::string &data)
 

Member Function Documentation

template<typename T >
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const T &  data 
)
inline

Creating and writing a scalar as an attribute.

Parameters
[in]nameName of the attribute to create
[in]dataReference to scalar attribute value
template<typename T >
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const std::vector< T > &  data 
)
inline

Creating and writing a std::vector data as a 1D-array attribute.

Parameters
[in]nameName of the attribute to create
[in]bufferstd::vector of attribute data to write

The shape of the attribute is 1D.

template<typename T >
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const std::valarray< T > &  data 
)
inline

Creating and writing a std::valarray data as a 1D-array attribute.

Parameters
[in]nameName of the attribute to create
[in]bufferstd::valarray of attribute data to write

The shape of the attribute is 1D.

template<typename T , typename T2 , size_t S>
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const std::array< T2, S > &  dims,
const std::vector< T > &  buffer 
)
inline

Creating and writing a std::vector data with dimensions (std::array) as an attribute.

Parameters
[in]nameName of the attribute to create
[in]dimsArray containing the size of each dimension of the attribute
[in]bufferstd::vector of attribute data to write
template<typename T , typename T2 , size_t S>
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const std::array< T2, S > &  dims,
const std::valarray< T > &  buffer 
)
inline

Creating and writing a std::valarray data with dimensions (std::array) as an attribute.

Parameters
[in]nameName of the attribute to create
[in]dimsArray containing the size of each dimension of the attribute
[in]bufferstd::valarray of attribute data to write
template<typename T , typename T2 , size_t S>
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const std::array< T2, S > &  dims,
const T *  buffer 
)
inline

Creating and writing a raw pointer to data with dimensions (std::array) as an attribute.

Parameters
[in]nameName of the attribute to create
[in]dimsArray containing the size of each dimension of the attribute
[in]bufferRaw pointer buffer to attribute data to write
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const H5::DataType &  datatype,
const H5::DataSpace &  dataspace,
const std::string *  buffer 
)
Parameters
[in]nameName of the group attribute to create
[in]datatypeH5 data type of the attribute
[in]dataspaceH5 data space of the attribute
[in]bufferof std::string values to write
template<>
void isce3::io::IGroup::createAttribute ( const std::string &  name,
const std::string &  data 
)
inline
Parameters
[in]nameName of the attribute to create
[in]dataString scalar attribute
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const std::string &  data 
)

Create a string scalar dataset and simultaneously write the data.

Parameters
[in]nameName of the dataset to create
[in]dataScalar (std::string) data to write to the dataset

The dataset is a 1-element dataset

template<typename T >
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const T &  data 
)
inline
Parameters
[in]nameName of the dataset to create
[in]dataScalar (non std::string) data to write to the dataset

The dataset is a 1-element dataset

template<typename T >
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const std::vector< T > &  data 
)
inline
Parameters
[in]nameName of the dataset to create
[in]datastd::vector of data to write to the dataset

The shape of the dataset is 1D. The number of dataset points is inferred from the size of the input data vector. The dataset type is same as data type.

template<typename T >
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const std::valarray< T > &  data 
)
inline
Parameters
[in]nameName of the dataset to create
[in]datastd::valarray of data to write to the dataset

The shape of the dataset is 1D. The number of dataset points is inferred from the size of the input data valarray. The dataset type is same as data type.

template<typename T >
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const T *  data,
const size_t  sz 
)
inline
Parameters
[in]nameName of the dataset to create
[in]dataRaw pointer to data to write to the dataset
[in]szNumber of points in the raw pointer buffer

The shape of the dataset is 1D. The dataset type is same as data type.

template<typename T , typename T2 , size_t S>
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const std::vector< T > &  data,
const std::array< T2, S > &  dims 
)
inline
Parameters
[in]nameName of the dataset to create
[in]datastd::vector of data to write to the dataset
[in]dimsArray containing the size of each dimension of the dataset

The dataset type is same as data type.

template<typename T , typename T2 , size_t S>
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const std::valarray< T > &  data,
const std::array< T2, S > &  dims 
)
inline
Parameters
[in]nameName of the dataset to create
[in]datastd::valarray of data to write to the dataset
[in]dimsArray containing the size of each dimension of the dataset

The dataset type is same as data type.

template<typename T , typename T2 , size_t S>
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const T *  data,
const std::array< T2, S > &  dims 
)
inline
Parameters
[in]nameName of the dataset to create
[in]dataRaw pointer to buffer towrite to the dataset
[in]dimsArray containing the size of each dimension of the dataset

The dataset type is same as data type.

template<typename T , typename T2 , size_t S>
isce3::io::IDataSet isce3::io::IGroup::createDataSet ( const std::string &  name,
const std::array< T2, S > &  dims,
const int  chunk,
const int  shuffle,
const int  deflate 
)
Parameters
[in]nameName of the dataset to create
[in]dimsArray containing the size of each dimension of the dataset
[in]chunk1/0 flag to set dataset chunking
[in]shuffle1/0 flag to set byte shuffling
[in]deflate[0..9] level of dataset compression

This interface just create the dataset and does not write any data. Writing is done with the IDataSet write function. To use API specific format (float16, complex,..), this function to create dataset has to be used. Chunking is set to 128x128 chunk on the fastest 2 dimensions only. It is automatically activated if shuffle, deflate or a specfic API format is used. If datatype is of NBIT type (i.e., float16, complex16, n1Bit, n2Bit, the NBIT filter is automatically activated if the chunking is activated.

isce3::io::IGroup isce3::io::IGroup::createGroup ( const H5std_string &  name)

Create a group within this group.

Parameters
[in]nameName of the group to create.

name must contain the full path from root location and name of the group to create.

std::vector< std::string > isce3::io::IGroup::find ( const std::string  name,
const std::string  start = ".",
const std::string  type = "BOTH",
const std::string  path = "FULL" 
)

Search function for given name in the group.

Parameters
[in]nameRegular Expression to search for.
[in]startRelative path from current group to start the search from.
[in]typeType of object to search for. Default: BOTH
[in]pathAbsolute or Relative path of found object. Default: FULL

The function returns paths of all objects in the file whose names satisfy name.

param name: can be a regular expression. param type: three types of objects to search for are available: GROUP: only returns groups whose names satisfy the inpout name. DATASET: only return datasets whose names satisfy the input name. BOTH: return groups and datsets whose names satisfy the input name. param path: the returned path of the found objects can be expressed from the current group (path = FULL - this is default) or relative to the start (path = RELATIVE).

H5::DataSpace isce3::io::IGroup::getDataSpace ( const std::string &  name)

Return the H5::DataSpace of the given attribute.

Parameters
[in]vName of the attribute. Returns the H5::DataSpace of the attribute.
int isce3::io::IGroup::getNumElements ( const std::string &  name)

Return the number of elements in the given attribute.

Parameters
[in]vName of the attribute. Returns the number of elements in the attribute.
std::string isce3::io::IGroup::getPathname ( )

Return the path of the group from the file root.

Return the path of the current group from the root location in the file.

isce3::io::IDataSet isce3::io::IGroup::openDataSet ( const H5std_string &  name)

Open a given dataset.

Open the dataset of the input name that belongs to the current group.

isce3::io::IGroup isce3::io::IGroup::openGroup ( const H5std_string &  name)

Open a given group.

Parameters
[in]nameName of the group to open.

name must contain the full path from root location and name of the group to open.

template<typename T >
void isce3::io::IGroup::read ( T &  v,
const std::string &  att 
)
inline

Reading scalar attribute given by name.

Parameters
[in]attName of the attribute
[out]vAttribute scalar value (numeric type).

Reads the value of the numeral attribute contained in the current group. For attribute containing more than one element, see other functions signature. For attribute of string type, see other signature.

void isce3::io::IGroup::read ( std::string &  v,
const std::string &  att 
)

Reading scalar string attribute given by name.

Parameters
[in]attName of the attribute
[out]vAttribute scalar value (std::string type).

Reads the value of a string attribute contained in the current group. For attribute containing more than one elements, see other function signature.

template<typename T >
void isce3::io::IGroup::read ( T *  buffer,
const std::string &  att 
)
inline

Reading multi-dimensional attribute in raw pointer.

Parameters
[in]attString containing the name of the attribute to read.
[out]bufferRaw pointer to array that will received the read data.

buffer has to be adequately allocated by caller.

void isce3::io::IGroup::read ( std::string *  buffer,
const std::string &  att 
)

Reading multi-dimensional string attribute in raw pointer.

Parameters
[in]attString containing the name of the attribute to read.
[out]bufferRaw pointer to array that will received the read data.

buffer has to be adequately allocated by caller.

template<typename T >
void isce3::io::IGroup::read ( std::vector< T > &  buffer,
const std::string &  att 
)
inline

Reading multi-dimensional attribute in vector.

Parameters
[in]attString containing the name of the attribute to read.
[out]bufferstd::vector will received the attribute data.

If the output container is undersized compared to the data to read the function will size it accordingly. If the container is larger than the data to be read, its size is unchanged. In both case the data read is stored at the beginning of the container.

template<typename T >
void isce3::io::IGroup::read ( std::valarray< T > &  buffer,
const std::string &  att 
)
inline

Reading multi-dimensional attribute in valarray.

Parameters
[in]attString containing the name of the attribute to read.
[out]bufferstd::valarray will received the attribute data.

If the output container is undersized compared to the data to read the function will size it accordingly. If the container is larger than the data to be read, its size is unchanged. In both case the data read is stored at the beginning of the container.


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

Generated for ISCE3.0 by doxygen 1.8.5.