MRPT
2.0.1
mrpt
core
integer_select.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://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>
24
struct
int_select_by_bytecount
;
25
template
<>
26
struct
int_select_by_bytecount
<1>
27
{
28
using
type
= int8_t;
29
};
30
template
<>
31
struct
int_select_by_bytecount
<2>
32
{
33
using
type
= int16_t;
34
};
35
template
<>
36
struct
int_select_by_bytecount
<3>
37
{
38
using
type
= int32_t;
39
};
40
template
<>
41
struct
int_select_by_bytecount
<4>
42
{
43
using
type
= int32_t;
44
};
45
template
<>
46
struct
int_select_by_bytecount
<8>
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>
54
struct
uint_select_by_bytecount
;
55
template
<>
56
struct
uint_select_by_bytecount
<1>
57
{
58
using
type
= uint8_t;
59
};
60
template
<>
61
struct
uint_select_by_bytecount
<2>
62
{
63
using
type
= uint16_t;
64
};
65
template
<>
66
struct
uint_select_by_bytecount
<3>
67
{
68
using
type
= uint32_t;
69
};
70
template
<>
71
struct
uint_select_by_bytecount
<4>
72
{
73
using
type
= uint32_t;
74
};
75
template
<>
76
struct
uint_select_by_bytecount
<8>
77
{
78
using
type
= uint64_t;
79
};
80
81
/** @} */
82
}
// namespace mrpt
mrpt::int_select_by_bytecount< 4 >::type
int32_t type
Definition:
integer_select.h:43
mrpt::int_select_by_bytecount< 3 >::type
int32_t type
Definition:
integer_select.h:38
mrpt::int_select_by_bytecount< 1 >::type
int8_t type
Definition:
integer_select.h:28
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
mrpt::int_select_by_bytecount< 8 >::type
int64_t type
Definition:
integer_select.h:48
mrpt::uint_select_by_bytecount< 2 >::type
uint16_t type
Definition:
integer_select.h:63
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::uint_select_by_bytecount< 1 >::type
uint8_t type
Definition:
integer_select.h:58
mrpt::uint_select_by_bytecount< 3 >::type
uint32_t type
Definition:
integer_select.h:68
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::uint_select_by_bytecount< 4 >::type
uint32_t type
Definition:
integer_select.h:73
mrpt::int_select_by_bytecount< 2 >::type
int16_t type
Definition:
integer_select.h:33
mrpt::uint_select_by_bytecount< 8 >::type
uint64_t type
Definition:
integer_select.h:78
Page generated by
Doxygen 1.8.14
for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020