1#ifndef RITSUKO_HDF5_FORBID_LARGE_INTEGERS_HPP
2#define RITSUKO_HDF5_FORBID_LARGE_INTEGERS_HPP
28 if (itype.getSign() == H5T_SGN_NONE) {
30 return (itype.getPrecision() >= precision);
32 return (itype.getPrecision() > precision);
36 return (itype.getPrecision() > precision);
53 if (handle.getTypeClass() != H5T_INTEGER) {
56 H5::IntType itype(handle);
70 if (handle.getTypeClass() != H5T_INTEGER) {
79inline bool exceeds_float_limit_by_integer(
const H5::IntType& itype,
size_t precision) {
80 if (precision >= 64) {
82 }
else if (precision >= 32) {
89inline bool exceeds_float_limit_by_float(
const H5::FloatType& ftype,
size_t precision) {
91 if (precision >= 64) {
93 ftype == H5::PredType::IEEE_F64LE ||
94 ftype == H5::PredType::IEEE_F64BE ||
95 ftype == H5::PredType::IEEE_F32LE ||
96 ftype == H5::PredType::IEEE_F32BE
98 }
else if (precision >= 32) {
100 ftype == H5::PredType::IEEE_F32LE ||
101 ftype == H5::PredType::IEEE_F32BE
128 auto tclass = handle.getTypeClass();
129 if (tclass == H5T_INTEGER) {
130 return exceeds_float_limit_by_integer(H5::IntType(handle), precision);
131 }
else if (tclass == H5T_FLOAT) {
132 return exceeds_float_limit_by_float(H5::FloatType(handle), precision);
148 auto tclass = handle.getTypeClass();
149 if (tclass == H5T_INTEGER) {
150 return exceeds_float_limit_by_integer(handle.getIntType(), precision);
151 }
else if (tclass == H5T_FLOAT) {
152 return exceeds_float_limit_by_float(handle.getFloatType(), precision);
bool exceeds_integer_limit(const H5::IntType &itype, size_t precision, bool is_signed)
Definition exceeds_limit.hpp:27
bool exceeds_float_limit(const H5::DataSet &handle, size_t precision)
Definition exceeds_limit.hpp:127
Assorted helper functions for parsing and validation.
Definition choose_missing_placeholder.hpp:15