ATLAS Offline Software
Loading...
Searching...
No Matches
H5Traits.h
Go to the documentation of this file.
1// this is -*- C++ -*-
2/*
3 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
4*/
5
6#ifndef H5_TRAITS_H
7#define H5_TRAITS_H
8
15
16
17namespace H5 {
18 class DataType;
19}
20
21namespace H5Utils {
22
25
26 namespace internal {
27
34 {
35 int u_int;
36 long u_long;
37 long long u_llong;
38 unsigned long u_ulong;
39 unsigned long long u_ullong;
40 unsigned int u_uint;
41 unsigned char u_uchar;
42 char u_char;
43 float u_float;
44 double u_double;
45 bool u_bool;
46 short u_short;
47 unsigned short u_ushort;
48 };
49
54 template <typename T> struct H5Traits;
55 template <> struct H5Traits<int> {
56 static const H5::DataType type;
57 static int& ref(data_buffer_t& buf) { return buf.u_int; }
58 };
59 template <> struct H5Traits<long> {
60 static const H5::DataType type;
61 static long& ref(data_buffer_t& buf) { return buf.u_long; }
62 };
63 template <> struct H5Traits<long long> {
64 static const H5::DataType type;
65 static long long& ref(data_buffer_t& buf) { return buf.u_llong; }
66 };
67 template <> struct H5Traits<unsigned long> {
68 static const H5::DataType type;
69 static unsigned long& ref(data_buffer_t& buf) { return buf.u_ulong; }
70 };
71 template <> struct H5Traits<unsigned long long> {
72 static const H5::DataType type;
73 static unsigned long long& ref(data_buffer_t& buf) { return buf.u_ullong; }
74 };
75 template <> struct H5Traits<unsigned int> {
76 static const H5::DataType type;
77 static unsigned int& ref(data_buffer_t& buf) { return buf.u_uint; }
78 };
79 template <> struct H5Traits<unsigned char> {
80 static const H5::DataType type;
81 static unsigned char& ref(data_buffer_t& buf) { return buf.u_uchar; }
82 };
83 template <> struct H5Traits<char> {
84 static const H5::DataType type;
85 static char& ref(data_buffer_t& buf) { return buf.u_char; }
86 };
87 template <> struct H5Traits<float> {
88 static const H5::DataType type;
89 static float& ref(data_buffer_t& buf) { return buf.u_float; }
90 };
91 template <> struct H5Traits<double> {
92 static const H5::DataType type;
93 static double& ref(data_buffer_t& buf) { return buf.u_double; }
94 };
95 template <> struct H5Traits<bool> {
96 static const H5::DataType type;
97 static bool& ref(data_buffer_t& buf) { return buf.u_bool; }
98 };
99 template <> struct H5Traits<short> {
100 static const H5::DataType type;
101 static short& ref(data_buffer_t& buf) { return buf.u_short; }
102 };
103 template <> struct H5Traits<unsigned short> {
104 static const H5::DataType type;
105 static unsigned short& ref(data_buffer_t& buf) { return buf.u_ushort; }
106 };
107
108 }
110}
111
112#endif
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
clssses to add type traits for H5
Definition common.h:21
HDF5 Tuple Writer.
Definition common.h:20
HDF5 Traits.
static bool & ref(data_buffer_t &buf)
Definition H5Traits.h:97
static const H5::DataType type
Definition H5Traits.h:96
static char & ref(data_buffer_t &buf)
Definition H5Traits.h:85
static const H5::DataType type
Definition H5Traits.h:84
static const H5::DataType type
Definition H5Traits.h:92
static double & ref(data_buffer_t &buf)
Definition H5Traits.h:93
static float & ref(data_buffer_t &buf)
Definition H5Traits.h:89
static const H5::DataType type
Definition H5Traits.h:88
static const H5::DataType type
Definition H5Traits.h:56
static int & ref(data_buffer_t &buf)
Definition H5Traits.h:57
static long & ref(data_buffer_t &buf)
Definition H5Traits.h:61
static const H5::DataType type
Definition H5Traits.h:60
static const H5::DataType type
Definition H5Traits.h:64
static long long & ref(data_buffer_t &buf)
Definition H5Traits.h:65
static const H5::DataType type
Definition H5Traits.h:100
static short & ref(data_buffer_t &buf)
Definition H5Traits.h:101
static unsigned char & ref(data_buffer_t &buf)
Definition H5Traits.h:81
static unsigned int & ref(data_buffer_t &buf)
Definition H5Traits.h:77
static unsigned long & ref(data_buffer_t &buf)
Definition H5Traits.h:69
static unsigned long long & ref(data_buffer_t &buf)
Definition H5Traits.h:73
static unsigned short & ref(data_buffer_t &buf)
Definition H5Traits.h:105
We have lots of code to get around HDF5's rather weak typing.
Definition H5Traits.h:54
unsigned long long u_ullong
Definition H5Traits.h:39