Skip to content
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
17 changes: 16 additions & 1 deletion code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8045,6 +8045,10 @@ void rpcdds_internal_api_examples()
if (expected_request_info.related_sample_identity == received_request_info.related_sample_identity)
{
// Received Reply sample is associated to the sent Request sample
if (received_request_info.has_more_replies)
{
// More replies for the same request will be received
}
}

// Delete created Requester
Expand Down Expand Up @@ -8125,15 +8129,26 @@ void rpcdds_internal_api_examples()

// ... Process received data

// Send a Reply with the received related_sample_identity
// Send a Reply with the received related_sample_identity, indicating there will be more replies.
void* reply_data = reply_type_support->create_data();
received_request_info.has_more_replies = true;
ret = replier->send_reply(reply_data, received_request_info);
if (RETCODE_OK != ret)
{
// Error
return;
}

// Send a Reply with the received related_sample_identity, indicating it is the last one.
void* reply_data_2 = reply_type_support->create_data();
received_request_info.has_more_replies = false;
ret = replier->send_reply(reply_data_2, received_request_info);
if (RETCODE_OK != ret)
{
// Error
return;
}

/* Delete created Replier */
ret = participant->delete_service_replier(replier->get_service_name(), replier);
if (RETCODE_OK != ret)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp>
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
#include <fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp>

#include "HelloWorld.hpp"


Expand Down Expand Up @@ -135,4 +134,3 @@ void register_HelloWorld_type_identifier(
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
* indirectly registered as well.
*
* @param[out] TypeIdentifier of the registered type.
* @param[out] type_ids TypeIdentifier of the registered type.
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
* Invalid TypeIdentifier is returned in case of error.
*/
eProsima_user_DllExport void register_HelloWorld_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);



#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#endif // FAST_DDS_GENERATED__HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ namespace calculator_example {
delete pData;
}

eProsima_user_DllExport void register_type_object_representation() override
{
register_Calculator_Request_type_identifier(type_identifiers_);
}

};

class Calculator_ReplyPubSubType : public eprosima::fastdds::dds::TopicDataType
Expand Down Expand Up @@ -318,6 +323,11 @@ namespace calculator_example {
delete pData;
}

eProsima_user_DllExport void register_type_object_representation() override
{
register_Calculator_Reply_type_identifier(type_identifiers_);
}

};

eprosima::fastdds::dds::rpc::ServiceTypeSupport create_Calculator_service_type_support()
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,33 @@
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

namespace calculator_example {
/**
* @brief Register Calculator_Request related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
* indirectly registered as well.
*
* @param[out] type_ids TypeIdentifier of the registered type.
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
* Invalid TypeIdentifier is returned in case of error.
*/
eProsima_user_DllExport void register_Calculator_Request_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);

/**
* @brief Register Calculator_Reply related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
* indirectly registered as well.
*
* @param[out] type_ids TypeIdentifier of the registered type.
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
* Invalid TypeIdentifier is returned in case of error.
*/
eProsima_user_DllExport void register_Calculator_Reply_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);


} // namespace calculator_example


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ namespace calculator_example {
delete pData;
}

eProsima_user_DllExport void register_type_object_representation() override
{
register_Calculator_Request_type_identifier(type_identifiers_);
}

};

class Calculator_ReplyPubSubType : public eprosima::fastdds::dds::TopicDataType
Expand Down Expand Up @@ -318,6 +323,11 @@ namespace calculator_example {
delete pData;
}

eProsima_user_DllExport void register_type_object_representation() override
{
register_Calculator_Reply_type_identifier(type_identifiers_);
}

};

eprosima::fastdds::dds::rpc::ServiceTypeSupport create_Calculator_service_type_support()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class CalculatorServerLogic
: info_(info)
, replier_(replier)
{
info_.has_more_replies = true;
reply_.fibonacci_seq = calculator_example::detail::Calculator_fibonacci_seq_Result{};
reply_.fibonacci_seq->result = calculator_example::detail::Calculator_fibonacci_seq_Out{};
}
Expand Down Expand Up @@ -541,6 +542,7 @@ class CalculatorServerLogic
: info_(info)
, replier_(replier)
{
info_.has_more_replies = true;
reply_.accumulator = calculator_example::detail::Calculator_accumulator_Result{};
reply_.accumulator->result = calculator_example::detail::Calculator_accumulator_Out{};
}
Expand Down Expand Up @@ -710,6 +712,7 @@ class CalculatorServerLogic
: info_(info)
, replier_(replier)
{
info_.has_more_replies = true;
reply_.filter = calculator_example::detail::Calculator_filter_Result{};
reply_.filter->result = calculator_example::detail::Calculator_filter_Out{};
}
Expand Down
Loading