5.13. APIs (Modern C++ API)
5.13.1. [Major] Possible exception thrown due to incorrect DynamicData move constructor or assignment operator
In the Modern C++ API, the DynamicData
move constructor and
move-assignment operator didn’t consider the case where the
DynamicData
object is “loaned.” In this case, moving the object is
not possible and must be copied. The application will have seen an error
and exception thrown in that case.
For example, consider the following:
DynamicData sample = ...
LoanedDynamicData foo_member = sample.loan_value("foo");
foo_member.get() = DynamicData(...); // 1. move-assignment operator invoked to assign the temporary rvalue DynamicData(...) to the loaned DynamicData object
sample = DynamicData(...); // 2. move-assignment OK - objects are not loaned
This problem has been resolved. In the example above, the assignment
makes a copy in (1) but continues to efficiently move the object in (2).
Note that the move constructor and assignment operators are no longer
noexcept
, since a copy, which is now possible, is not noexcept
.
[RTI Issue ID CORE-14581]
5.13.2. [Major] Modern C++ API was not enabled for x64Vx7SR0630llvm8.0.0.2_rtp
In Connext 7.3.0 LTS, the target package for
x64Vx7SR0630llvm8.0.0.2_rtp
did not include the Modern C++ API
library, libnddscpp2[d].so
.
[RTI Issue ID PLATFORMS-4417]
5.13.3. [Minor] find_member_by_id returned INVALID_INDEX in some cases
When using the Modern C++ API, calling
StructType::find_member_by_id()
may have returned INVALID_INDEX.
For example, the following code was susceptible to the problem:
MyStruct my_struct;
std::cout << dds::core::xtypes::StructType(static_cast<const dds::core::xtypes::StructType &>(my_dynamic_data.type())).find_member_by_id(100) << "\n";
whereas this code was not problematic:
MyStruct my_struct;
std::cout << static_cast<const dds::core::xtypes::StructType &>(my_dynamic_data.type()).find_member_by_id(100) << "\n";
[RTI Issue ID CORE-14518]
5.13.4. [Trivial] SampleProcessor not included by rti/rti.hpp header
The header rti/rti.hpp
, which is intended to include the full C++
API, didn’t include rti/sub/SampleProcessor.hpp
. Now, the
SampleProcessor
utility can be used by including rti/rti.hpp
,
rti/sub/rtisub.hpp
, or rti/sub/SampleProcessor.hpp
.
[RTI Issue ID CORE-14716]