CARLA
 
载入中...
搜索中...
未找到
Types.h
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8/**
9 * @file
10 * @brief 包含与Carla流处理相关的底层细节的头文件。
11 *
12 * 此文件定义了一些与Carla流处理相关的底层类型和静态断言,确保类型一致性。
13 */
14#include "carla/Buffer.h"// @brief 引入Carla的Buffer类定义。
15
16#include <cstdint>// @brief 引入标准整数类型定义。
17#include <type_traits>// @brief 引入类型特征库,用于类型检查和转换。
18 /**
19 * @namespace carla::streaming::detail
20 * @brief Carla流处理模块中的底层细节命名空间。
21 *
22 * 该命名空间包含了Carla流处理模块中不希望被外部直接访问的底层实现细节。
23 */
24namespace carla {
25namespace streaming {
26namespace detail {
27 /**
28 * @typedef stream_id_type
29 * @brief 流ID的类型定义。
30 *
31 * 使用uint32_t作为流ID的类型,以确保跨平台的类型一致性。
32 */
33 using stream_id_type = uint32_t;
34 /**
35 * @typedef message_size_type
36 * @brief 消息大小的类型定义。
37 *
38 * 使用uint32_t作为消息大小的类型,以确保跨平台的类型一致性。
39 */
40 using message_size_type = uint32_t;
41 /**
42 * @brief 静态断言,确保message_size_type与Buffer::size_type类型一致。
43 *
44 * 此静态断言用于在编译时检查message_size_type是否与Buffer类中的size_type类型相同,
45 * 如果不相同,则编译失败并显示错误信息"uint type mismatch!"。
46 */
47 static_assert(
48 std::is_same<message_size_type, Buffer::size_type>::value,
49 "uint type mismatch!");// @brief 错误信息:如果类型不匹配,则显示此信息。
50
51} // namespace detail
52} // namespace streaming
53} // namespace carla
uint32_t stream_id_type
流ID的类型定义。
Definition Types.h:33
uint32_t message_size_type
消息大小的类型定义。
Definition Types.h:40
CARLA模拟器的主命名空间。
Definition Carla.cpp:139