#include <py_cyber.h>
◆ PyClient()
apollo::cyber::PyClient::PyClient |
( |
const std::string & |
name, |
|
|
const std::string & |
data_type, |
|
|
Node * |
node |
|
) |
| |
|
inline |
在文件 py_cyber.h 第 257 行定义.
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
◆ send_request()
std::string apollo::cyber::PyClient::send_request |
( |
std::string |
request | ) |
|
|
inline |
在文件 py_cyber.h 第 264 行定义.
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 }
该类的文档由以下文件生成: