pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
TimeCdrAux.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 TimeCdrAux.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__BUILTIN_INTERFACES_MSG_TIMECDRAUX_IPP
23#define FAST_DDS_GENERATED__BUILTIN_INTERFACES_MSG_TIMECDRAUX_IPP
24
25#include "TimeCdrAux.hpp"
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 builtin_interfaces::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.sec(), current_alignment);
57
59 data.nanosec(), 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 builtin_interfaces::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.sec();
104 break;
105
106 case 1:
107 dcdr >> data.nanosec();
108 break;
109
110 default:
111 ret_value = false;
112 break;
113 }
114 return ret_value;
115 });
116}
117
121{
122 using namespace builtin_interfaces::msg;
123
124 static_cast<void>(scdr);
125 static_cast<void>(data);
126 scdr << data.sec();
127
128 scdr << data.nanosec();
129
130}
131
132
133
134} // namespace fastcdr
135} // namespace eprosima
136
137#endif // FAST_DDS_GENERATED__BUILTIN_INTERFACES_MSG_TIMECDRAUX_IPP
138
#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