iRoCS Toolbox  1.1.0
StDataHdf5.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2004-2015 Olaf Ronneberger, Florian Pigorsch, Jörg Mechnich,
4  * Thorsten Falk
5  *
6  * Image Analysis Lab, University of Freiburg, Germany
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  **************************************************************************/
23 
24 /**************************************************************************
25 ** Title:
26 ** $RCSfile: $
27 ** $Revision: $$Name: $
28 ** $Date: $
29 ** Copyright: GPL $Author: $
30 ** Description:
31 **
32 **
33 **
34 **-------------------------------------------------------------------------
35 **
36 ** $Log: $
37 **
38 **
39 **************************************************************************/
40 
41 #ifndef STDATAHDF5_HH
42 #define STDATAHDF5_HH
43 
44 #ifdef HAVE_CONFIG_H
45 #include <config.hh>
46 #endif
47 
48 #include <string>
49 #include <cstring>
50 #include <valarray>
51 
52 #include <hdf5.h>
53 #include <H5Cpp.h>
54 
55 #include "SVMError.hh"
56 #include "SvmH5Type.hh"
57 #include "svt_check/RequireHelpers.hh" // for svt_check::avoidUnunsedVariableWarning();
58 
59 
60 namespace svt
61 {
62 
63  /*-----------------------------------------------------------------------
64  * conversion of c-data-types to Hdf5 data types
65  *-----------------------------------------------------------------------*/
66  template< typename DATATYPE>
68  {
69  typedef void value_type;
70  //NcType ncType() { return ncNoType; }
71  };
72 
73  // native types
74  template<> struct MyHdf5TypeTraits<unsigned char>
75  {
76  typedef unsigned char value_type;
77  //NcType ncType() { return ncByte; }
78  };
79 
80  template<> struct MyHdf5TypeTraits<char>
81  {
82  typedef char value_type;
83  //NcType ncType() { return ncChar; }
84  };
85 
86  template<> struct MyHdf5TypeTraits<short>
87  {
88  typedef short value_type;
89  //NcType ncType() { return ncShort; }
90  };
91 
92  template<> struct MyHdf5TypeTraits<int>
93  {
94  typedef int value_type;
95  //NcType ncType() { return ncInt; }
96  };
97 
98  template<> struct MyHdf5TypeTraits<long>
99  {
100  typedef int value_type;
101  //NcType ncType() { return ncInt; }
102  };
103 
104  template<> struct MyHdf5TypeTraits<float>
105  {
106  typedef float value_type;
107  //NcType ncType() { return ncFloat; }
108  };
109 
110  template<> struct MyHdf5TypeTraits<double>
111  {
112  typedef double value_type;
113  //NcType ncType() { return ncDouble; }
114  };
115 
116  // mappings of non-native netCDF types
117  template<> struct MyHdf5TypeTraits< unsigned int>
118  {
119  typedef int value_type;
120  //NcType ncType() { return ncInt; }
121  };
122 
123  template<> struct MyHdf5TypeTraits< bool>
124  {
125  typedef unsigned char value_type;
126  //NcType ncType() { return ncByte; }
127  };
128 
129  /*-------------------------------------------------------------------------
130  * set vec data
131  *-------------------------------------------------------------------------*/
132  template<typename T1, typename T2>
133  bool _setVecData(T1& , T2 ) {
134  return false;
135  }
136  template<>
137  inline bool _setVecData(char*& vect, char* rs) {
138  vect = (char*)malloc(strlen(rs));
139  if( vect == NULL) return false;
140  strcpy( vect, rs);
141  return true;
142  }
143  template<>
144  inline bool _setVecData(std::string& vect, char* rs) {
145  vect = std::string(rs);
146  return true;
147  }
148  template<>
149  inline bool _setVecData(char& value, char* rs) {
150  std::istringstream iss(rs);
151  iss >> value;
152  return !(iss.bad() || iss.fail());
153  }
154  template<>
155  inline bool _setVecData(short& value, char* rs) {
156  std::istringstream iss(rs);
157  iss >> value;
158  return !(iss.bad() || iss.fail());
159  }
160  template<>
161  inline bool _setVecData(unsigned short& value, char* rs) {
162  std::istringstream iss(rs);
163  iss >> value;
164  return !(iss.bad() || iss.fail());
165  }
166  template<>
167  inline bool _setVecData(int& value, char* rs) {
168  std::istringstream iss(rs);
169  iss >> value;
170  return !(iss.bad() || iss.fail());
171  }
172  template<>
173  inline bool _setVecData(unsigned int& value, char* rs) {
174  std::istringstream iss(rs);
175  iss >> value;
176  return !(iss.bad() || iss.fail());
177  }
178  template<>
179  inline bool _setVecData(long& value, char* rs) {
180  std::istringstream iss(rs);
181  iss >> value;
182  return !(iss.bad() || iss.fail());
183  }
184  template<>
185  inline bool _setVecData(unsigned long& value, char* rs) {
186  std::istringstream iss(rs);
187  iss >> value;
188  return !(iss.bad() || iss.fail());
189  }
190  template<>
191  inline bool _setVecData(long long& value, char* rs) {
192  std::istringstream iss(rs);
193  iss >> value;
194  return !(iss.bad() || iss.fail());
195  }
196  inline bool _setVecData(unsigned long long& value, char* rs) {
197  std::istringstream iss(rs);
198  iss >> value;
199  return !(iss.bad() || iss.fail());
200  }
201  template<>
202  inline bool _setVecData(float& value, char* rs) {
203  std::istringstream iss(rs);
204  iss >> value;
205  return !(iss.bad() || iss.fail());
206  }
207  template<>
208  inline bool _setVecData(double& value, char* rs) {
209  std::istringstream iss(rs);
210  iss >> value;
211  return !(iss.bad() || iss.fail());
212  }
213  template<>
214  inline bool _setVecData(long double& value, char* rs) {
215  std::istringstream iss(rs);
216  iss >> value;
217  return !(iss.bad() || iss.fail());
218  }
219 
220 
221  /*======================================================================*/
229  /*======================================================================*/
230  template<typename Hdf5FilePolicy>
231  class StDataHdf5Templ : public Hdf5FilePolicy
232  {
233  public:
234 
235  /*======================================================================*/
248  /*======================================================================*/
249  StDataHdf5Templ( const char * path,
250  unsigned int fm = H5F_ACC_RDONLY);
251  // H5F_ACC_RDWR write access
252 
253  /*======================================================================*/
258  /*======================================================================*/
260  :H5::H5File("",H5F_ACC_RDONLY)
261  {
263  err << "runtime error: you must not use StDataHdf5() "
264  "constructor without arguments!";
265  throw err;
266 
267  }
268 
269 
270  /*======================================================================*/
277  /*======================================================================*/
278  void setExceptionFlag( bool f)
279  {
280  _exceptionFlag = f;
281  }
282 
283 
284  /*======================================================================*/
288  /*======================================================================*/
289  bool exceptionFlag() const
290  {
291  return _exceptionFlag;
292  }
293 
294  /*======================================================================*/
302  /*======================================================================*/
303  bool valueExists( const std::string& key) const
304  {
305  return _existsAttribute(key,"");
306  }
307 
308  /*======================================================================*/
317  /*======================================================================*/
318  template<typename T>
319  void setValue( const std::string& key, const T& value);
320 
321  void setValue( const std::string& key, const std::string& value);
322  void setValue( const std::string& key, const char* value)
323  {
324  setValue(key,std::string(value));
325  }
326  void setValue( const char* key, const char* value)
327  {
328  setValue(std::string(key),std::string(value));
329  }
330  void setValue( const char* key, const std::string& value)
331  {
332  setValue(std::string(key),std::string(value));
333  }
334  void setValue( const std::string& key, const unsigned int& value);
335  void setValue( const std::string& key, const unsigned long& value);
336 
337  /*======================================================================*/
347  /*======================================================================*/
348  void setArray(
349  const std::string& key,
350  const std::vector<std::string>::iterator& arrBegin,
351  size_t size);
352  void setArray(
353  const std::string& key,
354  const std::vector<std::string>::const_iterator& arrBegin,
355  size_t size);
356 
357  template<typename ForwardIter>
358  void setArray( const std::string& key,
359  const ForwardIter& arrBegin,
360  size_t size);
361 
362  /*======================================================================*/
374  /*======================================================================*/
375  template<typename ForwardIter>
376  void setFVArray( const std::string& key,
377  const ForwardIter& arrBegin,
378  size_t size);
379 
380  /*======================================================================*/
394  /*======================================================================*/
395  template<typename T>
396  void getValue( const std::string& key, T& value) const;
397 
398  void getValue( const std::string& key, std::string& value) const;
399 
400 
401  /*======================================================================*/
409  /*======================================================================*/
410  size_t getArraySize( std::string key) const;
411  size_t getAttrArraySize( std::string key) const;
412 
413  /*======================================================================*/
423  /*======================================================================*/
424  size_t getFVArraySize( std::string key) const;
425 
426 
427  /*======================================================================*/
446  /*======================================================================*/
447  void getArray(
448  const std::string& key,
449  const std::vector<std::string>::iterator& arrBegin,
450  int containerSize=-1) const;
451  template<typename ForwardIter>
452  void getArray( const std::string& key, const ForwardIter& arrBegin,
453  int containerSize=-1) const;
454 
455  /*======================================================================*/
474  /*======================================================================*/
475  template<typename ForwardIter>
476  void getFVArray( const std::string& key, const ForwardIter& arrBegin,
477  int containerSize=-1) const;
478 
479  protected:
480 
481  template<typename DataT>
482  void
483  _writeAttribute( const DataT& val,
484  const std::string& attName,
485  const std::string& dsName);
486 
487  template<typename DataT>
488  void
489  _readAttribute( DataT& val,
490  const std::string& attName,
491  const std::string& dsName) const;
492 
493  void _deleteAttribute(const std::string &attName,
494  const std::string &dsName)
495  {
496  if (dsName != "") // dataset attribute
497  {
498  hid_t dataset = _getDataSet(dsName);
499  int status = H5Adelete(dataset, attName.c_str());
500  H5Dclose(dataset);
501  if (status < 0)
502  {
503  SaveError e;
504  e << "Could not delete Attribute "
505  << attName << " from dataset "
506  << dsName;
507  throw(e);
508  }
509  }
510  else // global attribute
511  {
512  hid_t group = _getGroup(dataSetGroup(attName));
513  int status = H5Adelete(group, dataSetName(attName).c_str());
514  H5Gclose(group);
515  if (status < 0)
516  {
517  SaveError e;
518  e << "Could not delete global Attribute " << attName;
519  throw(e);
520  }
521  }
522  }
523 
524  bool _existsAttribute(const std::string &attName,
525  const std::string &dsName) const
526  {
527  bool exists = false;
528  try
529  {
530  hid_t attribute = _getAttribute(attName, dsName);
531  H5Aclose(attribute);
532  exists = true;
533  }
534  catch (LoadError&)
535  {}
536 
537  return exists;
538  }
539 
540  bool _existsDataSet(const std::string &absName) const
541  {
542  bool found = false;
543  try
544  {
545  hid_t dataset = _getDataSet(absName);
546  H5Dclose(dataset);
547  found = true;
548  }
549  catch (LoadError&)
550  {}
551  return found;
552  }
553 
554  hid_t _getGroup(const std::string &groupName) const
555  {
556  hid_t group = H5Gopen2(
557  this->getLocId(), groupName.c_str(), H5P_DEFAULT);
558  if (group < 0)
559  {
560  LoadError e;
561  e << "Could not open group " << group;
562  throw(e);
563  }
564  return group;
565  }
566 
567  hid_t _getDataSet(const std::string &dsName) const
568  {
569  hid_t dataset = H5Dopen2(
570  this->getLocId(), dsName.c_str(), H5P_DEFAULT);
571  if (dataset < 0)
572  {
573  LoadError e;
574  e << "Could not open dataset " << dsName;
575  throw(e);
576  }
577  return dataset;
578  }
579 
580  hid_t _getAttribute(const std::string &attName,
581  const std::string &dsName) const
582  {
583  // get a file handle
584  hid_t attribute = -1;
585 
586  if (dsName != "") // Dataset attribute
587  {
588  hid_t dataset = -1;
589  try
590  {
591  dataset = _getDataSet(dsName);
592  attribute = H5Aopen_name(dataset, attName.c_str());
593  }
594  catch(...)
595  {
596  attribute = -1;
597  }
598  H5Dclose(dataset);
599  if (attribute < 0)
600  {
601  LoadError e;
602  e << "Could not retrieve attribute "
603  << attName << " from dataset "
604  << dsName << ". Attribute " << attName << " doesn't exist!";
605  throw(e);
606  }
607  }
608  else // global attribute
609  {
610  hid_t group = -1;
611  try
612  {
613  group = _getGroup(dataSetGroup(attName));
614  attribute = H5Aopen_name(group, dataSetName(attName).c_str());
615  }
616  catch(...)
617  {
618  attribute = -1;
619  }
620  H5Gclose(group);
621  if (attribute < 0)
622  {
623  LoadError e;
624  e << "Could not retrieve global attribute " << attName;
625  throw(e);
626  }
627  }
628  return attribute;
629  }
630 
631  std::string dataSetGroup(const std::string& dataSetDescriptor) const
632  {
633  // Dataset descriptor is free of group information
634  if (dataSetDescriptor.find("/") == std::string::npos)
635  {
636  return std::string("/");
637  }
638 
639  // Strip dataset name
640  return dataSetDescriptor.substr(0,
641  dataSetDescriptor.rfind("/") + 1);
642  }
643 
644  std::string dataSetName(const std::string& dataSetDescriptor) const
645  {
646  // Dataset descriptor is empty or ends with /
647  if (dataSetDescriptor.size() == 0 ||
648  dataSetDescriptor[dataSetDescriptor.size() - 1] == '/')
649  {
650  return std::string("");
651  }
652 
653  // Dataset descriptor is free of group information
654  if (dataSetDescriptor.find("/") == std::string::npos)
655  {
656  return dataSetDescriptor;
657  }
658 
659  // Strip group information
660  return dataSetDescriptor.substr(dataSetDescriptor.rfind("/") + 1);
661  }
662 
663  void _createGroup(const std::string& groupName)
664  {
665  std::vector<std::string> groupHierarchy;
666 
667  size_t beginPos = 1;
668  size_t delim = beginPos;
669  while(beginPos < groupName.size())
670  {
671  delim = groupName.find("/", beginPos);
672  std::string group = groupName.substr(0, delim + 1);
673  groupHierarchy.push_back(group);
674  beginPos = delim + 1;
675  }
676 
677  // create groups recursively
678  for(std::vector<std::string>::const_iterator
679  groupIt = groupHierarchy.begin();
680  groupIt != groupHierarchy.end();
681  ++groupIt)
682  {
683  if(!_existsGroup(groupIt->c_str()))
684  {
685  hid_t group = H5Gcreate2(
686  this->getLocId(), groupIt->c_str(), H5P_DEFAULT,
687  H5P_DEFAULT, H5P_DEFAULT);
688  if( group < 0)
689  {
690  SaveError e;
691  e << "Could not create group: '"
692  << groupIt->c_str() << "'.\n";
693  throw(e);
694  }
695  H5Gclose(group);
696  }
697  }
698  }
699 
700  bool _existsGroup(const std::string &groupName) const
701  {
702  bool exists = false;
703  try
704  {
705  hid_t group = _getGroup(groupName);
706  H5Gclose(group);
707  exists = true;
708  }
709  catch (LoadError&)
710  {}
711  return exists;
712  }
713 
714  static void getValue(
715  std::valarray<double> const &att, bool& value, size_t index)
716  {
717  value = static_cast<bool>(att[index]);
718  }
719 
720  static void getValue(
721  std::valarray<double> const &att, char& value, size_t index)
722  {
723  value = static_cast<char>(att[index]);
724  }
725 
726  static void getValue(
727  std::valarray<double> const &att, short& value, size_t index)
728  {
729  value = static_cast<short>(att[index]);
730  }
731 
732  static void getValue(
733  std::valarray<double> const &att, int& value, long index)
734  {
735  value = static_cast<int>(att[index]);
736  }
737 
738  static void getValue(
739  std::valarray<double> const &att, unsigned int& value, long index)
740  {
741  value = static_cast<unsigned int>(att[index]);
742  }
743 
744  static void getValue(
745  std::valarray<double> const &att, float& value, long index)
746  {
747  value = static_cast<float>(att[index]);
748  }
749 
750  static void getValue(
751  std::valarray<double> const &att, double& value, long index)
752  {
753  value = static_cast<double>(att[index]);
754  }
755 
756 /*-------------------------------------------------------------------------
757  * size and data of std::vector
758  *-------------------------------------------------------------------------*/
759  template<typename T>
760  inline hsize_t _getVecSize( const std::vector<T>& vect) const
761  {
762  return (hsize_t)vect.size();
763  }
764 
765  template<typename T>
766  inline void _setVecSize( std::vector<T>& vect, size_t size) const
767  {
768  vect.resize(size);
769  }
770 
771  template<typename T>
772  inline const T* _getVecData( const std::vector<T>& vect) const
773  {
774  return &(vect[0]);
775  }
776 
777  template<typename T>
778  inline T* _getVecData2( std::vector<T>& vect) const
779  {
780  return &(vect[0]);
781  }
782 /*-------------------------------------------------------------------------
783  * size and data of std::valarray
784  *-------------------------------------------------------------------------*/
785  template<typename T>
786  inline hsize_t _getVecSize( const std::valarray<T>& vect) const
787  {
788  return (hsize_t)vect.size();
789  }
790 
791  template<typename T>
792  inline void _setVecSize( std::valarray<T>& vect, size_t size) const
793  {
794  vect.resize(size);
795  }
796 
797  template<typename T>
798  inline const T* _getVecData( const std::valarray<T>& vect) const
799  {
800  return &(vect[0]);
801  }
802 
803  template<typename T>
804  inline T* _getVecData2( std::valarray<T>& vect) const
805  {
806  return &(vect[0]);
807  }
808 /*-------------------------------------------------------------------------
809  * size and data of std::string
810  *-------------------------------------------------------------------------*/
811  inline hsize_t _getVecSize( const std::string& vect) const
812  {
813  return (hsize_t)vect.size();
814  }
815 
816  inline void _setVecSize( std::string& vect, size_t size) const
817  {
818  vect.resize(size);
819  }
820 
821  inline const char* _getVecData( const std::string& vect) const
822  {
823  return vect.c_str();
824  }
825 
826  inline const char* _getVecData( const char*& vect) const
827  {
828  return vect;
829  }
830 
831 
832 /*-------------------------------------------------------------------------
833  * size and data of integral types
834  *-------------------------------------------------------------------------*/
835  template<typename T>
836  inline hsize_t _getVecSize( const T& ) const
837  {
838  return 1;
839  }
840 
841  template<typename T>
842  inline void _setVecSize( T& , size_t ) const
843  {
844  // do nothing
845  }
846 
847  template<typename T>
848  inline const T* _getVecData( const T& vect) const
849  {
850  return &vect;
851  }
852 
853  template<typename T>
854  inline T* _getVecData2( T& vect) const
855  {
856  return &vect;
857  }
858 
859  inline
860  std::string
862  {
863  std::string errorMsg;
864 
865 #if ! (defined(_WIN32) || defined(__APPLE__))
866  char *bp;
867  size_t size;
868  FILE *stream;
869 
870  // open_memstream is probably only available on Linux :-(
871  stream = open_memstream( &bp, &size);
872 
873  H5Eprint2(H5E_DEFAULT, stream);
874  //fflush( stream);
875  char ch;
876  while( (ch = static_cast<char>(fgetc( stream))) != EOF)
877  errorMsg += ch;
878  fclose( stream);
879 #endif
880  return errorMsg;
881  }
882 
883  class Buffer {
884  public:
885 
886  Buffer(const hid_t& dataSetType, const hsize_t size);
887  ~Buffer();
888 
889  void* ptr();
890 
891  inline void castToType(std::string *dest);
892 
893  template<typename T>
894  inline void castToType( T* dest);
895 
896  private:
897  template<typename T1, typename T2>
898  inline void _doRealCast( T1* dest);
899 
900  H5T_class_t _dataSetClass;
901  size_t _precision;
902  H5T_sign_t _isSigned;
903  size_t _size;
904  size_t _sizeOfbufferType;
905  void* _buffer_ptr;
906  }; // class Buffer
907 
908 // /*-------------------------------------------------------------------------
909 // * set vec data
910 // *-------------------------------------------------------------------------*/
911 // template<typename T1, typename T2>
912 // bool _setVecData(T1& , T2 ) {
913 // return false;
914 // }
915  private:
916  bool _exceptionFlag;
917  std::string _fileName;
918  std::string _varName;
919 
920  };
921 
923 
924 
925 }
926 
927 #include "StDataHdf5.icc"
928 #endif
const char * _getVecData(const std::string &vect) const
Definition: StDataHdf5.hh:821
bool exceptionFlag() const
Definition: StDataHdf5.hh:289
bool _existsGroup(const std::string &groupName) const
Definition: StDataHdf5.hh:700
void setValue(const char *key, const std::string &value)
Definition: StDataHdf5.hh:330
const T * _getVecData(const T &vect) const
Definition: StDataHdf5.hh:848
static void getValue(std::valarray< double > const &att, double &value, long index)
Definition: StDataHdf5.hh:750
hid_t _getAttribute(const std::string &attName, const std::string &dsName) const
Definition: StDataHdf5.hh:580
T * _getVecData2(T &vect) const
Definition: StDataHdf5.hh:854
void _setVecSize(std::vector< T > &vect, size_t size) const
Definition: StDataHdf5.hh:766
const T * _getVecData(const std::valarray< T > &vect) const
Definition: StDataHdf5.hh:798
std::string dataSetGroup(const std::string &dataSetDescriptor) const
Definition: StDataHdf5.hh:631
void setValue(const char *key, const char *value)
Definition: StDataHdf5.hh:326
void _setVecSize(T &, size_t) const
Definition: StDataHdf5.hh:842
static void getValue(std::valarray< double > const &att, float &value, long index)
Definition: StDataHdf5.hh:744
std::string dataSetName(const std::string &dataSetDescriptor) const
Definition: StDataHdf5.hh:644
bool _setVecData(T1 &, T2)
Definition: StDataHdf5.hh:133
bool _existsDataSet(const std::string &absName) const
Definition: StDataHdf5.hh:540
static void getValue(std::valarray< double > const &att, char &value, size_t index)
Definition: StDataHdf5.hh:720
static void getValue(std::valarray< double > const &att, int &value, long index)
Definition: StDataHdf5.hh:732
const char * _getVecData(const char *&vect) const
Definition: StDataHdf5.hh:826
StDataHdf5Templ()
this constructor is only for compilation of some template classes.
Definition: StDataHdf5.hh:259
T * _getVecData2(std::vector< T > &vect) const
Definition: StDataHdf5.hh:778
void setValue(const std::string &key, const char *value)
Definition: StDataHdf5.hh:322
T * _getVecData2(std::valarray< T > &vect) const
Definition: StDataHdf5.hh:804
hsize_t _getVecSize(const std::vector< T > &vect) const
Definition: StDataHdf5.hh:760
hsize_t _getVecSize(const T &) const
Definition: StDataHdf5.hh:836
void _createGroup(const std::string &groupName)
Definition: StDataHdf5.hh:663
bool valueExists(const std::string &key) const
check wether a value exists for requested key
Definition: StDataHdf5.hh:303
const T * _getVecData(const std::vector< T > &vect) const
Definition: StDataHdf5.hh:772
void _setVecSize(std::string &vect, size_t size) const
Definition: StDataHdf5.hh:816
bool _existsAttribute(const std::string &attName, const std::string &dsName) const
Definition: StDataHdf5.hh:524
static void getValue(std::valarray< double > const &att, short &value, size_t index)
Definition: StDataHdf5.hh:726
std::string _getErrorMsg()
Definition: StDataHdf5.hh:861
void _deleteAttribute(const std::string &attName, const std::string &dsName)
Definition: StDataHdf5.hh:493
hid_t _getGroup(const std::string &groupName) const
Definition: StDataHdf5.hh:554
hid_t _getDataSet(const std::string &dsName) const
Definition: StDataHdf5.hh:567
hsize_t _getVecSize(const std::string &vect) const
Definition: StDataHdf5.hh:811
void setExceptionFlag(bool f)
Specify, if getValue() should throw expcetions for unknown keys.
Definition: StDataHdf5.hh:278
void _setVecSize(std::valarray< T > &vect, size_t size) const
Definition: StDataHdf5.hh:792
static void getValue(std::valarray< double > const &att, bool &value, size_t index)
Definition: StDataHdf5.hh:714
StDataHdf5Templ< H5::H5File > StDataHdf5
Definition: StDataHdf5.hh:922
static void getValue(std::valarray< double > const &att, unsigned int &value, long index)
Definition: StDataHdf5.hh:738
hsize_t _getVecSize(const std::valarray< T > &vect) const
Definition: StDataHdf5.hh:786