pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
StatisticsNamesCdrAux.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 StatisticsNamesCdrAux.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__PLOTJUGGLER_MSGS_MSG_STATISTICSNAMESCDRAUX_IPP
23#define FAST_DDS_GENERATED__PLOTJUGGLER_MSGS_MSG_STATISTICSNAMESCDRAUX_IPP
24
26
27#include <fastcdr/Cdr.h>
29
30
32using namespace eprosima::fastcdr::exception;
33
34namespace eprosima {
35namespace fastcdr {
36
37template<>
41 size_t& current_alignment)
42{
43 using namespace plotjuggler_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.header(), current_alignment);
57
59 data.names(), current_alignment);
60
62 data.names_version(), current_alignment);
63
64
65 calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
66
67 return calculated_size;
68}
69
70template<>
90
91template<>
95{
96 using namespace plotjuggler_msgs::msg;
97
101 [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
102 {
103 bool ret_value = true;
104 switch (mid.id)
105 {
106 case 0:
107 dcdr >> data.header();
108 break;
109
110 case 1:
111 dcdr >> data.names();
112 break;
113
114 case 2:
115 dcdr >> data.names_version();
116 break;
117
118 default:
119 ret_value = false;
120 break;
121 }
122 return ret_value;
123 });
124}
125
129{
130 using namespace plotjuggler_msgs::msg;
131 extern void serialize_key(
132 Cdr& scdr,
133 const std_msgs::msg::Header& data);
134
135
136
137
138 static_cast<void>(scdr);
139 static_cast<void>(data);
140 serialize_key(scdr, data.header());
141
142 scdr << data.names();
143
144 scdr << data.names_version();
145
146}
147
148
149
150} // namespace fastcdr
151} // namespace eprosima
152
153#endif // FAST_DDS_GENERATED__PLOTJUGGLER_MSGS_MSG_STATISTICSNAMESCDRAUX_IPP
154
#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 StatisticsNames defined by the user in the IDL file.
This class represents the structure Header defined by the user in the IDL file.
Definition Header.idl:5