blob.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2023 Intel Corporation. All Rights Reserved.
3 
11 #ifdef _WIN32
12 // Remove linker warning LNK4221 on Visual Studio
13 namespace {
14 char dummy;
15 } // namespace
16 #endif // _WIN32
17 
19 #include <fastcdr/Cdr.h>
20 
21 #include <fastcdr/exceptions/BadParamException.h>
22 using namespace eprosima::fastcdr::exception;
23 
24 #include <utility>
25 
27 {
28  // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@131276c2
29 
30 
31 }
32 
34 {
35 }
36 
38  const blob& x)
39 {
40  m_data = x.m_data;
41 }
42 
44  blob&& x) noexcept
45 {
46  m_data = std::move(x.m_data);
47 }
48 
50  const blob& x)
51 {
52 
53  m_data = x.m_data;
54 
55  return *this;
56 }
57 
59  blob&& x) noexcept
60 {
61 
62  m_data = std::move(x.m_data);
63 
64  return *this;
65 }
66 
68  const blob& x) const
69 {
70 
71  return (m_data == x.m_data);
72 }
73 
75  const blob& x) const
76 {
77  return !(*this == x);
78 }
79 
81  size_t current_alignment)
82 {
83  size_t initial_alignment = current_alignment;
84 
85 
86  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
87 
88  current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
89 
90 
91 
92  return current_alignment - initial_alignment;
93 }
94 
96  const udds::blob& data,
97  size_t current_alignment)
98 {
99  (void)data;
100  size_t initial_alignment = current_alignment;
101 
102 
103  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
104 
105  if (data.data().size() > 0)
106  {
107  current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
108  }
109 
110 
111 
112  return current_alignment - initial_alignment;
113 }
114 
116  eprosima::fastcdr::Cdr& scdr) const
117 {
118 
119  scdr << m_data;
120 }
121 
123  eprosima::fastcdr::Cdr& dcdr)
124 {
125 
126  dcdr >> m_data;}
127 
133  const std::vector<uint8_t>& _data)
134 {
135  m_data = _data;
136 }
137 
143  std::vector<uint8_t>&& _data)
144 {
145  m_data = std::move(_data);
146 }
147 
152 const std::vector<uint8_t>& udds::blob::data() const
153 {
154  return m_data;
155 }
156 
161 std::vector<uint8_t>& udds::blob::data()
162 {
163  return m_data;
164 }
165 
167  size_t current_alignment)
168 {
169  size_t current_align = current_alignment;
170 
171 
172 
173  return current_align;
174 }
175 
177 {
178  return false;
179 }
180 
182  eprosima::fastcdr::Cdr& scdr) const
183 {
184  (void) scdr;
185 
186 }
187 
udds::blob::data
const eProsima_user_DllExport std::vector< uint8_t > & data() const
This function returns a constant reference to member data.
Definition: blob.cpp:152
udds::blob::operator==
eProsima_user_DllExport bool operator==(const blob &x) const
Comparison operator.
Definition: blob.cpp:67
void
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
udds::blob::getKeyMaxCdrSerializedSize
static eProsima_user_DllExport 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...
Definition: blob.cpp:166
udds::blob::operator=
eProsima_user_DllExport blob & operator=(const blob &x)
Copy assignment.
Definition: blob.cpp:49
blob.h
data
GLboolean * data
Definition: glad/glad/glad.h:1481
udds::blob::getMaxCdrSerializedSize
static eProsima_user_DllExport size_t getMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of an object depending on the buffer alignment.
Definition: blob.cpp:80
udds::blob::deserialize
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
Definition: blob.cpp:122
udds::blob::isKeyDefined
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
Definition: blob.cpp:176
udds::blob::serializeKey
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition: blob.cpp:181
udds::blob::m_data
std::vector< uint8_t > m_data
Definition: blob.h:201
udds::blob::~blob
eProsima_user_DllExport ~blob()
Default destructor.
Definition: blob.cpp:33
x
GLdouble x
Definition: glad/glad/glad.h:2279
udds::blob
This class represents the structure blob defined by the user in the IDL file.
Definition: blob.h:60
udds::blob::operator!=
eProsima_user_DllExport bool operator!=(const blob &x) const
Comparison operator.
Definition: blob.cpp:74
udds::blob::getCdrSerializedSize
static eProsima_user_DllExport size_t getCdrSerializedSize(const udds::blob &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: blob.cpp:95
udds::blob::serialize
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
Definition: blob.cpp:115
udds::blob::blob
eProsima_user_DllExport blob()
Default constructor.
Definition: blob.cpp:26


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01