Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
types.h
Go to the documentation of this file.
1/*
2 * Software License Agreement (BSD License)
3 *
4 * Point Cloud Library (PCL) - www.pointclouds.org
5 * Copyright (c) 2020-, OpenPerception
6 *
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer in the documentation and/or other materials provided
18 * with the distribution.
19 * * Neither the name of the copyright holder(s) nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
44#pragma once
45
53#include <pcl/pcl_config.h>
54#include <pcl/pcl_macros.h>
55#include <vector>
56
57#include <cstdint>
58
59#include <Eigen/Core>
60
61namespace pcl
62{
63 namespace detail {
69 template <std::size_t Bits, bool Signed = true>
70 struct int_type { using type = void; };
71
76 template <std::size_t Bits, bool Signed = true>
78
79 template <>
80 struct int_type<8, true> { using type = std::int8_t; };
81 template <>
82 struct int_type<8, false> { using type = std::uint8_t; };
83 template <>
84 struct int_type<16, true> { using type = std::int16_t; };
85 template <>
86 struct int_type<16, false> { using type = std::uint16_t; };
87 template <>
88 struct int_type<32, true> { using type = std::int32_t; };
89 template <>
90 struct int_type<32, false> { using type = std::uint32_t; };
91 template <>
92 struct int_type<64, true> { using type = std::int64_t; };
93 template <>
94 struct int_type<64, false> { using type = std::uint64_t; };
95
104 constexpr std::uint8_t index_type_size = sizeof(int) * 8;
105
111 constexpr bool index_type_signed = true;
112} // namespace detail
113
120 static_assert(!std::is_void<index_t>::value, "`index_t` can't have type `void`");
121
128 static_assert(!std::is_signed<uindex_t>::value, "`uindex_t` must be unsigned");
129
133 template <typename T>
134 using AlignedVector = std::vector<T, Eigen::aligned_allocator<T>>;
135} // namespace pcl
constexpr bool index_type_signed
signed/unsigned nature of PCL's index type Please use PCL_INDEX_SIGNED when building PCL to choose a ...
Definition: types.h:111
typename int_type< Bits, Signed >::type int_type_t
helper type to use for int_type::type
Definition: types.h:77
constexpr std::uint8_t index_type_size
number of bits in PCL's index type
Definition: types.h:104
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
Definition: types.h:127
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
Definition: types.h:119
std::vector< T, Eigen::aligned_allocator< T > > AlignedVector
Type used for aligned vector of Eigen objects in PCL.
Definition: types.h:134
int_type::type refers to an integral type that satisfies template parameters
Definition: types.h:70