1#ifndef RITSUKO_HDF5_FORBID_LARGE_INTEGERS_HPP
2#define RITSUKO_HDF5_FORBID_LARGE_INTEGERS_HPP
29 if (itype.getSign() == H5T_SGN_NONE) {
31 return (itype.getPrecision() >= precision);
33 return (itype.getPrecision() > precision);
37 return (itype.getPrecision() > precision);
56 if (data.getTypeClass() != H5T_INTEGER) {
59 H5::IntType itype(data);
75 if (attr.getTypeClass() != H5T_INTEGER) {
84inline bool exceeds_float_limit_by_integer(
const H5::IntType& itype, std::size_t precision) {
85 if (precision >= 64) {
87 }
else if (precision >= 32) {
94inline bool exceeds_float_limit_by_float(
const H5::FloatType& ftype, std::size_t precision) {
96 if (precision >= 64) {
98 ftype == H5::PredType::IEEE_F64LE ||
99 ftype == H5::PredType::IEEE_F64BE ||
100 ftype == H5::PredType::IEEE_F32LE ||
101 ftype == H5::PredType::IEEE_F32BE
103 }
else if (precision >= 32) {
105 ftype == H5::PredType::IEEE_F32LE ||
106 ftype == H5::PredType::IEEE_F32BE
138 auto tclass = data.getTypeClass();
139 if (tclass == H5T_INTEGER) {
140 return exceeds_float_limit_by_integer(H5::IntType(data), precision);
141 }
else if (tclass == H5T_FLOAT) {
142 return exceeds_float_limit_by_float(H5::FloatType(data), precision);
159 auto tclass = attr.getTypeClass();
160 if (tclass == H5T_INTEGER) {
161 return exceeds_float_limit_by_integer(attr.getIntType(), precision);
162 }
else if (tclass == H5T_FLOAT) {
163 return exceeds_float_limit_by_float(attr.getFloatType(), precision);
bool exceeds_integer_limit(const H5::IntType &itype, std::size_t precision, bool is_signed)
Definition exceeds_limit.hpp:28
bool exceeds_float_limit(const H5::DataSet &data, std::size_t precision)
Definition exceeds_limit.hpp:137
Helper functions for ArtifactDB parsing and validation.
Definition Pointer.hpp:21