17 const std::string
FILE_NAME(
"read_write_scalar.h5");
29 int perfect_number = 42;
36 dataset.
write(perfect_number);
42 int potentially_perfect_number;
44 dataset.
read(potentially_perfect_number);
46 std::cout <<
"perfect number: " << potentially_perfect_number
51 std::cerr << err.
what() << std::endl;
void read(T &array) const
static DataSpace From(const ScalarValue &scalar_value)
const std::string FILE_NAME("read_write_scalar.h5")
void write(const T &buffer)
static const int ReadWrite
Open flag: Read Write access.
static const int Truncate
Open flag: Truncate a file if already existing.
const std::string DATASET_NAME("single_scalar")
const char * what() const override
get the current exception error message
Basic HighFive Exception class.
DataSet createDataSet(const std::string &dataset_name, const DataSpace &space, const DataType &type, const DataSetCreateProps &createProps=DataSetCreateProps(), const DataSetAccessProps &accessProps=DataSetAccessProps())
createDataSet Create a new dataset in the current file of datatype type and of size space ...
static const int Create
Open flag: Create non existing file.