Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[19453] Regenerate types with Fast DDS-Gen v3.0.1 #89

Merged
merged 4 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 15 additions & 89 deletions types/KeylessShapeType.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

/*!
* @file KeylessShapeType.cpp
* This source file contains the definition of the described types in the IDL file.
* This source file contains the implementation of the described types in the IDL file.
*
* This file was generated by the tool gen.
* This file was generated by the tool fastddsgen.
*/

#ifdef _WIN32
Expand All @@ -28,37 +28,25 @@ char dummy;

#include "KeylessShapeType.h"
#include "KeylessShapeTypeTypeObject.h"

#include <fastcdr/Cdr.h>


#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

#define shapes_demo_typesupport_idl_KeylessShapeType_max_cdr_typesize 272ULL;
#define shapes_demo_typesupport_idl_KeylessShapeType_max_key_cdr_typesize 0ULL;

shapes_demo_typesupport::idl::KeylessShapeType::KeylessShapeType()
{
// string m_color
m_color ="";
// long m_x
m_x = 0;
// long m_y
m_y = 0;
// long m_shapesize
m_shapesize = 0;

// Just to register all known types
registerKeylessShapeTypeTypes();
}

shapes_demo_typesupport::idl::KeylessShapeType::~KeylessShapeType()
{




}

shapes_demo_typesupport::idl::KeylessShapeType::KeylessShapeType(
Expand All @@ -71,7 +59,7 @@ shapes_demo_typesupport::idl::KeylessShapeType::KeylessShapeType(
}

shapes_demo_typesupport::idl::KeylessShapeType::KeylessShapeType(
KeylessShapeType&& x) noexcept
KeylessShapeType&& x) noexcept
{
m_color = std::move(x.m_color);
m_x = x.m_x;
Expand Down Expand Up @@ -106,8 +94,10 @@ shapes_demo_typesupport::idl::KeylessShapeType& shapes_demo_typesupport::idl::Ke
bool shapes_demo_typesupport::idl::KeylessShapeType::operator ==(
const KeylessShapeType& x) const
{

return (m_color == x.m_color && m_x == x.m_x && m_y == x.m_y && m_shapesize == x.m_shapesize);
return (m_color == x.m_color &&
m_x == x.m_x &&
m_y == x.m_y &&
m_shapesize == x.m_shapesize);
}

bool shapes_demo_typesupport::idl::KeylessShapeType::operator !=(
Expand All @@ -116,57 +106,6 @@ bool shapes_demo_typesupport::idl::KeylessShapeType::operator !=(
return !(*this == x);
}

size_t shapes_demo_typesupport::idl::KeylessShapeType::getMaxCdrSerializedSize(
size_t current_alignment)
{
static_cast<void>(current_alignment);
return shapes_demo_typesupport_idl_KeylessShapeType_max_cdr_typesize;
}

size_t shapes_demo_typesupport::idl::KeylessShapeType::getCdrSerializedSize(
const shapes_demo_typesupport::idl::KeylessShapeType& data,
size_t current_alignment)
{
(void)data;
size_t initial_alignment = current_alignment;


current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.color().size() + 1;

current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



return current_alignment - initial_alignment;
}

void shapes_demo_typesupport::idl::KeylessShapeType::serialize(
eprosima::fastcdr::Cdr& scdr) const
{

scdr << m_color.c_str();
scdr << m_x;
scdr << m_y;
scdr << m_shapesize;

}

void shapes_demo_typesupport::idl::KeylessShapeType::deserialize(
eprosima::fastcdr::Cdr& dcdr)
{

dcdr >> m_color;
dcdr >> m_x;
dcdr >> m_y;
dcdr >> m_shapesize;
}

/*!
* @brief This function copies the value in member color
* @param _color New value to be copied in member color
Expand Down Expand Up @@ -204,6 +143,8 @@ std::string& shapes_demo_typesupport::idl::KeylessShapeType::color()
{
return m_color;
}


/*!
* @brief This function sets a value in member x
* @param _x New value for member x
Expand Down Expand Up @@ -232,6 +173,7 @@ int32_t& shapes_demo_typesupport::idl::KeylessShapeType::x()
return m_x;
}


/*!
* @brief This function sets a value in member y
* @param _y New value for member y
Expand Down Expand Up @@ -260,6 +202,7 @@ int32_t& shapes_demo_typesupport::idl::KeylessShapeType::y()
return m_y;
}


/*!
* @brief This function sets a value in member shapesize
* @param _shapesize New value for member shapesize
Expand Down Expand Up @@ -290,23 +233,6 @@ int32_t& shapes_demo_typesupport::idl::KeylessShapeType::shapesize()



size_t shapes_demo_typesupport::idl::KeylessShapeType::getKeyMaxCdrSerializedSize(
size_t current_alignment)
{
static_cast<void>(current_alignment);
return shapes_demo_typesupport_idl_KeylessShapeType_max_key_cdr_typesize;
}

bool shapes_demo_typesupport::idl::KeylessShapeType::isKeyDefined()
{
return false;
}

void shapes_demo_typesupport::idl::KeylessShapeType::serializeKey(
eprosima::fastcdr::Cdr& scdr) const
{
(void) scdr;
}



// Include auxiliary functions like for serializing/deserializing.
#include "KeylessShapeTypeCdrAux.ipp"
86 changes: 18 additions & 68 deletions types/KeylessShapeType.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@
* @file KeylessShapeType.h
* This header file contains the declaration of the described types in the IDL file.
*
* This file was generated by the tool gen.
* This file was generated by the tool fastddsgen.
*/

#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_
#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_


#include <fastrtps/utils/fixed_size_string.hpp>

#include <stdint.h>
#include <array>
#include <bitset>
#include <cstdint>
#include <map>
#include <string>
#include <vector>
#include <map>
#include <bitset>

#include <fastcdr/cdr/fixed_size_string.hpp>
#include <fastcdr/xcdr/optional.hpp>



#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
Expand Down Expand Up @@ -59,10 +61,12 @@
namespace eprosima {
namespace fastcdr {
class Cdr;
class CdrSizeCalculator;
} // namespace fastcdr
} // namespace eprosima



namespace shapes_demo_typesupport {
namespace idl {
/*!
Expand Down Expand Up @@ -150,6 +154,8 @@ namespace shapes_demo_typesupport {
* @return Reference to member color
*/
eProsima_user_DllExport std::string& color();


/*!
* @brief This function sets a value in member x
* @param _x New value for member x
Expand All @@ -169,6 +175,7 @@ namespace shapes_demo_typesupport {
*/
eProsima_user_DllExport int32_t& x();


/*!
* @brief This function sets a value in member y
* @param _y New value for member y
Expand All @@ -188,6 +195,7 @@ namespace shapes_demo_typesupport {
*/
eProsima_user_DllExport int32_t& y();


/*!
* @brief This function sets a value in member shapesize
* @param _shapesize New value for member shapesize
Expand All @@ -207,70 +215,12 @@ namespace shapes_demo_typesupport {
*/
eProsima_user_DllExport int32_t& shapesize();


/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
eProsima_user_DllExport static size_t getMaxCdrSerializedSize(
size_t current_alignment = 0);

/*!
* @brief This function returns the serialized size of a data depending on the buffer alignment.
* @param data Data which is calculated its serialized size.
* @param current_alignment Buffer alignment.
* @return Serialized size.
*/
eProsima_user_DllExport static size_t getCdrSerializedSize(
const shapes_demo_typesupport::idl::KeylessShapeType& data,
size_t current_alignment = 0);


/*!
* @brief This function serializes an object using CDR serialization.
* @param cdr CDR serialization object.
*/
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& cdr) const;

/*!
* @brief This function deserializes an object using CDR serialization.
* @param cdr CDR serialization object.
*/
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr);



/*!
* @brief This function returns the maximum serialized size of the Key of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(
size_t current_alignment = 0);

/*!
* @brief This function tells you if the Key has been defined for this type
*/
eProsima_user_DllExport static bool isKeyDefined();

/*!
* @brief This function serializes the key members of an object using CDR serialization.
* @param cdr CDR serialization object.
*/
eProsima_user_DllExport void serializeKey(
eprosima::fastcdr::Cdr& cdr) const;

private:

std::string m_color;
int32_t m_x;
int32_t m_y;
int32_t m_shapesize;
int32_t m_x{0};
int32_t m_y{0};
int32_t m_shapesize{0};

};
} // namespace idl
Expand Down
48 changes: 48 additions & 0 deletions types/KeylessShapeTypeCdrAux.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
* @file KeylessShapeTypeCdrAux.hpp
* This source file contains some definitions of CDR related functions.
*
* This file was generated by the tool fastddsgen.
*/

#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPECDRAUX_HPP_
#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPECDRAUX_HPP_

#include "KeylessShapeType.h"

constexpr uint32_t shapes_demo_typesupport_idl_KeylessShapeType_max_cdr_typesize {276UL};
constexpr uint32_t shapes_demo_typesupport_idl_KeylessShapeType_max_key_cdr_typesize {0UL};


namespace eprosima {
namespace fastcdr {

class Cdr;
class CdrSizeCalculator;

eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const shapes_demo_typesupport::idl::KeylessShapeType& data);




} // namespace fastcdr
} // namespace eprosima

#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPECDRAUX_HPP_

Loading