Main MRPT website > C++ reference for MRPT 1.9.9
integer_select.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 #include <cstdint>
13 
14 namespace mrpt
15 {
16 /** \addtogroup mrpt_int_select Templates to declare integers by byte count (in
17  * #include <mrpt/core/integer_select.h>)
18  * \ingroup mrpt_core_grp
19  * @{ */
20 
21 /** Usage: `int_select_by_bytecount<N>::type var;` allows defining var as a
22  * signed integer with, at least, N bytes. */
23 template <unsigned int num_bytes>
25 template <>
27 {
28  using type = int8_t;
29 };
30 template <>
32 {
33  using type = int16_t;
34 };
35 template <>
37 {
38  using type = int32_t;
39 };
40 template <>
42 {
43  using type = int32_t;
44 };
45 template <>
47 {
48  using type = int64_t;
49 };
50 
51 /** Usage: `uint_select_by_bytecount<N>::type var;` allows defining var as a
52  * unsigned integer with, at least, N bytes. */
53 template <unsigned int num_bytes>
55 template <>
57 {
58  using type = uint8_t;
59 };
60 template <>
62 {
63  using type = uint16_t;
64 };
65 template <>
67 {
68  using type = uint32_t;
69 };
70 template <>
72 {
73  using type = uint32_t;
74 };
75 template <>
77 {
78  using type = uint64_t;
79 };
80 
81 /** @} */
82 } // end of namespace
uint16_t
unsigned __int16 uint16_t
Definition: rptypes.h:44
int64_t
__int64 int64_t
Definition: rptypes.h:49
mrpt::int_select_by_bytecount< 4 >::type
int32_t type
Definition: integer_select.h:43
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::uint_select_by_bytecount< 2 >::type
uint16_t type
Definition: integer_select.h:63
int8_t
signed char int8_t
Definition: rptypes.h:40
int16_t
__int16 int16_t
Definition: rptypes.h:43
mrpt::int_select_by_bytecount
Usage: int_select_by_bytecount<N>type var; allows defining var as a signed integer with,...
Definition: integer_select.h:24
mrpt::int_select_by_bytecount< 1 >::type
int8_t type
Definition: integer_select.h:28
uint64_t
unsigned __int64 uint64_t
Definition: rptypes.h:50
mrpt::int_select_by_bytecount< 2 >::type
int16_t type
Definition: integer_select.h:33
mrpt::uint_select_by_bytecount< 1 >::type
uint8_t type
Definition: integer_select.h:58
mrpt::int_select_by_bytecount< 8 >::type
int64_t type
Definition: integer_select.h:48
mrpt::uint_select_by_bytecount< 3 >::type
uint32_t type
Definition: integer_select.h:68
int32_t
__int32 int32_t
Definition: rptypes.h:46
mrpt::uint_select_by_bytecount< 4 >::type
uint32_t type
Definition: integer_select.h:73
mrpt::uint_select_by_bytecount< 8 >::type
uint64_t type
Definition: integer_select.h:78
mrpt::int_select_by_bytecount< 3 >::type
int32_t type
Definition: integer_select.h:38
mrpt::uint_select_by_bytecount
Usage: uint_select_by_bytecount<N>type var; allows defining var as a unsigned integer with,...
Definition: integer_select.h:54
uint32_t
unsigned __int32 uint32_t
Definition: rptypes.h:47



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST