h5cpp  0.5.2
A modern C++ wrapper for the HDF5 C library
integer.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2017 DESY,ESS
3 //
4 // This file is part of h5cpp.
5 //
6 // This library is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published
8 // by the Free Software Foundation; either version 2.1 of the License, or
9 // (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the
18 // Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
19 // Boston, MA 02110-1301 USA
20 // ===========================================================================
21 //
22 // Authors:
23 // Eugen Wintersberger <eugen.wintersberger@desy.de>
24 // Martin Shetty <martin.shetty@esss.se>
25 // Jan Kotanski <jan.kotanski@desy.de>
26 // Created on: Aug 23, 2017
27 //
28 #pragma once
29 
30 #include <vector>
31 #include <type_traits>
33 #include <h5cpp/core/windows.hpp>
34 
35 namespace hdf5 {
36 namespace datatype {
37 
41 class DLL_EXPORT Integer : public Datatype {
42  public:
49  Integer() = default;
50 
60  Integer(ObjectHandle &&handle);
61 
78  Integer(const Datatype &datatype);
79 
85  virtual bool is_signed() const;
86 
92  virtual void make_signed(bool sign) const;
93 
99  virtual size_t precision() const;
100 
106  virtual void precision(size_t precision) const;
107 
113  virtual size_t offset() const;
114 
120  virtual void offset(size_t offset) const;
121 
127  virtual Order order() const;
128 
134  virtual void order(Order offset) const;
135 
141  virtual const std::vector<Pad> pad() const;
142 
150  virtual void pad(Pad lsb, Pad msb) const;
151 };
152 
153 } // namespace datatype
154 } // namespace hdf5
Wrapper for hid_t object identifiers.
Definition: object_handle.hpp:67
base class for all data types
Definition: datatype.hpp:42
HDF5 integer datatype.
Definition: integer.hpp:41
virtual void offset(size_t offset) const
set the bit offset of the first significant bit
virtual void pad(Pad lsb, Pad msb) const
set the pads of datatype
Integer(ObjectHandle &&handle)
Construct from object handle.
virtual size_t precision() const
get the precision of type, i.e. the number of significant bits
virtual size_t offset() const
get the bit offset of the first significant bit
virtual const std::vector< Pad > pad() const
get the pads of datatype
virtual bool is_signed() const
Retrieves the sign type for an integer type.
Integer()=default
Default constructor.
virtual void order(Order offset) const
set the order of datatype
virtual void make_signed(bool sign) const
Sets the sign property for an integer type.
Integer(const Datatype &datatype)
Copy construction from a Datatype instance.
virtual void precision(size_t precision) const
set the precision of a type, i.e. the number of significant bits
virtual Order order() const
get the order of datatype
Order
enumeration type for byte order
Definition: types.hpp:81
Pad
enumeration for floating point padding
Definition: types.hpp:138
top-level namespace of the entire library
Definition: attribute.hpp:45
#define DLL_EXPORT
Definition: windows.hpp:29