HighFive 2.3.1
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
HighFive::DataSpace Class Reference

Class representing the space (dimensions) of a dataset. More...

#include <H5DataSpace.hpp>

Inheritance diagram for HighFive::DataSpace:
Collaboration diagram for HighFive::DataSpace:

Public Types

enum  DataspaceType { datascape_scalar , datascape_null }
 dataspace type More...
 

Public Member Functions

 DataSpace (const std::vector< size_t > &dims)
 
template<size_t N>
 DataSpace (const std::array< size_t, N > &dims)
 
 DataSpace (const std::initializer_list< size_t > &items)
 
template<typename... Args>
 DataSpace (size_t dim1, Args... dims)
 
template<typename IT , typename = typename std::enable_if<!std::is_integral<IT>::value,IT>::type>
 DataSpace (const IT begin, const IT end)
 
 DataSpace (const std::vector< size_t > &dims, const std::vector< size_t > &maxdims)
 Create a resizable N-dimensional dataspace. More...
 
 DataSpace (DataspaceType dtype)
 DataSpace create a scalar dataspace or a null dataset. More...
 
DataSpace clone () const
 
size_t getNumberDimensions () const
 getNumberDimensions More...
 
std::vector< size_t > getDimensions () const
 getDimensions More...
 
size_t getElementCount () const
 getElementCount More...
 
std::vector< size_t > getMaxDimensions () const
 getMaxDimensions More...
 
- Public Member Functions inherited from HighFive::Object
 ~Object ()
 
bool isValid () const noexcept
 isValid More...
 
hid_t getId () const noexcept
 getId More...
 
ObjectInfo getInfo () const
 Retrieve several infos about the current object (address, dates, etc) More...
 
ObjectType getType () const
 Gets the fundamental type of the object (dataset, group, etc) More...
 
bool operator== (const Object &other) const noexcept
 

Static Public Member Functions

template<typename T >
static DataSpace From (const T &value)
 Create a dataspace matching a type accepted by details::inspector. More...
 
template<std::size_t N, std::size_t Width>
static DataSpace FromCharArrayStrings (const char(&)[N][Width])
 

Static Public Attributes

static const ObjectType type = ObjectType::DataSpace
 
static const size_t UNLIMITED = SIZE_MAX
 

Protected Member Functions

 DataSpace ()=default
 
- Protected Member Functions inherited from HighFive::Object
 Object ()
 
 Object (const Object &other)
 
 Object (Object &&other) noexcept
 
 Object (hid_t)
 
Objectoperator= (const Object &other)
 

Friends

class Attribute
 
class File
 
class DataSet
 

Additional Inherited Members

- Protected Attributes inherited from HighFive::Object
hid_t _hid
 

Detailed Description

Class representing the space (dimensions) of a dataset.

Member Enumeration Documentation

◆ DataspaceType

dataspace type

Enumerator
datascape_scalar 
datascape_null 

Constructor & Destructor Documentation

◆ DataSpace() [1/8]

HighFive::DataSpace::DataSpace ( const std::vector< size_t > &  dims)
inlineexplicit

create a dataspace of N-dimensions Each dimension is configured this way size(dim1) = vec[0] size(dim2) = vec[1] etc...

◆ DataSpace() [2/8]

template<size_t N>
HighFive::DataSpace::DataSpace ( const std::array< size_t, N > &  dims)
inlineexplicit

◆ DataSpace() [3/8]

HighFive::DataSpace::DataSpace ( const std::initializer_list< size_t > &  items)
inline

Make sure that DataSpace({1,2,3}) works on GCC. This is the shortcut form of the vector initializer, but one some compilers (gcc) this does not resolve correctly without this constructor.

◆ DataSpace() [4/8]

template<typename... Args>
HighFive::DataSpace::DataSpace ( size_t  dim1,
Args...  dims 
)
inlineexplicit

Allow directly listing 1 or more dimensions to initialize, that is, DataSpace(1,2) means DataSpace(std::vector<size_t>{1,2}).

◆ DataSpace() [5/8]

template<class IT , typename >
HighFive::DataSpace::DataSpace ( const IT  begin,
const IT  end 
)
inline

Create a dataspace from an iterator pair

Explicitly disable DataSpace(int_like, int_like) from trying to use this constructor

◆ DataSpace() [6/8]

HighFive::DataSpace::DataSpace ( const std::vector< size_t > &  dims,
const std::vector< size_t > &  maxdims 
)
inlineexplicit

Create a resizable N-dimensional dataspace.

Parameters
dimsInitial size of dataspace
maxdimsMaximum size of the dataspace

◆ DataSpace() [7/8]

HighFive::DataSpace::DataSpace ( DataSpace::DataspaceType  dtype)
inlineexplicit

DataSpace create a scalar dataspace or a null dataset.

◆ DataSpace() [8/8]

HighFive::DataSpace::DataSpace ( )
protecteddefault

Member Function Documentation

◆ clone()

DataSpace HighFive::DataSpace::clone ( ) const
inline

Create a new DataSpace with a different id available for modifications

◆ From()

template<typename T >
DataSpace HighFive::DataSpace::From ( const T &  value)
inlinestatic

Create a dataspace matching a type accepted by details::inspector.

◆ FromCharArrayStrings()

template<std::size_t N, std::size_t Width>
DataSpace HighFive::DataSpace::FromCharArrayStrings ( const   char(&)[N][Width])
inlinestatic

◆ getDimensions()

std::vector< size_t > HighFive::DataSpace::getDimensions ( ) const
inline

getDimensions

Returns
return a vector of N-element, each element is the size of the associated dataset dimension

◆ getElementCount()

size_t HighFive::DataSpace::getElementCount ( ) const
inline

getElementCount

Returns
the total number of elements in the dataspace

◆ getMaxDimensions()

std::vector< size_t > HighFive::DataSpace::getMaxDimensions ( ) const
inline

getMaxDimensions

Returns
return a vector of N-element, each element is the size of the associated dataset maximum dimension

◆ getNumberDimensions()

size_t HighFive::DataSpace::getNumberDimensions ( ) const
inline

getNumberDimensions

Returns
the number of dimensions in the current dataspace

Friends And Related Function Documentation

◆ Attribute

friend class Attribute
friend

◆ DataSet

friend class DataSet
friend

◆ File

friend class File
friend

Member Data Documentation

◆ type

const ObjectType HighFive::DataSpace::type = ObjectType::DataSpace
static

◆ UNLIMITED

const size_t HighFive::DataSpace::UNLIMITED = SIZE_MAX
static

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