echelon  0.8.0
Public Types | Public Member Functions | List of all members
echelon::object Class Reference

Polymorphic handle to an HDF5 object. More...

#include <object.hpp>

Public Types

using native_handle_type = hdf5::object
 Type of the underlying HDF5 low-level handle.
 

Public Member Functions

 object ()=default
 Initializes the handle with its null state.
 
 object (const group &object_)
 Constructs a handle from an pre-existing group handle. More...
 
 object (const dataset &object_)
 Constructs a handle from an pre-existing dataset handle. More...
 
 object (const scalar_dataset &object_)
 Constructs a handle from an pre-existing scalar dataset handle. More...
 
objectoperator= (const group &object_)
 Changes the object, which is referenced by the handle. More...
 
objectoperator= (const dataset &object_)
 Changes the object, which is referenced by the handle. More...
 
objectoperator= (const scalar_dataset &object_)
 Changes the object, which is referenced by the handle. More...
 
 operator group () const
 Constructs a group handle, which shares ownership with this handle. More...
 
 operator dataset () const
 Constructs a dataset handle, which shares ownership with this handle. More...
 
 operator scalar_dataset () const
 Constructs a scalar dataset handle, which shares ownership with this handle. More...
 
object_reference ref () const
 A HDF5 object reference to this object.
 
native_handle_type native_handle () const
 The underlying HDF5 low-level handle.
 
 operator bool () const
 Tests the validity of the handle.
 

Detailed Description

Polymorphic handle to an HDF5 object.

Constructor & Destructor Documentation

echelon::object::object ( const group object_)

Constructs a handle from an pre-existing group handle.

Parameters
object_a handle to the shared object
echelon::object::object ( const dataset object_)

Constructs a handle from an pre-existing dataset handle.

Parameters
object_a handle to the shared object
echelon::object::object ( const scalar_dataset object_)

Constructs a handle from an pre-existing scalar dataset handle.

Parameters
object_a handle to the shared object

Member Function Documentation

echelon::object::operator dataset ( ) const

Constructs a dataset handle, which shares ownership with this handle.

The incorporated conversion might fail, if the generated handle can't reference the object, which is referenced by this handle. An exception is thrown in this case.

Exceptions
wrong_object_type_exceptionis thrown, if the generated handle would be incompatible with the referenced object.
echelon::object::operator group ( ) const

Constructs a group handle, which shares ownership with this handle.

The incorporated conversion might fail, if the generated handle can't reference the object, which is referenced by this handle. An exception is thrown in this case.

Exceptions
wrong_object_type_exceptionis thrown, if the generated handle would be incompatible with the referenced object.
echelon::object::operator scalar_dataset ( ) const

Constructs a scalar dataset handle, which shares ownership with this handle.

The incorporated conversion might fail, if the generated handle can't reference the object, which is referenced by this handle. An exception is thrown in this case.

Exceptions
wrong_object_type_exceptionis thrown, if the generated handle would be incompatible with the referenced object.
object & echelon::object::operator= ( const group object_)

Changes the object, which is referenced by the handle.

Parameters
object_a handle to the shared object
object & echelon::object::operator= ( const dataset object_)

Changes the object, which is referenced by the handle.

Parameters
object_a handle to the shared object
object & echelon::object::operator= ( const scalar_dataset object_)

Changes the object, which is referenced by the handle.

Parameters
object_a handle to the shared object

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