chihaya
Validating delayed array operations in HDF5
Loading...
Searching...
No Matches
unary_special_check.hpp
Go to the documentation of this file.
1#ifndef CHIHAYA_UNARY_SPECIAL_CHECK_HPP
2#define CHIHAYA_UNARY_SPECIAL_CHECK_HPP
3
4#include "H5Cpp.h"
5#include "ritsuko/ritsuko.hpp"
6
7#include <stdexcept>
8#include <exception>
9
10#include "utils_public.hpp"
11#include "utils_misc.hpp"
12#include "utils_nary.hpp"
13
19namespace chihaya {
20
33inline ArrayDetails validate_unary_special_check(const H5::Group& group, const ritsuko::Version& version, const Options& options) {
34 ArrayDetails seed_details;
35 try {
36 auto shandle = group.openGroup("seed");
37 seed_details = validate_numeric_seed(shandle, version, options);
38 } catch (...) {
39 std::throw_with_nested(std::runtime_error("failed to validate 'seed'"));
40 }
41
42 try {
43 auto mhandle = group.openDataSet("method");
44 auto method = read_scalar_string_dataset(mhandle);
45 if (!options.details_only) {
46 if (!is_valid_special_check_operation(method)) {
47 throw std::runtime_error("unrecognized operation '" + method + "'");
48 }
49 }
50 } catch (...) {
51 std::throw_with_nested(std::runtime_error("failed to validate 'method'"));
52 }
53
54 seed_details.type = BOOLEAN;
55 return seed_details;
56}
57
58}
59
60#endif
Namespace for all chihaya functions.
Definition binary_arithmetic.hpp:21
ArrayDetails validate_unary_special_check(const H5::Group &group, const ritsuko::Version &version, const Options &options)
Definition unary_special_check.hpp:33
Details about an array.
Definition utils_public.hpp:38
ArrayType type
Definition utils_public.hpp:52
Options for validate().
Definition utils_public.hpp:79
bool details_only
Definition utils_public.hpp:84
Various public utilities.