Apollo 10.0
自动驾驶开放平台
underlay_message.cc
浏览该文件的文档.
1// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
24
25namespace apollo {
26namespace cyber {
27namespace transport {
28
29#define UnderlayMessage_max_cdr_typesize 276ULL;
30#define UnderlayMessage_max_key_cdr_typesize 0ULL;
31
33 m_timestamp = 0;
34 m_seq = 0;
35 m_data = "";
36}
37
39
41 m_timestamp = x.m_timestamp;
42 m_seq = x.m_seq;
43 m_data = x.m_data;
44}
45
47 m_timestamp = x.m_timestamp;
48 m_seq = x.m_seq;
49 m_data = std::move(x.m_data);
50}
51
53 m_timestamp = x.m_timestamp;
54 m_seq = x.m_seq;
55 m_data = x.m_data;
56
57 return *this;
58}
59
61 m_timestamp = x.m_timestamp;
62 m_seq = x.m_seq;
63 m_data = std::move(x.m_data);
64
65 return *this;
66}
67
68size_t UnderlayMessage::getMaxCdrSerializedSize(size_t current_alignment) {
70}
71
73 size_t current_alignment) {
74 size_t initial_alignment = current_alignment;
75
76 current_alignment +=
77 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
78
79 current_alignment +=
80 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
81
82 current_alignment += 4 +
83 eprosima::fastcdr::Cdr::alignment(current_alignment, 4) +
84 data.data().size() + 1;
85
86 return current_alignment - initial_alignment;
87}
88
89void UnderlayMessage::serialize(eprosima::fastcdr::Cdr& scdr) const {
90 scdr << m_timestamp;
91 scdr << m_seq;
92 scdr << m_data;
93}
94
95void UnderlayMessage::deserialize(eprosima::fastcdr::Cdr& dcdr) {
96 dcdr >> m_timestamp;
97 dcdr >> m_seq;
98 dcdr >> m_data;
99}
100
104
105bool UnderlayMessage::isKeyDefined() { return false; }
106
107void UnderlayMessage::serializeKey(eprosima::fastcdr::Cdr& scdr) const {
108 (void)scdr;
109}
110
111} // namespace transport
112} // namespace cyber
113} // namespace apollo
This class represents the structure UnderlayMessage defined by the user in the IDL file.
void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
static bool isKeyDefined()
This function tells you if the Key has been defined for this type
static size_t getCdrSerializedSize(const UnderlayMessage &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
static size_t getMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of an object depending on the buffer alignment.
void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
static size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
const std::string & data() const
This function returns a constant reference to member data
UnderlayMessage & operator=(const UnderlayMessage &x)
Copy assignment.
void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
class register implement
Definition arena_queue.h:37
#define UnderlayMessage_max_cdr_typesize
#define UnderlayMessage_max_key_cdr_typesize