From 510c397d2b248843fdbb0ecb1cf01482c129741f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gro=C3=9Fhauser?= Date: Thu, 19 Feb 2015 12:30:57 +0100 Subject: [PATCH] minor cleanup --- h5read.cc | 6 +----- h5read.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/h5read.cc b/h5read.cc index d7e1077..0dd57b4 100644 --- a/h5read.cc +++ b/h5read.cc @@ -43,10 +43,6 @@ using namespace std; -#define ALLOC_HSIZE_INFZERO_TO_UNLIMITED 1 -#define ALLOC_HSIZE_INF_TO_ZERO 2 -#define ALLOC_HSIZE_DEFAULT 3 - #if ((H5_VERS_MAJOR > 1) || (H5_VERS_MINOR >= 8)) // define this in case there is no configure script at work. This // should not be necessary any more when integrated into core. @@ -598,7 +594,7 @@ H5File::~H5File() // T will be Matrix or dim_vector template hsize_t* -alloc_hsize(const T& dim, const int inf_zero_treatment_mode) +H5File::alloc_hsize(const T& dim, const int inf_zero_treatment_mode) { int rank = dim.length(); hsize_t *hsize = (hsize_t*)malloc(rank * sizeof(hsize_t)); diff --git a/h5read.h b/h5read.h index 90e6e9f..f72d98b 100644 --- a/h5read.h +++ b/h5read.h @@ -1,8 +1,8 @@ /* * - * Copyright 2012 Tom Mullins - * Copyright 2015 Stefan Großhauser - * + * Copyright (C) 2012 Tom Mullins + * Copyright (C) 2015 Tom Mullins, Thorsten Liebig, Stefan Großhauser + * * This file is part of hdf5oct. * * hdf5oct is free software: you can redistribute it and/or modify @@ -62,6 +62,10 @@ H5File(const char *filename, const bool create_if_nonexisting); void create_dset(const char *location, const Matrix& size, const char *datatype, const Matrix& chunksize); private: + const static int ALLOC_HSIZE_INFZERO_TO_UNLIMITED = 1; + const static int ALLOC_HSIZE_INF_TO_ZERO = 2; + const static int ALLOC_HSIZE_DEFAULT = 3; + //rank of the hdf5 dataset int rank; //dimensions of the hdf5 dataset @@ -85,6 +89,9 @@ H5File(const char *filename, const bool create_if_nonexisting); octave_value read_dset(); hid_t hdf5_make_complex_type (hid_t num_type); + + template hsize_t* alloc_hsize(const T& dim, const int inf_zero_treatment_mode); + };