Skip to content

Commit 5ab6997

Browse files
Add documentation for has_more_replies (#1091)
* Refs #23365. Regenerate code. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23365. Add API aliases. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23365. Add paragraphs regarding new field. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23365. Update example code. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent b9a7afa commit 5ab6997

12 files changed

Lines changed: 4297 additions & 7 deletions

File tree

code/DDSCodeTester.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8045,6 +8045,10 @@ void rpcdds_internal_api_examples()
80458045
if (expected_request_info.related_sample_identity == received_request_info.related_sample_identity)
80468046
{
80478047
// Received Reply sample is associated to the sent Request sample
8048+
if (received_request_info.has_more_replies)
8049+
{
8050+
// More replies for the same request will be received
8051+
}
80488052
}
80498053

80508054
// Delete created Requester
@@ -8125,15 +8129,26 @@ void rpcdds_internal_api_examples()
81258129

81268130
// ... Process received data
81278131

8128-
// Send a Reply with the received related_sample_identity
8132+
// Send a Reply with the received related_sample_identity, indicating there will be more replies.
81298133
void* reply_data = reply_type_support->create_data();
8134+
received_request_info.has_more_replies = true;
81308135
ret = replier->send_reply(reply_data, received_request_info);
81318136
if (RETCODE_OK != ret)
81328137
{
81338138
// Error
81348139
return;
81358140
}
81368141

8142+
// Send a Reply with the received related_sample_identity, indicating it is the last one.
8143+
void* reply_data_2 = reply_type_support->create_data();
8144+
received_request_info.has_more_replies = false;
8145+
ret = replier->send_reply(reply_data_2, received_request_info);
8146+
if (RETCODE_OK != ret)
8147+
{
8148+
// Error
8149+
return;
8150+
}
8151+
81378152
/* Delete created Replier */
81388153
ret = participant->delete_service_replier(replier->get_service_name(), replier);
81398154
if (RETCODE_OK != ret)

code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp>
3333
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
3434
#include <fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp>
35-
3635
#include "HelloWorld.hpp"
3736

3837

@@ -135,4 +134,3 @@ void register_HelloWorld_type_identifier(
135134
}
136135
}
137136
}
138-

code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@
4343
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
4444
* indirectly registered as well.
4545
*
46-
* @param[out] TypeIdentifier of the registered type.
46+
* @param[out] type_ids TypeIdentifier of the registered type.
4747
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
4848
* Invalid TypeIdentifier is returned in case of error.
4949
*/
5050
eProsima_user_DllExport void register_HelloWorld_type_identifier(
5151
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
5252

5353

54-
5554
#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
5655

5756
#endif // FAST_DDS_GENERATED__HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP

code/Examples/C++/RpcClientServerBasic/src/types/calculatorPubSubTypes.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ namespace calculator_example {
175175
delete pData;
176176
}
177177

178+
eProsima_user_DllExport void register_type_object_representation() override
179+
{
180+
register_Calculator_Request_type_identifier(type_identifiers_);
181+
}
182+
178183
};
179184

180185
class Calculator_ReplyPubSubType : public eprosima::fastdds::dds::TopicDataType
@@ -318,6 +323,11 @@ namespace calculator_example {
318323
delete pData;
319324
}
320325

326+
eProsima_user_DllExport void register_type_object_representation() override
327+
{
328+
register_Calculator_Reply_type_identifier(type_identifiers_);
329+
}
330+
321331
};
322332

323333
eprosima::fastdds::dds::rpc::ServiceTypeSupport create_Calculator_service_type_support()

code/Examples/C++/RpcClientServerBasic/src/types/calculatorTypeObjectSupport.cxx

Lines changed: 1156 additions & 0 deletions
Large diffs are not rendered by default.

code/Examples/C++/RpcClientServerBasic/src/types/calculatorTypeObjectSupport.hpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,33 @@
3838
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
3939

4040
namespace calculator_example {
41+
/**
42+
* @brief Register Calculator_Request related TypeIdentifier.
43+
* Fully-descriptive TypeIdentifiers are directly registered.
44+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
45+
* indirectly registered as well.
46+
*
47+
* @param[out] type_ids TypeIdentifier of the registered type.
48+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
49+
* Invalid TypeIdentifier is returned in case of error.
50+
*/
51+
eProsima_user_DllExport void register_Calculator_Request_type_identifier(
52+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
53+
54+
/**
55+
* @brief Register Calculator_Reply related TypeIdentifier.
56+
* Fully-descriptive TypeIdentifiers are directly registered.
57+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
58+
* indirectly registered as well.
59+
*
60+
* @param[out] type_ids TypeIdentifier of the registered type.
61+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
62+
* Invalid TypeIdentifier is returned in case of error.
63+
*/
64+
eProsima_user_DllExport void register_Calculator_Reply_type_identifier(
65+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
66+
67+
4168
} // namespace calculator_example
4269

4370

code/Examples/C++/RpcClientServerFeed/src/types/calculatorPubSubTypes.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ namespace calculator_example {
175175
delete pData;
176176
}
177177

178+
eProsima_user_DllExport void register_type_object_representation() override
179+
{
180+
register_Calculator_Request_type_identifier(type_identifiers_);
181+
}
182+
178183
};
179184

180185
class Calculator_ReplyPubSubType : public eprosima::fastdds::dds::TopicDataType
@@ -318,6 +323,11 @@ namespace calculator_example {
318323
delete pData;
319324
}
320325

326+
eProsima_user_DllExport void register_type_object_representation() override
327+
{
328+
register_Calculator_Reply_type_identifier(type_identifiers_);
329+
}
330+
321331
};
322332

323333
eprosima::fastdds::dds::rpc::ServiceTypeSupport create_Calculator_service_type_support()

code/Examples/C++/RpcClientServerFeed/src/types/calculatorServer.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ class CalculatorServerLogic
253253
: info_(info)
254254
, replier_(replier)
255255
{
256+
info_.has_more_replies = true;
256257
reply_.fibonacci_seq = calculator_example::detail::Calculator_fibonacci_seq_Result{};
257258
reply_.fibonacci_seq->result = calculator_example::detail::Calculator_fibonacci_seq_Out{};
258259
}
@@ -541,6 +542,7 @@ class CalculatorServerLogic
541542
: info_(info)
542543
, replier_(replier)
543544
{
545+
info_.has_more_replies = true;
544546
reply_.accumulator = calculator_example::detail::Calculator_accumulator_Result{};
545547
reply_.accumulator->result = calculator_example::detail::Calculator_accumulator_Out{};
546548
}
@@ -710,6 +712,7 @@ class CalculatorServerLogic
710712
: info_(info)
711713
, replier_(replier)
712714
{
715+
info_.has_more_replies = true;
713716
reply_.filter = calculator_example::detail::Calculator_filter_Result{};
714717
reply_.filter->result = calculator_example::detail::Calculator_filter_Out{};
715718
}

0 commit comments

Comments
 (0)