Skip to content

Commit

Permalink
add ROS2 get/set/list/describe parameters .h/.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Dec 21, 2024
1 parent 37028f7 commit fd0129e
Show file tree
Hide file tree
Showing 49 changed files with 11,674 additions and 1 deletion.
2 changes: 1 addition & 1 deletion third-party/realdds/include/realdds/topics/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The various topics are arranged hierarchically:

The code for each message type in this directory is generated from IDL files if the message format is defined by RealDDS.

For [ROS](#ros2), the IDLs are not available.
For [ROS](#ros2), the IDLs are available in the `/opt/ros/<distro>/share/` installation folder.

# Generation

Expand Down
355 changes: 355 additions & 0 deletions third-party/realdds/include/realdds/topics/ros2/DescribeParameters.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2024 Intel Corporation. All Rights Reserved.

/*!
* @file DescribeParameters.h
* This header file contains the declaration of the described types in the IDL file.
*
* This file was generated by the tool gen.
*/

#ifndef _FAST_DDS_GENERATED_RCL_INTERFACES_SRV_DESCRIBEPARAMETERS_H_
#define _FAST_DDS_GENERATED_RCL_INTERFACES_SRV_DESCRIBEPARAMETERS_H_

#include "ParameterDescriptor.h"

//#include <fastrtps/utils/fixed_size_string.hpp>

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

#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
#define eProsima_user_DllExport __declspec( dllexport )
#else
#define eProsima_user_DllExport
#endif // EPROSIMA_USER_DLL_EXPORT
#else
#define eProsima_user_DllExport
#endif // _WIN32

#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
#if defined(DescribeParameters_SOURCE)
#define DescribeParameters_DllAPI __declspec( dllexport )
#else
#define DescribeParameters_DllAPI __declspec( dllimport )
#endif // DescribeParameters_SOURCE
#else
#define DescribeParameters_DllAPI
#endif // EPROSIMA_USER_DLL_EXPORT
#else
#define DescribeParameters_DllAPI
#endif // _WIN32

namespace eprosima {
namespace fastcdr {
class Cdr;
} // namespace fastcdr
} // namespace eprosima


namespace rcl_interfaces {
namespace srv {
/*!
* @brief This class represents the structure DescribeParameters_Request defined by the user in the IDL file.
* @ingroup DESCRIBEPARAMETERS
*/
class DescribeParameters_Request
{
public:

/*!
* @brief Default constructor.
*/
eProsima_user_DllExport DescribeParameters_Request();

/*!
* @brief Default destructor.
*/
eProsima_user_DllExport ~DescribeParameters_Request();

/*!
* @brief Copy constructor.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Request that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Request(
const DescribeParameters_Request& x);

/*!
* @brief Move constructor.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Request that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Request(
DescribeParameters_Request&& x) noexcept;

/*!
* @brief Copy assignment.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Request that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Request& operator =(
const DescribeParameters_Request& x);

/*!
* @brief Move assignment.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Request that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Request& operator =(
DescribeParameters_Request&& x) noexcept;

/*!
* @brief Comparison operator.
* @param x rcl_interfaces::srv::DescribeParameters_Request object to compare.
*/
eProsima_user_DllExport bool operator ==(
const DescribeParameters_Request& x) const;

/*!
* @brief Comparison operator.
* @param x rcl_interfaces::srv::DescribeParameters_Request object to compare.
*/
eProsima_user_DllExport bool operator !=(
const DescribeParameters_Request& x) const;

/*!
* @brief This function copies the value in member names
* @param _names New value to be copied in member names
*/
eProsima_user_DllExport void names(
const std::vector<std::string>& _names);

/*!
* @brief This function moves the value in member names
* @param _names New value to be moved in member names
*/
eProsima_user_DllExport void names(
std::vector<std::string>&& _names);

/*!
* @brief This function returns a constant reference to member names
* @return Constant reference to member names
*/
eProsima_user_DllExport const std::vector<std::string>& names() const;

/*!
* @brief This function returns a reference to member names
* @return Reference to member names
*/
eProsima_user_DllExport std::vector<std::string>& names();

/*!
* @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 rcl_interfaces::srv::DescribeParameters_Request& 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::vector<std::string> m_names;
};
/*!
* @brief This class represents the structure DescribeParameters_Response defined by the user in the IDL file.
* @ingroup DESCRIBEPARAMETERS
*/
class DescribeParameters_Response
{
public:

/*!
* @brief Default constructor.
*/
eProsima_user_DllExport DescribeParameters_Response();

/*!
* @brief Default destructor.
*/
eProsima_user_DllExport ~DescribeParameters_Response();

/*!
* @brief Copy constructor.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Response that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Response(
const DescribeParameters_Response& x);

/*!
* @brief Move constructor.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Response that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Response(
DescribeParameters_Response&& x) noexcept;

/*!
* @brief Copy assignment.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Response that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Response& operator =(
const DescribeParameters_Response& x);

/*!
* @brief Move assignment.
* @param x Reference to the object rcl_interfaces::srv::DescribeParameters_Response that will be copied.
*/
eProsima_user_DllExport DescribeParameters_Response& operator =(
DescribeParameters_Response&& x) noexcept;

/*!
* @brief Comparison operator.
* @param x rcl_interfaces::srv::DescribeParameters_Response object to compare.
*/
eProsima_user_DllExport bool operator ==(
const DescribeParameters_Response& x) const;

/*!
* @brief Comparison operator.
* @param x rcl_interfaces::srv::DescribeParameters_Response object to compare.
*/
eProsima_user_DllExport bool operator !=(
const DescribeParameters_Response& x) const;

/*!
* @brief This function copies the value in member descriptors
* @param _descriptors New value to be copied in member descriptors
*/
eProsima_user_DllExport void descriptors(
const std::vector<rcl_interfaces::msg::ParameterDescriptor>& _descriptors);

/*!
* @brief This function moves the value in member descriptors
* @param _descriptors New value to be moved in member descriptors
*/
eProsima_user_DllExport void descriptors(
std::vector<rcl_interfaces::msg::ParameterDescriptor>&& _descriptors);

/*!
* @brief This function returns a constant reference to member descriptors
* @return Constant reference to member descriptors
*/
eProsima_user_DllExport const std::vector<rcl_interfaces::msg::ParameterDescriptor>& descriptors() const;

/*!
* @brief This function returns a reference to member descriptors
* @return Reference to member descriptors
*/
eProsima_user_DllExport std::vector<rcl_interfaces::msg::ParameterDescriptor>& descriptors();

/*!
* @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 rcl_interfaces::srv::DescribeParameters_Response& 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::vector<rcl_interfaces::msg::ParameterDescriptor> m_descriptors;
};
} // namespace srv
} // namespace rcl_interfaces

#endif // _FAST_DDS_GENERATED_RCL_INTERFACES_SRV_DESCRIBEPARAMETERS_H_
Loading

0 comments on commit fd0129e

Please sign in to comment.