Apollo 10.0
自动驾驶开放平台
apollo::cyber::PyClient类 参考

#include <py_cyber.h>

apollo::cyber::PyClient 的协作图:

Public 成员函数

 PyClient (const std::string &name, const std::string &data_type, Node *node)
 
std::string send_request (std::string request)
 

详细描述

在文件 py_cyber.h255 行定义.

构造及析构函数说明

◆ PyClient()

apollo::cyber::PyClient::PyClient ( const std::string &  name,
const std::string &  data_type,
Node node 
)
inline

在文件 py_cyber.h257 行定义.

258 : node_(node), service_name_(name), data_type_(data_type) {
259 client_ =
260 node_->CreateClient<message::PyMessageWrap, message::PyMessageWrap>(
261 name);
262 }
auto CreateClient(const std::string &service_name) -> std::shared_ptr< Client< Request, Response > >
Create a Client object to request Service with service_name
Definition node.h:267

成员函数说明

◆ send_request()

std::string apollo::cyber::PyClient::send_request ( std::string  request)
inline

在文件 py_cyber.h264 行定义.

264 {
265 std::shared_ptr<message::PyMessageWrap> m;
266 m.reset(new message::PyMessageWrap(request, data_type_));
267
268 auto response = client_->SendRequest(m);
269 if (response == nullptr) {
270 AINFO << "SendRequest:response is null";
271 return std::string("");
272 }
273 response->ParseFromString(response->data());
274
275 return response->data();
276 }
#define AINFO
Definition log.h:42

该类的文档由以下文件生成: