CARLA
 
载入中...
搜索中...
未找到
TimeoutException.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/// @file
9/// 包含TimeoutException类的声明,该类继承自std::runtime_error,用于表示超时异常
10#include "carla/Time.h"///< 引入CARLA的时间处理相关类和函数
11
12#include <stdexcept>///< 引入标准异常类
13#include <string>///< 引入字符串类
14
15namespace carla {
16namespace client {
17 /// @brief 表示客户端操作超时的异常类。
18 /// @details 该类继承自std::runtime_error,用于在客户端操作超过指定时间限制时抛出异常。
19 /// 异常中包含了发生超时的端点信息和超时时长。
20 class TimeoutException : public std::runtime_error {
21 public:
22 /// @brief 构造函数。
23 /// @param endpoint 发生超时的端点信息。
24 /// @param timeout 超时时长,类型为carla::Time::time_duration。
25 /// @details 构造函数初始化基类std::runtime_error的what()方法返回的消息,
26 /// 并保存端点信息和超时时长作为异常的一部分。
27 explicit TimeoutException(
28 const std::string &endpoint,///< 端点信息
29 time_duration timeout);///< 超时时长
30 };
31
32} // namespace client
33} // namespace carla
表示客户端操作超时的异常类。
TimeoutException(const std::string &endpoint, time_duration timeout)
构造函数。
Positive time duration up to milliseconds resolution.
Definition Time.h:19
CARLA模拟器的主命名空间。
Definition Carla.cpp:139
包含CARLA客户端相关类和函数的命名空间。