HDF5 C++ API  1.8.12
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions | Protected Member Functions | List of all members
H5::Attribute Class Reference

Class Attribute operates on HDF5 attributes. More...

#include <H5Attribute.h>

Inheritance diagram for H5::Attribute:
H5::AbstractDs H5::IdComponent

Public Member Functions

virtual void close ()
 Closes this attribute. More...
 
H5std_string getFileName () const
 Gets the name of the file, in which this attribute belongs. More...
 
ssize_t getName (size_t buf_size, H5std_string &attr_name) const
 Gets the name of this attribute, returning its length. More...
 
H5std_string getName (size_t buf_size) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it returns the attribute's name, not the length. More...
 
H5std_string getName () const
 This is an overloaded member function, provided for convenience. It differs from the above functions in that it doesn't take any arguments and returns the attribute's name. More...
 
virtual DataSpace getSpace () const
 Gets a copy of the dataspace for this attribute. More...
 
virtual hsize_t getStorageSize () const
 Returns the amount of storage size required for this attribute. More...
 
virtual size_t getInMemDataSize () const
 Gets the size in memory of the attribute's data. More...
 
void read (const DataType &mem_type, void *buf) const
 Reads data from this attribute. More...
 
void read (const DataType &mem_type, H5std_string &strg) const
 This is an overloaded member function, provided for convenience. It reads a H5std_string from this attribute. More...
 
void write (const DataType &mem_type, const void *buf) const
 Writes data to this attribute. More...
 
void write (const DataType &mem_type, const H5std_string &strg) const
 This is an overloaded member function, provided for convenience. It writes a H5std_string to this attribute. More...
 
void flush (H5F_scope_t scope) const
 Flushes all buffers associated with a file specified by this attribute, to disk. More...
 
virtual H5std_string fromClass () const
 Returns this class name. More...
 
 Attribute (const hid_t attr_id)
 Creates an Attribute object using the id of an existing attribute. More...
 
 Attribute (const Attribute &original)
 Copy constructor: makes a copy of the original Attribute object. More...
 
 Attribute ()
 Default constructor: Creates a stub attribute. More...
 
virtual hid_t getId () const
 Get the id of this attribute. More...
 
virtual ~Attribute ()
 Properly terminates access to this attribute. More...
 
- Public Member Functions inherited from H5::AbstractDs
DataType getDataType () const
 Returns the generic datatype of this abstract dataset, which can be a dataset or an attribute. More...
 
ArrayType getArrayType () const
 Returns the array datatype of this abstract dataset which can be a dataset or an attribute. More...
 
CompType getCompType () const
 Returns the compound datatype of this abstract dataset which can be a dataset or an attribute. More...
 
EnumType getEnumType () const
 Returns the enumeration datatype of this abstract dataset which can be a dataset or an attribute. More...
 
IntType getIntType () const
 Returns the integer datatype of this abstract dataset which can be a dataset or an attribute. More...
 
FloatType getFloatType () const
 Returns the floating-point datatype of this abstract dataset, which can be a dataset or an attribute. More...
 
StrType getStrType () const
 Returns the string datatype of this abstract dataset which can be a dataset or an attribute. More...
 
VarLenType getVarLenType () const
 Returns the floating-point datatype of this abstract dataset, which can be a dataset or an attribute. More...
 
H5T_class_t getTypeClass () const
 Returns the class of the datatype that is used by this object, which can be a dataset or an attribute. More...
 
 AbstractDs (const AbstractDs &original)
 Copy constructor: makes a copy of the original AbstractDs object. More...
 
virtual ~AbstractDs ()
 Noop destructor. More...
 
- Public Member Functions inherited from H5::IdComponent
void incRefCount (const hid_t obj_id) const
 Increment reference counter for a given id. More...
 
void incRefCount () const
 Increment reference counter for the id of this object. More...
 
void decRefCount (const hid_t obj_id) const
 Decrement reference counter for a given id. More...
 
void decRefCount () const
 Decrement reference counter for the id of this object. More...
 
int getCounter (const hid_t obj_id) const
 Returns the reference counter for a given id. More...
 
int getCounter () const
 Returns the reference counter for the id of this object. More...
 
IdComponentoperator= (const IdComponent &rhs)
 Assignment operator. More...
 
void setId (const hid_t new_id)
 Sets the identifier of this object to a new value. More...
 
 IdComponent (const hid_t h5_id)
 Creates an IdComponent object using the id of an existing object. More...
 
 IdComponent (const IdComponent &original)
 Copy constructor: makes a copy of the original IdComponent object. More...
 
H5std_string inMemFunc (const char *func_name) const
 Makes and returns string "<class-name>::<func_name>". More...
 
virtual ~IdComponent ()
 Noop destructor. More...
 

Protected Member Functions

virtual void p_setId (const hid_t new_id)
 Sets the identifier of this object to a new value. More...
 
- Protected Member Functions inherited from H5::AbstractDs
 AbstractDs ()
 Default constructor. More...
 
 AbstractDs (const hid_t ds_id)
 Creates an AbstractDs instance using an existing id. More...
 
- Protected Member Functions inherited from H5::IdComponent
 IdComponent ()
 Default constructor. More...
 
H5std_string p_get_file_name () const
 

Additional Inherited Members

- Static Public Member Functions inherited from H5::IdComponent
static H5I_type_t getHDFObjType (const hid_t obj_id)
 Given an id, returns the type of the object. More...
 
- Static Protected Member Functions inherited from H5::IdComponent
static bool p_valid_id (const hid_t obj_id)
 

Detailed Description

Class Attribute operates on HDF5 attributes.

An attribute has many characteristics similar to a dataset, thus both Attribute and DataSet are derivatives of AbstractDs. Attribute also inherits from IdComponent because an attribute is an HDF5 component that is identified by an identifier.

Constructor & Destructor Documentation

H5::Attribute::Attribute ( const hid_t  existing_id)

Creates an Attribute object using the id of an existing attribute.

Parameters
existing_id- IN: Id of an existing attribute
Exceptions
H5::AttributeIException
H5::Attribute::Attribute ( const Attribute original)

Copy constructor: makes a copy of the original Attribute object.

Parameters
original- IN: Original Attribute object to copy
H5::Attribute::Attribute ( )

Default constructor: Creates a stub attribute.

H5::Attribute::~Attribute ( )
virtual

Properly terminates access to this attribute.

Member Function Documentation

void H5::Attribute::close ( )
virtual

Closes this attribute.

Exceptions
H5::AttributeIException

Implements H5::IdComponent.

void H5::Attribute::flush ( H5F_scope_t  scope) const

Flushes all buffers associated with a file specified by this attribute, to disk.

Parameters
scope- IN: Specifies the scope of the flushing action, which can be either of these values:
  • H5F_SCOPE_GLOBAL - Flushes the entire virtual file
  • H5F_SCOPE_LOCAL - Flushes only the specified file
Exceptions
H5::AttributeIException
Description
This attribute is used to identify the file to be flushed.
virtual H5std_string H5::Attribute::fromClass ( ) const
inlinevirtual

Returns this class name.

Implements H5::AbstractDs.

H5std_string H5::Attribute::getFileName ( ) const

Gets the name of the file, in which this attribute belongs.

Returns
File name
Exceptions
H5::IdComponentException
hid_t H5::Attribute::getId ( ) const
virtual

Get the id of this attribute.

Returns
Attribute identifier

Implements H5::IdComponent.

size_t H5::Attribute::getInMemDataSize ( ) const
virtual

Gets the size in memory of the attribute's data.

Returns
Size of data (in memory)
Exceptions
H5::AttributeIException

Implements H5::AbstractDs.

ssize_t H5::Attribute::getName ( size_t  buf_size,
H5std_string attr_name 
) const

Gets the name of this attribute, returning its length.

Parameters
buf_size- IN: Desired length of the name
attr_name- OUT: Buffer for the name string
Returns
Length of the attribute name
Exceptions
H5::AttributeIException
H5std_string H5::Attribute::getName ( size_t  buf_size) const

This is an overloaded member function, provided for convenience. It differs from the above function in that it returns the attribute's name, not the length.

Returns
Name of the attribute
Parameters
buf_size- IN: Desired length of the name
Exceptions
H5::AttributeIException
H5std_string H5::Attribute::getName ( ) const

This is an overloaded member function, provided for convenience. It differs from the above functions in that it doesn't take any arguments and returns the attribute's name.

Returns
Name of the attribute
Exceptions
H5::AttributeIException
DataSpace H5::Attribute::getSpace ( ) const
virtual

Gets a copy of the dataspace for this attribute.

Returns
Dataspace instance
Exceptions
H5::AttributeIException

Implements H5::AbstractDs.

hsize_t H5::Attribute::getStorageSize ( ) const
virtual

Returns the amount of storage size required for this attribute.

Returns
Size of the storage or 0, for no data
Exceptions
H5::AttributeIException

Implements H5::AbstractDs.

void H5::Attribute::p_setId ( const hid_t  new_id)
protectedvirtual

Sets the identifier of this object to a new value.

Exceptions
H5::IdComponentExceptionwhen the attempt to close the HDF5 object fails

Implements H5::IdComponent.

void H5::Attribute::read ( const DataType mem_type,
void *  buf 
) const

Reads data from this attribute.

Parameters
mem_type- IN: Attribute datatype (in memory)
buf- OUT: Buffer for read data
Exceptions
H5::AttributeIException
void H5::Attribute::read ( const DataType mem_type,
H5std_string strg 
) const

This is an overloaded member function, provided for convenience. It reads a H5std_string from this attribute.

Parameters
mem_type- IN: Attribute datatype (in memory)
strg- IN: Buffer for read string
Exceptions
H5::AttributeIException
void H5::Attribute::write ( const DataType mem_type,
const void *  buf 
) const

Writes data to this attribute.

Parameters
mem_type- IN: Attribute datatype (in memory)
buf- IN: Data to be written
Exceptions
H5::AttributeIException
void H5::Attribute::write ( const DataType mem_type,
const H5std_string strg 
) const

This is an overloaded member function, provided for convenience. It writes a H5std_string to this attribute.

Parameters
mem_type- IN: Attribute datatype (in memory)
strg- IN: Data to be written
Exceptions
H5::AttributeIException

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