Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
H5Traits.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "HDF5Utils/H5Traits.h"
5 
6 #include "H5Cpp.h"
7 
8 namespace H5Utils {
9  namespace internal {
10 
11  // bool is a special case, we need to define it with a more
12  // complicated function
14 
15  typedef H5::PredType PT;
16  const H5::DataType H5Traits<int>::type = PT::NATIVE_INT;
17  const H5::DataType H5Traits<long>::type = PT::NATIVE_LONG;
18  const H5::DataType H5Traits<long long>::type = PT::NATIVE_LLONG;
19  const H5::DataType H5Traits<unsigned long>::type = PT::NATIVE_ULONG;
20  const H5::DataType H5Traits<unsigned long long>::type = PT::NATIVE_ULLONG;
21  const H5::DataType H5Traits<unsigned int>::type = PT::NATIVE_UINT;
22  const H5::DataType H5Traits<unsigned char>::type = PT::NATIVE_UCHAR;
23  const H5::DataType H5Traits<char>::type = PT::NATIVE_CHAR;
24  const H5::DataType H5Traits<float>::type = PT::NATIVE_FLOAT;
25  const H5::DataType H5Traits<double>::type = PT::NATIVE_DOUBLE;
27  const H5::DataType H5Traits<short>::type = PT::NATIVE_SHORT;
28  const H5::DataType H5Traits<unsigned short>::type = PT::NATIVE_USHORT;
29 
30  // define the spaciel bool case
32  bool TRUE = true;
33  bool FALSE = false;
34  H5::EnumType btype(sizeof(bool));
35  btype.insert("TRUE", &TRUE);
36  btype.insert("FALSE", &FALSE);
37  return btype;
38  }
39 
40  }
41 }
H5Utils::internal::H5Traits
We have lots of code to get around HDF5's rather weak typing.
Definition: H5Traits.h:54
H5Utils::internal::get_bool_type
H5::DataType get_bool_type()
Definition: H5Traits.cxx:31
jet::ExtendedBool::TRUE
@ TRUE
Definition: UncertaintyEnum.h:234
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
H5Traits.h
H5Utils
HDF5 Tuple Writer.
Definition: common.h:20
H5Utils::internal::PT
H5::PredType PT
Definition: H5Traits.cxx:15
jet::ExtendedBool::FALSE
@ FALSE
Definition: UncertaintyEnum.h:233