MPQC  3.0.0-alpha
mpqc::File::Dataset< T > Struct Template Reference

Array-like collection of data. More...

#include <mpqc/file.hpp>

Inheritance diagram for mpqc::File::Dataset< T >:
mpqc::detail::File::Object

Public Member Functions

template<typename Extents >
 Dataset (const Object &parent, const std::string &name, const Extents &extents, const File::Properties &dcpl=File::Properties(H5P_DATASET_CREATE))
 Create dataset belonging to some file object. More...
 
size_t rank () const
 Dataspace rank (number of dimensions)
 
std::vector< rangeextents () const
 
void write (const T *buffer)
 Writes contiguous buffer into dataset. More...
 
void read (T *buffer) const
 Reads contiguous buffer from dataset. More...
 
Dataspace< T > operator[] (size_t index)
 Access dataspace of rank-1.
 
Dataspace< T > operator() (const std::vector< range > &r)
 Access dataspace of same rank.
 
Dataspace< const T > operator() (const std::vector< range > &r) const
 Access dataspace of same rank.
 
template<class R , ... >
Dataspace< T > operator() (const R &r,...)
 N-ary sub-dataspace access operators. More...
 
- Public Member Functions inherited from mpqc::detail::File::Object
 Object ()
 Default constructor with an invalid handle.
 
 Object (const Object &o)
 Copy constructor.
 
 Object (const Object &parent, hid_t id, void(*close)(hid_t), bool increment)
 
void operator= (const Object &o)
 
hid_t id () const
 
const Objectparent () const
 
hid_t file () const
 
 operator bool () const
 

Static Public Member Functions

template<typename Extents >
static Object create (const Object &parent, const std::string &name, const Extents &extents, const Properties &dcpl)
 
- Static Public Member Functions inherited from mpqc::detail::File::Object
static std::string filename (hid_t id)
 

Static Protected Member Functions

static range extent (const range &r)
 Return range as is.
 
template<typename E >
static range extent (const E &e)
 Return integral argument e as range(0,e)
 

Additional Inherited Members

- Protected Member Functions inherited from mpqc::detail::File::Object
template<class F >
void update (hid_t id, F close, bool increment)
 
- Protected Attributes inherited from mpqc::detail::File::Object
std::auto_ptr< Objectparent_
 
hid_t id_
 
void(* close_ )(hid_t)
 

Detailed Description

template<typename T>
struct mpqc::File::Dataset< T >

Array-like collection of data.

Constructor & Destructor Documentation

◆ Dataset()

template<typename T>
template<typename Extents >
mpqc::File::Dataset< T >::Dataset ( const Object parent,
const std::string &  name,
const Extents &  extents,
const File::Properties dcpl = File::Properties(H5P_DATASET_CREATE) 
)
inline

Create dataset belonging to some file object.

Parameters
parentDataset parent
nameDataset name
extentsDataset extents. Extents must be a collection of dataset dimensions or ranges. The size of collection determines dataset rank.

Member Function Documentation

◆ operator()()

template<typename T>
template<class R , ... >
Dataspace<T> mpqc::File::Dataset< T >::operator() ( const R &  r,
  ... 
)

N-ary sub-dataspace access operators.

The parameters R should be either integral types (a single element) or of type mpqc::range (a range of elements) The method packs arguments into std::vector<range> and calls the equivalent operator.

◆ read()

template<typename T>
void mpqc::File::Dataset< T >::read ( T *  buffer) const
inline

Reads contiguous buffer from dataset.

The size of buffer must be the same as size of dataset This function is threadsafe

Referenced by mpqc::operator>>().

◆ write()

template<typename T>
void mpqc::File::Dataset< T >::write ( const T *  buffer)
inline

Writes contiguous buffer into dataset.

The size of buffer must be the same as size of dataset This function is threadsafe

Referenced by mpqc::operator<<().


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

Generated at Sun Jan 26 2020 23:24:02 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.