2#ifndef included_AMP_HDF5_Class_h
3#define included_AMP_HDF5_Class_h
10#include "AMP/AMP_TPLs.h"
11#include "AMP/IO/HDF.h"
12#include "AMP/utils/Array.h"
19class HDF5data :
public std::enable_shared_from_this<HDF5data>
26 virtual std::string
type()
const = 0;
29 virtual size_t size()
const = 0;
32 virtual std::shared_ptr<HDF5data>
getData(
size_t i,
const std::string_view &
name ) = 0;
35 std::shared_ptr<const HDF5data>
getData(
size_t i,
const std::string_view &
name )
const;
38 virtual std::vector<std::string>
getNames()
const = 0;
48 virtual void print(
int level = 1,
const std::string_view &prefix =
"" )
const = 0;
51 inline const std::string &
name()
const {
return d_name; }
76std::unique_ptr<HDF5data>
readHDF5(
hid_t fid,
const std::string_view &name );
Simple class to store the array dimensions.
const std::string & name() const
Return the name of the variable.
void getData(AMP::Array< TYPE > &data) const
Get the data.
virtual size_t size() const =0
Number of entries.
virtual AMP::ArraySize getDataSize() const =0
Get the data.
HDF5data(hid_t fid, const std::string_view &name)
virtual std::string type() const =0
Return a string identifying the class.
virtual std::vector< std::string > getNames() const =0
Get the variable names.
std::shared_ptr< const HDF5data > getData(size_t i, const std::string_view &name) const
Get the data ith block and jth child.
virtual void print(int level=1, const std::string_view &prefix="") const =0
Print information about the data.
bool operator!=(const HDF5data &rhs) const
Check if two objects are not equal.
virtual ~HDF5data()
Virtual destructor.
virtual std::shared_ptr< HDF5data > getData(size_t i, const std::string_view &name)=0
Get the data ith block and jth child.
virtual bool operator==(const HDF5data &rhs) const =0
Check if two objects are equal.
void readHDF5(hid_t fid, const std::string &name, T &data)
Read a structure from HDF5.