#include <message_info.h>
|
static const std::size_t | kSize |
|
◆ MessageInfo() [1/4]
apollo::cyber::transport::MessageInfo::MessageInfo |
( |
| ) |
|
◆ MessageInfo() [2/4]
apollo::cyber::transport::MessageInfo::MessageInfo |
( |
const Identity & |
sender_id, |
|
|
uint64_t |
seq_num |
|
) |
| |
◆ MessageInfo() [3/4]
apollo::cyber::transport::MessageInfo::MessageInfo |
( |
const Identity & |
sender_id, |
|
|
uint64_t |
seq_num, |
|
|
const Identity & |
spare_id |
|
) |
| |
◆ MessageInfo() [4/4]
apollo::cyber::transport::MessageInfo::MessageInfo |
( |
const MessageInfo & |
another | ) |
|
在文件 message_info.cc 第 40 行定义.
41 : sender_id_(another.sender_id_),
42 channel_id_(another.channel_id_),
43 seq_num_(another.seq_num_),
44 spare_id_(another.spare_id_) {}
◆ ~MessageInfo()
apollo::cyber::transport::MessageInfo::~MessageInfo |
( |
| ) |
|
|
virtual |
◆ channel_id()
uint64_t apollo::cyber::transport::MessageInfo::channel_id |
( |
| ) |
const |
|
inline |
◆ DeserializeFrom() [1/2]
bool apollo::cyber::transport::MessageInfo::DeserializeFrom |
( |
const char * |
src, |
|
|
std::size_t |
len |
|
) |
| |
在文件 message_info.cc 第 107 行定义.
107 {
110 AWARN <<
"src size mismatch, given[" << len <<
"] target[" <<
kSize <<
"]";
111 return false;
112 }
113
114 char* ptr = const_cast<char*>(src);
117 std::memcpy(
118 reinterpret_cast<char*>(&channel_id_), ptr, sizeof(channel_id_));
119 ptr += sizeof(channel_id_);
120 std::memcpy(
121 reinterpret_cast<char*>(&seq_num_), ptr, sizeof(seq_num_));
122 ptr += sizeof(seq_num_);
125 std::memcpy(
126 reinterpret_cast<char*>(&send_time_), ptr, sizeof(send_time_));
127 return true;
128}
void set_data(const char *data)
static const std::size_t kSize
#define RETURN_VAL_IF_NULL(ptr, val)
constexpr uint8_t ID_SIZE
◆ DeserializeFrom() [2/2]
bool apollo::cyber::transport::MessageInfo::DeserializeFrom |
( |
const std::string & |
src | ) |
|
◆ operator!=()
bool apollo::cyber::transport::MessageInfo::operator!= |
( |
const MessageInfo & |
another | ) |
const |
◆ operator=()
在文件 message_info.cc 第 48 行定义.
48 {
49 if (this != &another) {
50 sender_id_ = another.sender_id_;
51 channel_id_ = another.channel_id_;
52 seq_num_ = another.seq_num_;
53 spare_id_ = another.spare_id_;
54 }
55 return *this;
56}
◆ operator==()
bool apollo::cyber::transport::MessageInfo::operator== |
( |
const MessageInfo & |
another | ) |
const |
在文件 message_info.cc 第 58 行定义.
58 {
59 return sender_id_ == another.sender_id_ &&
60 channel_id_ == another.channel_id_ && seq_num_ == another.seq_num_ &&
61 spare_id_ == another.spare_id_;
62}
◆ send_time()
uint64_t apollo::cyber::transport::MessageInfo::send_time |
( |
| ) |
const |
|
inline |
◆ sender_id()
const Identity & apollo::cyber::transport::MessageInfo::sender_id |
( |
| ) |
const |
|
inline |
◆ seq_num()
uint64_t apollo::cyber::transport::MessageInfo::seq_num |
( |
| ) |
const |
|
inline |
◆ SerializeTo() [1/2]
bool apollo::cyber::transport::MessageInfo::SerializeTo |
( |
char * |
dst, |
|
|
std::size_t |
len |
|
) |
| const |
在文件 message_info.cc 第 82 行定义.
82 {
83 if (dst ==
nullptr || len <
kSize) {
84 return false;
85 }
86
87 char* ptr = dst;
90 std::memcpy(ptr,
91 reinterpret_cast<const char*>(&channel_id_), sizeof(channel_id_));
92 ptr += sizeof(channel_id_);
93 std::memcpy(ptr,
94 reinterpret_cast<const char*>(&seq_num_), sizeof(seq_num_));
95 ptr += sizeof(seq_num_);
98 std::memcpy(ptr,
99 reinterpret_cast<const char*>(&send_time_), sizeof(send_time_));
100 return true;
101}
const char * data() const
◆ SerializeTo() [2/2]
bool apollo::cyber::transport::MessageInfo::SerializeTo |
( |
std::string * |
dst | ) |
const |
在文件 message_info.cc 第 68 行定义.
68 {
70
72 dst->append(
73 reinterpret_cast<const char*>(&channel_id_), sizeof(channel_id_));
74 dst->append(
75 reinterpret_cast<const char*>(&seq_num_), sizeof(seq_num_));
77 dst->append(reinterpret_cast<const char*>(
78 &send_time_), sizeof(send_time_));
79 return true;
80}
◆ set_channel_id()
void apollo::cyber::transport::MessageInfo::set_channel_id |
( |
uint64_t |
channel_id | ) |
|
|
inline |
◆ set_send_time()
void apollo::cyber::transport::MessageInfo::set_send_time |
( |
uint64_t |
send_time | ) |
|
|
inline |
◆ set_sender_id()
void apollo::cyber::transport::MessageInfo::set_sender_id |
( |
const Identity & |
sender_id | ) |
|
|
inline |
◆ set_seq_num()
void apollo::cyber::transport::MessageInfo::set_seq_num |
( |
uint64_t |
seq_num | ) |
|
|
inline |
◆ set_spare_id()
void apollo::cyber::transport::MessageInfo::set_spare_id |
( |
const Identity & |
spare_id | ) |
|
|
inline |
◆ spare_id()
const Identity & apollo::cyber::transport::MessageInfo::spare_id |
( |
| ) |
const |
|
inline |
◆ kSize
const std::size_t apollo::cyber::transport::MessageInfo::kSize |
|
static |
初始值:
sizeof(uint64_t) + sizeof(int32_t) +
sizeof(uint64_t)
在文件 message_info.h 第 61 行定义.
该类的文档由以下文件生成: