Пример #1
0
hdf5_dataspace::hdf5_dataspace(hdf5_annotation const& annotation)
    :
      hdf5_object(H5Aget_space(annotation.get_id()))
{
    if(annotation.get_id() < 0) {
        boost::serialization::throw_exception(
            hdf5_archive_exception(
                hdf5_archive_exception::hdf5_archive_annotation_access_error
            )
        );
    }
    if(get_id() < 0) {
        boost::serialization::throw_exception(
            hdf5_archive_exception(
                hdf5_archive_exception::hdf5_archive_dataspace_access_error
            )
        );
    }
}
hdf5_datatype::hdf5_datatype(hdf5_annotation const& annotation)
    :
      hdf5_object(H5Aget_type(annotation.get_id())),
      type_class_(H5Tget_class(get_id()))
{
    if(annotation.get_id() < 0) {
        boost::serialization::throw_exception(
            hdf5_archive_exception(
                hdf5_archive_exception::hdf5_archive_annotation_access_error
            )
        );
    }
    if(get_id() < 0) {
        boost::serialization::throw_exception(
            hdf5_archive_exception(
                hdf5_archive_exception::hdf5_archive_datatype_access_error
            )
        );
    }
}