WARPXM v1.10.0
Loading...
Searching...
No Matches
WxHdf5IoTmpl Class Reference

WxHdf5IoTmpl does the reading and writing to HDF5 files for a given data type. More...

#include <wxhdf5iotmpl.h>

Inheritance diagram for WxHdf5IoTmpl:
WxIoTmpl

Detailed Description

WxHdf5IoTmpl does the reading and writing to HDF5 files for a given data type.

Public Member Functions

 WxHdf5IoTmpl ()
 Constructor.
 
virtual ~WxHdf5IoTmpl ()
 Virtual destructor.
 
virtual WxIoNodeType writeDataSet (WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &fileSpaceCorners, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &writeSelectionCorners, const WmConstOpaquePtr &data) const
 Write a new data set under a node.
 
virtual void writeToDataSet (WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, const WmConstOpaquePtr &data) const
 Write to an open dataset (independent)
 
virtual WxIoNodeType readDataSet (WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &readSelectionCorners, WmOpaquePtr &data) const
 Read a data set under a node.
 
virtual void readFromDataSet (WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, WmOpaquePtr &data) const
 Read from an open dataset (independent)
 
virtual WxIoNodeType getDataShape (WxIoNodeType node, const std::string &dataSetName, WxRange &dataShape) const
 Obtain simple data shape for a data set under a node.
 
virtual void writeAttribute (WxIoNodeType node, const std::string &attribName, const WmConstOpaquePtr &attrib) const
 Write an attribute.
 
virtual void writeVecAttribute (WxIoNodeType node, const std::string &attribName, const WmConstOpaquePtr &attrib, int count) const
 Write a vector attribute.
 
virtual void readAttribute (WxIoNodeType node, const std::string &attribName, WmOpaquePtr &attrib) const
 Read an attribute.
 
virtual int readVecAttribute (WxIoNodeType node, const std::string &attribName, WmOpaquePtr &attribStorage, int count) const
 Read a vector attribute.
 
- Public Member Functions inherited from WxIoTmpl
virtual ~WxIoTmpl ()
 Virtual destructor.
 
virtual WxIoNodeType writeDataSet (WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &fileSpaceCorners, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &writeSelectionCorners, const WmConstOpaquePtr &data) const =0
 Write a new data set under a node.
 
virtual void writeToDataSet (WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, const WmConstOpaquePtr &data) const =0
 Write to an open dataset (independent)
 
virtual WxIoNodeType readDataSet (WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &readSelectionCorners, WmOpaquePtr &data) const =0
 Read a new data set under a node.
 
virtual void readFromDataSet (WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, WmOpaquePtr &data) const =0
 Read from an open dataset (independent)
 
virtual WxIoNodeType getDataShape (WxIoNodeType node, const std::string &dataSetName, WxRange &dataShape) const =0
 Obtain simple data shape for a data set under a node.
 
virtual void writeAttribute (WxIoNodeType node, const std::string &attribName, const WmConstOpaquePtr &attrib) const =0
 Write an attribute.
 
virtual void writeVecAttribute (WxIoNodeType node, const std::string &attribName, const WmConstOpaquePtr &attribStorage, int count) const =0
 Write a vector attribute.
 
virtual void readAttribute (WxIoNodeType node, const std::string &attribName, WmOpaquePtr &attrib) const =0
 Read an attribute.
 
virtual int readVecAttribute (WxIoNodeType node, const std::string &attribName, WmOpaquePtr &attribStorage, int count) const =0
 Read a vector attribute.
 

Static Public Attributes

static const int max_dims = 8
 Max rank dataset that needs to be represented.
 

Additional Inherited Members

- Protected Member Functions inherited from WxIoTmpl
 WxIoTmpl ()
 Constructor is protected, as this class cannot be made standalone.
 

Constructor & Destructor Documentation

◆ WxHdf5IoTmpl()

WxHdf5IoTmpl::WxHdf5IoTmpl ( )

Constructor.

◆ ~WxHdf5IoTmpl()

virtual WxHdf5IoTmpl::~WxHdf5IoTmpl ( )
virtual

Virtual destructor.

Member Function Documentation

◆ getDataShape()

virtual WxIoNodeType WxHdf5IoTmpl::getDataShape ( WxIoNodeType  node,
const std::string &  dataSetName,
WxRange dataShape 
) const
virtual

Obtain simple data shape for a data set under a node.

NOTE: data shape start indices can be offset by a vector attribute called "startIndices". If the attribute is shorter than the data rank, trailing start indices are assumed to be 0.

Parameters
nodethe node under which to find the dataset
dataNamethe name of the data
dataShapethe data set shape is returned by reference
Returns
the node to the dataset found

Implements WxIoTmpl.

◆ readAttribute()

virtual void WxHdf5IoTmpl::readAttribute ( WxIoNodeType  node,
const std::string &  attribName,
WmOpaquePtr attrib 
) const
virtual

Read an attribute.

Parameters
nodethe node to which this attribute belongs
attribNamethe name of the attribute
attribthe attribute to be read
Exceptions
WxExcepton failure to read attribute

Implements WxIoTmpl.

◆ readDataSet()

virtual WxIoNodeType WxHdf5IoTmpl::readDataSet ( WxIoNodeType  node,
const std::string &  dataName,
const std::vector< std::pair< int, int > > &  memorySpaceCorners,
const std::vector< std::pair< int, int > > &  readSelectionCorners,
WmOpaquePtr data 
) const
virtual

Read a data set under a node.

Parameters
nodethe node under which to find the dataset
dataNamethe name of the data
memorySpaceCornersvector of (start, stop) pairs for each dimension that specify local extent held in contiguous allocation
readSelectionCornersvector of (start, stop) pairs for each dimension that specify subarea of memory space to read into
datathe data to be written
Returns
the node to the dataset read

Implements WxIoTmpl.

◆ readFromDataSet()

virtual void WxHdf5IoTmpl::readFromDataSet ( WxIoNodeType  node,
const WxRange memoryRange,
const WxRange memorySubRange,
const WxRange fileRange,
const WxRange fileSubRange,
WmOpaquePtr data 
) const
virtual

Read from an open dataset (independent)

Parameters
nodethe node to read under
memoryRangeRange that specifies total extent on host
memorySubRangeRange that specifies local extent on host
fileRangeRange that specifies total extent on file
fileSubRangeRange that specifies local extent on file
datathe destination for data to be read. This is returned in ROW MAJOR ordering.

Implements WxIoTmpl.

◆ readVecAttribute()

virtual int WxHdf5IoTmpl::readVecAttribute ( WxIoNodeType  node,
const std::string &  attribName,
WmOpaquePtr attribStorage,
int  count 
) const
virtual

Read a vector attribute.

Parameters
nodethe node to which this attribute belongs
attribNamethe name of the attribute
attribStoragethe vector attribute to be read
countmaximum number of items to read; the amount of memory provided by attribStorage
Exceptions
WxExcepton failure to read attribute
Returns
number of items actually read

Implements WxIoTmpl.

◆ writeAttribute()

virtual void WxHdf5IoTmpl::writeAttribute ( WxIoNodeType  node,
const std::string &  attribName,
const WmConstOpaquePtr attrib 
) const
virtual

Write an attribute.

Parameters
nodethe node to write under
attribNamethe name of the attribute
attribthe attribute to be written

Implements WxIoTmpl.

◆ writeDataSet()

virtual WxIoNodeType WxHdf5IoTmpl::writeDataSet ( WxIoNodeType  node,
const std::string &  dataName,
const std::vector< std::pair< int, int > > &  fileSpaceCorners,
const std::vector< std::pair< int, int > > &  memorySpaceCorners,
const std::vector< std::pair< int, int > > &  writeSelectionCorners,
const WmConstOpaquePtr data 
) const
virtual

Write a new data set under a node.

Parameters
nodethe node to write under
dataNamethe name of the data
fileSpaceCornersvector of (start, stop) pairs for each dimension that specify the global data space extent
memorySpaceCornersvector of (start, stop) pairs for each dimension that specify local extent held in contiguous allocation
writeSelectionCornersvector of (start, stop) pairs for each dimension that specify subarea of local extent to write
datathe data to be written
Returns
the node to the written data

Implements WxIoTmpl.

◆ writeToDataSet()

virtual void WxHdf5IoTmpl::writeToDataSet ( WxIoNodeType  node,
const WxRange memoryRange,
const WxRange memorySubRange,
const WxRange fileRange,
const WxRange fileSubRange,
const WmConstOpaquePtr data 
) const
virtual

Write to an open dataset (independent)

Parameters
nodethe node to write under
memoryRangeRange that specifies total extent on host
memorySubRangeRange that specifies local extent on host
fileRangeRange that specifies total extent on file
fileSubRangeRange that specifies local extent on file
datathe destination for data to be written. This is returned in ROW MAJOR ordering.

Implements WxIoTmpl.

◆ writeVecAttribute()

virtual void WxHdf5IoTmpl::writeVecAttribute ( WxIoNodeType  node,
const std::string &  attribName,
const WmConstOpaquePtr attrib,
int  count 
) const
virtual

Write a vector attribute.

Parameters
nodethe node to write under
attribNamethe name of the attribute
attribthe vector attribute to be written
countnumber of items in vector to write

Implements WxIoTmpl.

Member Data Documentation

◆ max_dims

const int WxHdf5IoTmpl::max_dims = 8
static

Max rank dataset that needs to be represented.


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