1#ifndef RITSUKO_HDF5_FORBID_LARGE_INTEGERS_HPP
2#define RITSUKO_HDF5_FORBID_LARGE_INTEGERS_HPP
30 const auto sign = itype.getSign();
31 if (sign == H5T_SGN_NONE) {
33 return (itype.getPrecision() >= precision);
35 return (itype.getPrecision() > precision);
37 }
else if (sign == H5T_SGN_2) {
39 return (itype.getPrecision() > precision);
63 if (data.getTypeClass() != H5T_INTEGER) {
66 H5::IntType itype(data);
83 if (attr.getTypeClass() != H5T_INTEGER) {
92inline bool exceeds_float_limit_by_integer(
const H5::IntType& itype, std::size_t precision) {
93 if (precision >= 64) {
95 }
else if (precision >= 32) {
102inline bool exceeds_float_limit_by_float(
const H5::FloatType& ftype, std::size_t precision) {
104 if (precision >= 64) {
106 ftype == H5::PredType::IEEE_F64LE ||
107 ftype == H5::PredType::IEEE_F64BE ||
108 ftype == H5::PredType::IEEE_F32LE ||
109 ftype == H5::PredType::IEEE_F32BE
111 }
else if (precision >= 32) {
113 ftype == H5::PredType::IEEE_F32LE ||
114 ftype == H5::PredType::IEEE_F32BE
146 auto tclass = data.getTypeClass();
147 if (tclass == H5T_INTEGER) {
148 return exceeds_float_limit_by_integer(H5::IntType(data), precision);
149 }
else if (tclass == H5T_FLOAT) {
150 return exceeds_float_limit_by_float(H5::FloatType(data), precision);
167 auto tclass = attr.getTypeClass();
168 if (tclass == H5T_INTEGER) {
169 return exceeds_float_limit_by_integer(attr.getIntType(), precision);
170 }
else if (tclass == H5T_FLOAT) {
171 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:29
bool exceeds_float_limit(const H5::DataSet &data, std::size_t precision)
Definition exceeds_limit.hpp:145
Helper functions for ArtifactDB parsing and validation.
Definition Pointer.hpp:22