Apollo 10.0
自动驾驶开放平台
client.cc 文件参考
#include "modules/contrib/cyber_bridge/client.h"
#include <functional>
#include <memory>
#include <string>
#include <utility>
#include "boost/bind.hpp"
#include "cyber/common/log.h"
#include "cyber/message/protobuf_factory.h"
#include "modules/contrib/cyber_bridge/clients.h"
#include "modules/contrib/cyber_bridge/node.h"
client.cc 的引用(Include)关系图:

浏览源代码.

枚举

enum  { OP_REGISTER_DESC = 1 , OP_ADD_READER = 2 , OP_ADD_WRITER = 3 , OP_PUBLISH = 4 }
 Copyright (c) 2019 LG Electronics, Inc. 更多...
 

函数

void fill_data (std::vector< uint8_t > *data, const std::string &channel, const std::string &msg)
 

枚举类型说明

◆ anonymous enum

anonymous enum

Copyright (c) 2019 LG Electronics, Inc.

This software contains code licensed as described in LICENSE.

枚举值
OP_REGISTER_DESC 
OP_ADD_READER 
OP_ADD_WRITER 
OP_PUBLISH 

在文件 client.cc21 行定义.

21 {
23 OP_ADD_READER = 2,
24 OP_ADD_WRITER = 3,
25 OP_PUBLISH = 4,
26};
@ OP_ADD_WRITER
Definition client.cc:24
@ OP_PUBLISH
Definition client.cc:25
@ OP_REGISTER_DESC
Definition client.cc:22
@ OP_ADD_READER
Definition client.cc:23

函数说明

◆ fill_data()

void fill_data ( std::vector< uint8_t > *  data,
const std::string &  channel,
const std::string &  msg 
)

在文件 client.cc271 行定义.

272 {
273 data->reserve(data->size() + sizeof(uint8_t) + sizeof(uint32_t) +
274 channel.size() + sizeof(uint32_t) + msg.size());
275
276 data->push_back(OP_PUBLISH);
277
278 data->push_back(uint8_t(channel.size() >> 0));
279 data->push_back(uint8_t(channel.size() >> 8));
280 data->push_back(uint8_t(channel.size() >> 16));
281 data->push_back(uint8_t(channel.size() >> 24));
282 const uint8_t* channel_data =
283 reinterpret_cast<const uint8_t*>(channel.data());
284 data->insert(data->end(), channel_data, channel_data + channel.size());
285
286 data->push_back(uint8_t(msg.size() >> 0));
287 data->push_back(uint8_t(msg.size() >> 8));
288 data->push_back(uint8_t(msg.size() >> 16));
289 data->push_back(uint8_t(msg.size() >> 24));
290 const uint8_t* msg_data = reinterpret_cast<const uint8_t*>(msg.data());
291 data->insert(data->end(), msg_data, msg_data + msg.size());
292}