diff --git a/dds/DCPS/TypeSupportImpl_T.h b/dds/DCPS/TypeSupportImpl_T.h index 4fd8c59beb5..4d0d3c6de8b 100644 --- a/dds/DCPS/TypeSupportImpl_T.h +++ b/dds/DCPS/TypeSupportImpl_T.h @@ -86,7 +86,7 @@ class TypeSupportImpl_T /// the type is "variable length". If it has something like a sequence then /// it's variable length and returns a pointer else it's fixed and returns on /// the stack. opendds_idl will wrap this in the correct form. - DDS::ReturnCode_t create_sample_rc(DDS::DynamicData_ptr src, NativeType& dst) + DDS::ReturnCode_t create_sample_rc(NativeType& dst, DDS::DynamicData_ptr src) { OpenDDS::DCPS::set_default(dst); # if OPENDDS_HAS_DYNAMIC_DATA_ADAPTER @@ -109,7 +109,7 @@ class TypeSupportImpl_T # endif } - DDS::ReturnCode_t create_dynamic_sample_rc(const NativeType& src, DDS::DynamicData_ptr& dst) + DDS::ReturnCode_t create_dynamic_sample_rc(DDS::DynamicData_ptr& dst, const NativeType& src) { CORBA::release(dst); DDS::DynamicType_var type = get_type(); @@ -136,7 +136,7 @@ class TypeSupportImpl_T DDS::DynamicData_ptr create_dynamic_sample(const NativeType& src) { DDS::DynamicData_var dst; - create_dynamic_sample_rc(src, dst); + create_dynamic_sample_rc(dst, src); return dst; } #endif diff --git a/dds/idl/IDLTemplate.txt b/dds/idl/IDLTemplate.txt index cadbc614de5..d536c2e8a09 100644 --- a/dds/idl/IDLTemplate.txt +++ b/dds/idl/IDLTemplate.txt @@ -12,11 +12,11 @@ local interface <%TYPE%>TypeSupport : OpenDDS::DCPS::TypeSupport { #ifndef OPENDDS_SAFETY_PROFILE // TODO: valuetype isn't supported in Java. @OpenDDS::internal::hidden_op_in_java(0) - ::DDS::ReturnCode_t create_sample_rc(in ::DDS::DynamicData src, inout <%SCOPED%> dst); + ::DDS::ReturnCode_t create_sample_rc(in ::DDS::DynamicData dst, inout <%SCOPED%> src); @OpenDDS::internal::hidden_op_in_java(0) <%SCOPED%> create_sample(in ::DDS::DynamicData src); @OpenDDS::internal::hidden_op_in_java(0) - ::DDS::ReturnCode_t create_dynamic_sample_rc(in <%SCOPED%> src, inout ::DDS::DynamicData dst); + ::DDS::ReturnCode_t create_dynamic_sample_rc(in <%SCOPED%> dst, inout ::DDS::DynamicData src); @OpenDDS::internal::hidden_op_in_java(0) ::DDS::DynamicData create_dynamic_sample(in <%SCOPED%> src); #endif diff --git a/dds/idl/ts_generator.cpp b/dds/idl/ts_generator.cpp index 38d75cc74b6..4d48cdbba21 100644 --- a/dds/idl/ts_generator.cpp +++ b/dds/idl/ts_generator.cpp @@ -333,11 +333,11 @@ bool ts_generator::generate_ts(AST_Type* node, UTL_ScopedName* name) if (op_ret_is_ptr) { be_global->impl_ << " " << short_cxx_name << "* value = new " << short_cxx_name << ";\n" - " const ::DDS::ReturnCode_t rc = " << ts_base << "::create_sample_rc(src, *value);\n"; + " const ::DDS::ReturnCode_t rc = " << ts_base << "::create_sample_rc(*value, src);\n"; } else { be_global->impl_ << " " << short_cxx_name << " value;\n" - " const ::DDS::ReturnCode_t rc = " << ts_base << "::create_sample_rc(src, value);\n"; + " const ::DDS::ReturnCode_t rc = " << ts_base << "::create_sample_rc(value, src);\n"; } be_global->impl_ << " if (rc != ::DDS::RETCODE_OK && OpenDDS::DCPS::log_level >= OpenDDS::DCPS::LogLevel::Warning) {\n" diff --git a/docs/devguide/xtypes.rst b/docs/devguide/xtypes.rst index bb8217591f9..e1b79c08b67 100644 --- a/docs/devguide/xtypes.rst +++ b/docs/devguide/xtypes.rst @@ -1385,7 +1385,7 @@ If the type contains a ``vector`` or ``string`` anywhere, then then it returns a Foo foo = type_support->create_sample(data); -``create_sample_rc`` is the same regardless and returns a ``ReturnCode_t`` to indicate failure: +Using ``create_sample_rc`` is the same regardless of the type and returns a ``ReturnCode_t`` to indicate failure: .. code-block:: cpp @@ -1393,7 +1393,7 @@ If the type contains a ``vector`` or ``string`` anywhere, then then it returns a DynamicData_var data = /* ... */; Foo foo; - DDS::ReturnCode_t rc = type_support->create_sample_rc(data, foo); + const DDS::ReturnCode_t rc = type_support->create_sample_rc(foo, data); if (rc != DDS::RETCODE_OK) /* (handle error) */; ``create_dynamic_sample`` and ``create_dynamic_sample_rc`` @@ -1416,7 +1416,7 @@ If the type contains a ``vector`` or ``string`` anywhere, then then it returns a Foo foo = /* ... */; DynamicData_var data; - DDS::ReturnCode_t rc = type_support->create_dynamic_sample_rc(foo, data); + const DDS::ReturnCode_t rc = type_support->create_dynamic_sample_rc(data, foo); if (rc != DDS::RETCODE_OK) /* (handle error) */; .. _xtypes-dynamic-data-adapter: @@ -1509,7 +1509,9 @@ Type System * IDL ``bitmask`` type -* Struct and union inheritance +* IDL ``bitset`` type + +* Struct inheritance .. _xtypes--annotations: diff --git a/tests/DCPS/Compiler/xcdr/xcdr.cpp b/tests/DCPS/Compiler/xcdr/xcdr.cpp index 82ac489e3e3..9c469a0885b 100644 --- a/tests/DCPS/Compiler/xcdr/xcdr.cpp +++ b/tests/DCPS/Compiler/xcdr/xcdr.cpp @@ -222,7 +222,7 @@ void amalgam_serializer_test_base( #if OPENDDS_HAS_DYNAMIC_DATA_ADAPTER typename DDSTraits::TypeSupportImplType tsi; DDS::DynamicData_var dd; - ASSERT_RC_OK(tsi.create_dynamic_sample_rc(value, dd)); + ASSERT_RC_OK(tsi.create_dynamic_sample_rc(dd, value)); DDS::DynamicData_ptr dd_ptr = dd.in(); if (key_only) { @@ -252,7 +252,7 @@ void amalgam_serializer_test_base( DDS::DynamicData_var ddi = new DynamicDataXcdrReadImpl(serializer, type, key_only ? Sample::KeyOnly: Sample::Full); typename DDSTraits::TypeSupportImplType tsi; - ASSERT_RC_OK(tsi.create_sample_rc(ddi, result)); + ASSERT_RC_OK(tsi.create_sample_rc(result, ddi)); #else ASSERT_TRUE(false); #endif