#include <py_cyber.h>
◆ PyService()
| apollo::cyber::PyService::PyService |
( |
const std::string & |
service_name, |
|
|
const std::string & |
data_type, |
|
|
Node * |
node |
|
) |
| |
|
inline |
在文件 py_cyber.h 第 189 行定义.
191 : node_(node),
192 service_name_(service_name),
194 func_(nullptr) {
196 const std::shared_ptr<const message::PyMessageWrap>& request,
197 std::shared_ptr<message::PyMessageWrap>& response) {
198 response = this->cb(request);
199 };
200 service_ =
201 node_->
CreateService<message::PyMessageWrap, message::PyMessageWrap>(
203 }
auto CreateService(const std::string &service_name, const typename Service< Request, Response >::ServiceCallback &service_callback) -> std::shared_ptr< Service< Request, Response > >
Create a Service object with specific service_name
◆ read()
| std::string apollo::cyber::PyService::read |
( |
| ) |
|
|
inline |
在文件 py_cyber.h 第 207 行定义.
207 {
208 std::string msg("");
209 if (!request_cache_.empty()) {
210 msg = std::move(request_cache_.front());
211 request_cache_.pop_front();
212 }
213 return msg;
214 }
◆ register_func()
| void apollo::cyber::PyService::register_func |
( |
int(*)(const char *) |
func | ) |
|
|
inline |
◆ write()
| int apollo::cyber::PyService::write |
( |
const std::string & |
data | ) |
|
|
inline |
在文件 py_cyber.h 第 216 行定义.
216 {
217 response_cache_.push_back(data);
219 }
该类的文档由以下文件生成: