#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 第 190 行定义.
192 : node_(node),
193 service_name_(service_name),
195 func_(nullptr) {
197 const std::shared_ptr<const message::PyMessageWrap>& request,
198 std::shared_ptr<message::PyMessageWrap>& response) {
199 response = this->cb(request);
200 };
201 service_ =
202 node_->
CreateService<message::PyMessageWrap, message::PyMessageWrap>(
204 }
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 第 208 行定义.
208 {
209 std::string msg("");
210 if (!request_cache_.empty()) {
211 msg = std::move(request_cache_.front());
212 request_cache_.pop_front();
213 }
214 return msg;
215 }
◆ 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 第 217 行定义.
217 {
218 response_cache_.push_back(data);
220 }
该类的文档由以下文件生成: