Skip to content

Commit 83e9312

Browse files
committed
Fix braces which caused some of the setting to not take effect for the reader
1 parent ef3d06e commit 83e9312

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

srcCxx/shape_main.cxx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,15 +1532,15 @@ class ShapeApplication {
15321532
dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.SECONDS_FIELD_NAME = options->timebasedfilter_interval_us / 1000000;
15331533
dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.nanosec = (options->timebasedfilter_interval_us % 1000000) * 1000;
15341534

1535-
}
1536-
logger.log_message(" TimeBasedFilter = " +
1535+
logger.log_message(" TimeBasedFilter = " +
15371536
std::to_string(dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.SECONDS_FIELD_NAME) + "secs",
15381537
Verbosity::DEBUG);
1539-
logger.log_message(" " +
1538+
logger.log_message(" " +
15401539
std::to_string(dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.nanosec) + "nanosecs",
15411540
Verbosity::DEBUG);
15421541
#endif
1543-
if ( options->deadline_interval_us > 0 ) {
1542+
}
1543+
if ( options->deadline_interval_us > 0 ) {
15441544
dr_qos.deadline FIELD_ACCESSOR.period.SECONDS_FIELD_NAME = options->deadline_interval_us / 1000000;
15451545
dr_qos.deadline FIELD_ACCESSOR.period.nanosec = (options->deadline_interval_us % 1000000) * 1000;;
15461546
}
@@ -1569,12 +1569,12 @@ class ShapeApplication {
15691569
ContentFilteredTopic *cft = NULL;
15701570
StringSeq cf_params;
15711571

1572-
for (unsigned int i = 0; i < options->num_topics; ++i) {
1573-
const std::string filtered_topic_name_str =
1572+
for (unsigned int i = 0; i < options->num_topics; ++i) {
1573+
const std::string filtered_topic_name_str =
15741574
std::string(options->topic_name) +
15751575
(i > 0 ? std::to_string(i) : "") +
15761576
"_filtered";
1577-
const char* filtered_topic_name = filtered_topic_name_str.c_str();
1577+
const char* filtered_topic_name = filtered_topic_name_str.c_str();
15781578
#if defined(RTI_CONNEXT_DDS)
15791579
char parameter[64];
15801580
snprintf(parameter, 64, "'%s'", options->color);
@@ -1613,8 +1613,9 @@ class ShapeApplication {
16131613
logger.log_message("failed to create datareader[" + std::to_string(i) + "] topic: " + topics[i]->get_name(), Verbosity::ERROR);
16141614
return false;
16151615
}
1616-
#endif
16171616
}
1617+
#endif
1618+
16181619

16191620
} else {
16201621
// Create different DataReaders (depending on the number of entities)
@@ -1729,10 +1730,14 @@ class ShapeApplication {
17291730
logger.log_message("Calling take() function", Verbosity::DEBUG);
17301731
retval = drs[i]->take ( samples,
17311732
sample_infos,
1732-
LENGTH_UNLIMITED,
1733-
ANY_SAMPLE_STATE,
1734-
ANY_VIEW_STATE,
1735-
ANY_INSTANCE_STATE );
1733+
DDS_LENGTH_UNLIMITED,
1734+
DDS_ANY_SAMPLE_STATE,
1735+
DDS_ANY_VIEW_STATE,
1736+
DDS_ANY_INSTANCE_STATE );
1737+
if (retval == DDS_RETCODE_OK) {
1738+
logger.log_message("Taken " + std::to_string(samples.length())
1739+
+ " sample(s)", Verbosity::DEBUG);
1740+
}
17361741
}
17371742
} else { /* Use read_next_instance*/
17381743
if (options->take_read_next_instance) {

0 commit comments

Comments
 (0)