CARLA
 
载入中...
搜索中...
未找到
rpc/Client.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
10
11#include <rpc/client.h>
12
13namespace carla {
14namespace rpc {
15
16 class Client {
17 public:
18
19 template <typename... Args>
20 explicit Client(Args &&... args)
21 : _client(std::forward<Args>(args)...) {}
22
23 void set_timeout(int64_t value) {
24 _client.set_timeout(value);
25 }
26
27 auto get_timeout() const {
28 return _client.get_timeout();
29 }
30
31 template <typename... Args>
32 auto call(const std::string &function, Args &&... args) {
33 return _client.call(function, Metadata::MakeSync(), std::forward<Args>(args)...);
34 }
35
36 template <typename... Args>
37 void async_call(const std::string &function, Args &&... args) {
38 _client.async_call(function, Metadata::MakeAsync(), std::forward<Args>(args)...);
39 }
40
41 private:
42
43 ::rpc::client _client;
44 };
45
46} // namespace rpc
47} // namespace carla
::rpc::client _client
Definition rpc/Client.h:43
void async_call(const std::string &function, Args &&... args)
Definition rpc/Client.h:37
auto call(const std::string &function, Args &&... args)
Definition rpc/Client.h:32
Client(Args &&... args)
Definition rpc/Client.h:20
auto get_timeout() const
Definition rpc/Client.h:27
void set_timeout(int64_t value)
Definition rpc/Client.h:23
static Metadata MakeAsync()
Definition Metadata.h:24
static Metadata MakeSync()
Definition Metadata.h:20
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133