#include <py_cyber.h>
◆ PyClient()
| apollo::cyber::PyClient::PyClient |
( |
const std::string & |
name, |
|
|
const std::string & |
data_type, |
|
|
Node * |
node |
|
) |
| |
|
inline |
在文件 py_cyber.h 第 256 行定义.
257 : node_(node), service_name_(name), data_type_(
data_type) {
258 client_ =
259 node_->
CreateClient<message::PyMessageWrap, message::PyMessageWrap>(
260 name);
261 }
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 第 263 行定义.
263 {
264 std::shared_ptr<message::PyMessageWrap> m;
265 m.reset(new message::PyMessageWrap(request, data_type_));
266
267 auto response = client_->SendRequest(m);
268 if (response == nullptr) {
269 AINFO <<
"SendRequest:response is null";
270 return std::string("");
271 }
272 response->ParseFromString(response->data());
273
274 return response->data();
275 }
该类的文档由以下文件生成: