diff --git a/examples/cpp/flow_control/CMakeLists.txt b/examples/cpp/flow_control/CMakeLists.txt index 056172f9f8d..f84047b8517 100644 --- a/examples/cpp/flow_control/CMakeLists.txt +++ b/examples/cpp/flow_control/CMakeLists.txt @@ -47,6 +47,9 @@ target_compile_definitions(flow_control PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) +if(WIN32) + set_target_properties(flow_control PROPERTIES LINK_FLAGS /STACK:4194304) +endif() target_link_libraries(flow_control fastdds fastcdr foonathan_memory) install(TARGETS flow_control RUNTIME DESTINATION ${DATA_INSTALL_DIR}/fastdds/examples/cpp/flow_control/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/flow_control/FlowControl.idl b/examples/cpp/flow_control/FlowControl.idl index 27c1222a81a..ec04129bc11 100644 --- a/examples/cpp/flow_control/FlowControl.idl +++ b/examples/cpp/flow_control/FlowControl.idl @@ -1,3 +1,4 @@ +@extensibility(APPENDABLE) struct FlowControl { unsigned long index; diff --git a/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx b/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx index b6bd4eb53f3..c4da3940884 100644 --- a/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx +++ b/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx @@ -54,6 +54,13 @@ void register_FlowControl_type_identifier( QualifiedTypeName type_name_FlowControl = "FlowControl"; eprosima::fastcdr::optional type_ann_builtin_FlowControl; eprosima::fastcdr::optional ann_custom_FlowControl; + AppliedAnnotationSeq tmp_ann_custom_FlowControl; + eprosima::fastcdr::optional verbatim_FlowControl; + if (!tmp_ann_custom_FlowControl.empty()) + { + ann_custom_FlowControl = tmp_ann_custom_FlowControl; + } + CompleteTypeDetail detail_FlowControl = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FlowControl, ann_custom_FlowControl, type_name_FlowControl.to_string()); CompleteStructHeader header_FlowControl; header_FlowControl = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FlowControl); diff --git a/examples/cpp/flow_control/PublisherApp.cpp b/examples/cpp/flow_control/PublisherApp.cpp index cec9601282d..ed8771dda63 100644 --- a/examples/cpp/flow_control/PublisherApp.cpp +++ b/examples/cpp/flow_control/PublisherApp.cpp @@ -191,7 +191,10 @@ void PublisherApp::run() } else { - throw std::runtime_error("Slow Publisher failed sending a message"); + if (!is_stopped()) + { + std::cout << "Slow Publisher failed sending a message" << std::endl; + } } if (publish(fast_writer_, msg)) @@ -200,7 +203,10 @@ void PublisherApp::run() } else { - throw std::runtime_error("Fast Publisher failed sending a message"); + if (!is_stopped()) + { + std::cout << "Fast Publisher failed sending a message" << std::endl; + } } // Wait for period or stop event @@ -214,7 +220,7 @@ void PublisherApp::run() bool PublisherApp::publish( DataWriter* writer_, - FlowControl msg) + FlowControl& msg) { bool ret = false; // Wait for the data endpoints discovery diff --git a/examples/cpp/flow_control/PublisherApp.hpp b/examples/cpp/flow_control/PublisherApp.hpp index 9e5749b46fe..037aff94848 100644 --- a/examples/cpp/flow_control/PublisherApp.hpp +++ b/examples/cpp/flow_control/PublisherApp.hpp @@ -72,7 +72,7 @@ class PublisherApp : public Application, public DataWriterListener //! Publish a sample bool publish( DataWriter* writer_, - FlowControl msg); + FlowControl& msg); DomainParticipant* participant_; diff --git a/examples/cpp/rtps/CLIParser.hpp b/examples/cpp/rtps/CLIParser.hpp index 507c13e5739..1f95f81b851 100644 --- a/examples/cpp/rtps/CLIParser.hpp +++ b/examples/cpp/rtps/CLIParser.hpp @@ -131,7 +131,6 @@ class CLIParser if (static_cast(input) > std::numeric_limits::max()) { throw std::out_of_range("sample argument out of range"); - print_help(EXIT_FAILURE); } config.samples = static_cast(input);