h5gt 0.2.0
C++ wrapper for HDF5 library (based on HighFive project)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
h5gt::Attribute Class Reference

Class representing an attribute of a dataset or group. More...

#include <H5Attribute.hpp>

Inheritance diagram for h5gt::Attribute:
h5gt::Object

Public Member Functions

std::string getName () const
 return the name of the current attribute
 
size_t getStorageSize () const
 getStorageSize
 
DataType getDataType () const
 getDataType
 
DataSpace getSpace () const
 getSpace
 
DataSpace getMemSpace () const
 getMemSpace
 
File getFile () const
 
template<typename T >
void read (T &array) const
 
template<typename T >
void read (T *array, const DataType &dtype=DataType()) const
 
template<typename T >
void write (const T &buffer)
 
template<typename T >
void write_raw (const T *buffer, const DataType &dtype=DataType())
 
- Public Member Functions inherited from h5gt::Object
void flush (bool globalScope=true)
 flush
 
bool isValid () const noexcept
 isValid
 
hid_t getId (const bool &increaseRefCount=false) const noexcept
 getId
 
std::string getFileName () const
 
std::string getPath () const
 return the path to the current group, dataset, datatype or attribute's holder
 
int getIdRefCount () const noexcept
 
ObjectInfo getObjectInfo () const
 Retrieve several infos about the current object (address, dates, etc)
 
ObjectType getObjectType () const
 Gets the fundamental type of the object (dataset, group, etc)
 

Static Public Member Functions

static Attribute FromId (const hid_t &id, const bool &increaseRefCount=false)
 

Static Public Attributes

static const ObjectType type = ObjectType::Attribute
 

Protected Member Functions

 Attribute (const Object &obj)
 
- Protected Member Functions inherited from h5gt::Object
 Object (const Object &other)
 
 Object (Object &&other) noexcept
 
 Object (const hid_t &)
 
 Object (const hid_t &, const ObjectType &, const bool &)
 
LinkInfo _getLinkInfo (const std::string &objPath) const
 getLinkInfo retrieve link info from an object with 'objPath'. This object must reside in the same container as current one.
 
std::string _unpackSoftLink (const std::string &objName) const
 
std::string _unpackExternalLink (const std::string &objName, std::string &fileName_out) const
 
void _unlink (const std::string &obj_name) const
 
Objectoperator= (const Object &other)
 
bool operator== (const Object &other) const
 When coparing objects h5gt::File must be open.
 

Friends

template<typename Derivate >
class ::h5gt::AnnotateTraits
 

Additional Inherited Members

- Protected Attributes inherited from h5gt::Object
hid_t _hid
 

Detailed Description

Class representing an attribute of a dataset or group.

Member Function Documentation

◆ getDataType()

DataType h5gt::Attribute::getDataType ( ) const
inline

getDataType

Returns
return the datatype associated with this attribute

◆ getMemSpace()

DataSpace h5gt::Attribute::getMemSpace ( ) const
inline

getMemSpace

Returns
same as getSpace for attribute, compatibility with Selection class

◆ getName()

std::string h5gt::Attribute::getName ( ) const
inline

return the name of the current attribute

Returns
the name of the attribute

◆ getSpace()

DataSpace h5gt::Attribute::getSpace ( ) const
inline

getSpace

Returns
return the dataspace associated with this attribute

◆ getStorageSize()

size_t h5gt::Attribute::getStorageSize ( ) const
inline

getStorageSize

Returns
returns the amount of storage allocated for an attribute.

◆ read() [1/2]

template<typename T >
void h5gt::Attribute::read ( T & array) const
inline

Read the attribute into a buffer An exception is raised if the numbers of dimension of the buffer and of the attribute are different

The array type can be a N-pointer or a N-vector ( e.g int** integer two dimensional array )

◆ read() [2/2]

template<typename T >
void h5gt::Attribute::read ( T * array,
const DataType & dtype = DataType() ) const
inline

Read the attribute into a buffer

◆ write()

template<typename T >
void h5gt::Attribute::write ( const T & buffer)
inline

Write the integrality N-dimension buffer to this attribute An exception is raised if the numbers of dimension of the buffer and of the attribute are different

The array type can be a N-pointer or a N-vector ( e.g int** integer two dimensional array )

◆ write_raw()

template<typename T >
void h5gt::Attribute::write_raw ( const T * buffer,
const DataType & dtype = DataType() )
inline

Write a buffer to this attribute


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