pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
HeaderCdrAux.ipp
Go to the documentation of this file.
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
15/*!
16 * @file HeaderCdrAux.ipp
17 * This source file contains some declarations of CDR related functions.
18 *
19 * This file was generated by the tool fastddsgen.
20 */
21
22#ifndef FAST_DDS_GENERATED__STD_MSGS_MSG_HEADERCDRAUX_IPP
23#define FAST_DDS_GENERATED__STD_MSGS_MSG_HEADERCDRAUX_IPP
24
25#include "HeaderCdrAux.hpp"
26
27#include <fastcdr/Cdr.h>
29
30
32using namespace eprosima::fastcdr::exception;
33
34namespace eprosima {
35namespace fastcdr {
36
37template<>
40 const std_msgs::msg::Header& data,
41 size_t& current_alignment)
42{
43 using namespace std_msgs::msg;
44
45 static_cast<void>(data);
46
47 eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
48 size_t calculated_size {calculator.begin_calculate_type_serialized_size(
52 current_alignment)};
53
54
56 data.stamp(), current_alignment);
57
59 data.frame_id(), current_alignment);
60
61
62 calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
63
64 return calculated_size;
65}
66
67template<>
86
87template<>
91{
92 using namespace std_msgs::msg;
93
97 [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
98 {
99 bool ret_value = true;
100 switch (mid.id)
101 {
102 case 0:
103 dcdr >> data.stamp();
104 break;
105
106 case 1:
107 dcdr >> data.frame_id();
108 break;
109
110 default:
111 ret_value = false;
112 break;
113 }
114 return ret_value;
115 });
116}
117
120 const std_msgs::msg::Header& data)
121{
122 using namespace std_msgs::msg;
123 extern void serialize_key(
124 Cdr& scdr,
126
127
128
129 static_cast<void>(scdr);
130 static_cast<void>(data);
131 serialize_key(scdr, data.stamp());
132
133 scdr << data.frame_id();
134
135}
136
137
138
139} // namespace fastcdr
140} // namespace eprosima
141
142#endif // FAST_DDS_GENERATED__STD_MSGS_MSG_HEADERCDRAUX_IPP
143
#define eProsima_user_DllExport
Definition Header.hpp:37
This class offers an interface to calculate the encoded size of a type serialized using a support enc...
Cdr_DllAPI EncodingAlgorithmFlag get_encoding() const
Retrieves the current encoding algorithm used by the instance.
Cdr_DllAPI CdrVersion get_cdr_version() const
Retrieves the version of the encoding algorithm used by the instance.
Cdr_DllAPI size_t begin_calculate_type_serialized_size(EncodingAlgorithmFlag new_encoding, size_t &current_alignment)
Indicates a new constructed type will be calculated.
Cdr_DllAPI size_t end_calculate_type_serialized_size(EncodingAlgorithmFlag new_encoding, size_t &current_alignment)
Indicates the ending of a constructed type.
size_t calculate_member_serialized_size(const MemberId &id, const _T &data, size_t &current_alignment)
Generic template which calculates the encoded size of the constructed type's member of a unknown type...
This class stores the current state of a CDR serialization.
Definition Cdr.h:106
This class offers an interface to serialize/deserialize some basic types using CDR protocol inside an...
Definition Cdr.h:69
Cdr_DllAPI Cdr & begin_serialize_type(Cdr::state &current_state, EncodingAlgorithmFlag type_encoding)
Tells to the encoder a new type and its members starts to be encoded.
Definition Cdr.cpp:2234
Cdr_DllAPI Cdr & deserialize_type(EncodingAlgorithmFlag type_encoding, std::function< bool(Cdr &, const MemberId &)> functor)
Tells to the encoder a new type and its members starts to be decoded.
Definition Cdr.cpp:2247
Cdr_DllAPI CdrVersion get_cdr_version() const
Retrieves the CdrVersion used by the instance.
Definition Cdr.cpp:348
Cdr_DllAPI Cdr & end_serialize_type(Cdr::state &current_state)
Tells to the encoder the encoding of the type finishes.
Definition Cdr.cpp:2241
void serialize(Cdr &, const _T &)
size_t calculate_serialized_size(CdrSizeCalculator &, const _T &, size_t &)
EncodingAlgorithmFlag
This enumeration represents the supported XCDR encoding algorithms.
@ PLAIN_CDR
Specifies that the content is PLAIN_CDR.
@ PLAIN_CDR2
Specifies that the content is PLAIN_CDR2.
void deserialize(Cdr &, _T &)
eProsima_user_DllExport void serialize_key(eprosima::fastcdr::Cdr &scdr, const std_msgs::msg::Header &data)
@ XCDRv2
XCDRv2 encoding defined by standard DDS X-Types 1.3.
Definition Cdr.h:49
This class represents the structure Time defined by the user in the IDL file.
Definition Time.idl:3
This class represents the structure Header defined by the user in the IDL file.
Definition Header.idl:5