Add XTypes Runtime XML/JSON Support for Interop Tests#5217
Add XTypes Runtime XML/JSON Support for Interop Tests#5217simpsont-oci wants to merge 14 commits into
Conversation
e1a6326 to
5882a72
Compare
1fe5eae to
9d338f9
Compare
|
|
||
| OpenDDS_Dcps_Export DDS::ReturnCode_t dynamic_data_from_json_file( | ||
| DDS::DynamicData_ptr data, | ||
| const ACE_TString& json_file, |
| return DDS::RETCODE_BAD_PARAMETER; | ||
| } | ||
| DDS::DynamicType_var discriminator_type = get_base_type(td->discriminator_type()); | ||
| DDS::Int32 discriminator_value = 0; |
There was a problem hiding this comment.
Does this need to handle 64-bit discriminators?
| case TK_ARRAY: | ||
| case TK_SEQUENCE: | ||
| return populate_collection(data, base, value, options, path); |
There was a problem hiding this comment.
Should this (across the entire PR, not just here) support TK_MAP as well?
ecd8be8 to
765beb3
Compare
| DDS::TypeDescriptor_var descriptor; | ||
| if (!get_type_descriptor(descriptor, type)) { | ||
| return DDS::DynamicType::_nil(); | ||
| } |
There was a problem hiding this comment.
descriptor is obtained here but not used after that -- looks like it is used to check if a valid TypeDescriptor is present?
get_base_type call at line 544 has similar checks to the new get_type_descriptor function, so it looks like there are some duplicates here. Could we use the existing get_base_type function in places where safe_base_type is being used?
| if (lhs_rc != DDS::RETCODE_OK) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Should this return false because this looks like an error case when it fails to get the nested dynamic data objects to continue comparing?
| const bool member_equal = data_equal_i(lhs, rhs, md->id(), md->id(), md->type()); | ||
| if (!member_equal) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
| const bool member_equal = data_equal_i(lhs, rhs, md->id(), md->id(), md->type()); | |
| if (!member_equal) { | |
| return false; | |
| } | |
| if (!data_equal_i(lhs, rhs, md->id(), md->id(), md->type())) { | |
| return false; | |
| } |
| DDS::UInt32 lhs_count = lhs->get_item_count(); | ||
| DDS::UInt32 rhs_count = rhs->get_item_count(); |
There was a problem hiding this comment.
| DDS::UInt32 lhs_count = lhs->get_item_count(); | |
| DDS::UInt32 rhs_count = rhs->get_item_count(); | |
| const DDS::UInt32 lhs_count = lhs->get_item_count(); | |
| const DDS::UInt32 rhs_count = rhs->get_item_count(); |
| if (kind == TK_ARRAY) { | ||
| lhs_count = rhs_count = bound_total(td); |
There was a problem hiding this comment.
I think lhs_count and rhs_count have already been set by the above get_item_count calls, so this may be redundant.
| CORBA::Boolean left = false, right = false; | ||
| left_rc = lhs->get_boolean_value(left, lhs_id); | ||
| right_rc = rhs->get_boolean_value(right, rhs_id); | ||
| return left_rc == right_rc && (left_rc != DDS::RETCODE_OK || left == right); |
There was a problem hiding this comment.
This returns true when left_rc == right_rc and both are not RETCODE_OK. Shouldn't it return false instead in that case? The other switch cases have the same logic.
This adds the OpenDDS-side runtime XTypes pieces needed to drive the dds-xtypes interop harness with OpenDDS participants.