8 #ifndef OPENDDS_SAFETY_PROFILE 32 switch (base_type->get_kind()) {
36 DDS::TypeDescriptor_var td;
58 const TypeKind tk = base_type->get_kind();
63 DDS::DynamicTypeMembersById_var members;
64 rc = base_type->get_all_members(members);
76 it != members_impl->
end(); ++it) {
77 DDS::MemberDescriptor_var md;
78 rc = it->second->get_descriptor(md);
83 DDS::DynamicType_ptr member_type = md->type();
92 ext = std::max(member_ext, ext);
113 DDS::DynamicType_ptr type, DDS::DynamicTypeMember_var& member)
125 MemberIdVec::iterator it =
ids.begin();
126 DDS::DynamicType_var current_type = DDS::DynamicType::_duplicate(type);
127 DDS::DynamicTypeMember_var current_member;
134 if (++it ==
ids.end()) {
138 DDS::MemberDescriptor_var md;
139 rc = current_member->get_descriptor(md);
149 member = current_member;
155 DDS::DynamicData_ptr data, DDS::DynamicData_var& container,
DDS::MemberId& member_id)
162 MemberIdVec::iterator it =
ids.begin();
163 DDS::DynamicData_var current_container = DDS::DynamicData::_duplicate(data);
166 if (++it ==
ids.end()) {
167 member_id = current_id;
171 DDS::DynamicData_var next;
176 current_container = next;
178 container = current_container;
191 const TypeKind kind = base_type->get_kind();
195 DDS::DynamicTypeMembersById_var members;
213 it != members_i->
end(); ++it) {
214 DDS::MemberDescriptor_var md;
227 it != members_i->
end(); ++it) {
228 DDS::MemberDescriptor_var md;
233 if ((filter ==
Filter_NonKeys) != (include_all || md->is_key())) {
235 rc = get_values_i(md->type(), paths,
247 DDS::DynamicTypeMember_var disc;
250 bool include =
false;
259 DDS::MemberDescriptor_var md;
260 rc = disc->get_descriptor(md);
276 paths.push_back(this_path);
282 if (base_path.
level() == 0) {
285 "get_values was passed an invalid topic type: %C\n",
290 paths.push_back(base_path);
300 return get_values_i(type, paths, filter,
MemberPath());
313 count = paths.size();
319 template <
typename T>
320 void cmp(
int& result, T a, T b)
339 DDS::DynamicType_var data_type = data->type();
340 if (sequence_like(data_type->get_kind())) {
341 DDS::TypeDescriptor_var td;
348 DDS::MemberDescriptor_var md;
362 DDS::DynamicType_var a_type;
369 DDS::DynamicType_var b_type;
370 rc = get_member_type(b_type, b_data, b_id);
379 "trying to compare a %C to a %C\n",
393 a_rc = a_data->get_boolean_value(a_value, a_id);
396 b_rc = b_data->get_boolean_value(b_value, b_id);
398 cmp(result, a_value, b_value);
407 a_rc = a_data->get_byte_value(a_value, a_id);
410 b_rc = b_data->get_byte_value(b_value, b_id);
412 cmp(result, a_value, b_value);
429 cmp(result, a_value, b_value);
446 cmp(result, a_value, b_value);
455 a_rc = a_data->get_float32_value(a_value, a_id);
458 b_rc = b_data->get_float32_value(b_value, b_id);
460 cmp(result, a_value, b_value);
469 a_rc = a_data->get_float64_value(a_value, a_id);
472 b_rc = b_data->get_float64_value(b_value, b_id);
474 cmp(result, a_value, b_value);
483 a_rc = a_data->get_float128_value(a_value, a_id);
486 b_rc = b_data->get_float128_value(b_value, b_id);
488 cmp(result, a_value, b_value);
497 a_rc = a_data->get_char8_value(a_value, a_id);
500 b_rc = b_data->get_char8_value(b_value, b_id);
502 cmp(result, a_value, b_value);
511 a_rc = a_data->get_char16_value(a_value, a_id);
514 b_rc = b_data->get_char16_value(b_value, b_id);
516 cmp(result, a_value, b_value);
525 a_rc = a_data->get_string_value(a_value, a_id);
528 b_rc = b_data->get_string_value(b_value, b_id);
530 result = std::strcmp(a_value.
in(), b_value.
in());
539 a_rc = a_data->get_wstring_value(a_value, a_id);
542 b_rc = b_data->get_wstring_value(b_value, b_id);
544 result = std::wcscmp(a_value.
in(), b_value.
in());
558 cmp(result, a_value, b_value);
572 cmp(result, a_value, b_value);
588 DDS::DynamicData_var a_value;
589 a_rc = a_data->get_complex_value(a_value, a_id);
591 DDS::DynamicData_var b_value;
592 b_rc = b_data->get_complex_value(b_value, b_id);
603 a_rc = b_rc = member_compare(result,
604 a_value, a_value->get_member_id_at_index(i),
605 b_value, b_value->get_member_id_at_index(i));
607 if (result == 0 && a_count != b_count) {
608 result = count == a_count ? -1 : 1;
643 "Could not compare member type %C id %u from %C (%C) to %C (%C)\n",
655 bool& result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b,
Filter filter)
657 DDS::DynamicType_var a_type = a->type();
669 for (MemberPathVec::iterator it = paths.begin(); it != paths.end(); it++) {
670 DDS::DynamicData_var a_container;
672 rc = it->get_member_from_data(a, a_container, a_member_id);
676 "get_member_from_data for a failed: %C\n",
682 DDS::DynamicData_var b_container;
684 rc = it->get_member_from_data(b, b_container, b_member_id);
688 "get_member_from_data for b failed: %C\n",
695 rc = member_compare(compare, a_container, a_member_id, b_container, b_member_id);
700 result = compare < 0;
747 rc = src->get_uint8_value(v,
id);
756 rc = src->get_uint16_value(v,
id);
765 rc = src->get_uint32_value(v,
id);
772 rc = src->get_uint64_value(value,
id);
786 rc = src->get_int8_value(v,
id);
795 rc = src->get_int16_value(v,
id);
804 rc = src->get_int32_value(v,
id);
811 rc = src->get_int64_value(value,
id);
824 "expected bitmask, got %C\n",
830 DDS::TypeDescriptor_var td;
836 const size_t bound_size = td->bound()[0];
837 if (bound_size >= 1 && bound_size <= 8) {
839 }
else if (bound_size >= 9 && bound_size <= 16) {
841 }
else if (bound_size >= 17 && bound_size <= 32) {
843 }
else if (bound_size >= 33 && bound_size <= 64) {
848 "Got unexpected bound size %B\n",
853 bound_max = (1 << bound_size) - 1;
875 "expected enum, got %C\n",
881 DDS::TypeDescriptor_var td;
887 const size_t bound_size = td->bound()[0];
888 if (bound_size >= 1 && bound_size <= 8) {
890 }
else if (bound_size >= 9 && bound_size <= 16) {
892 }
else if (bound_size >= 17 && bound_size <= 32) {
897 "Got unexpected bound size %B\n",
926 #endif // OPENDDS_SAFETY_PROFILE DDS::ReturnCode_t get_values(DDS::DynamicType_ptr type, MemberPathVec &paths, Filter filter)
DDS::ReturnCode_t key_less_than(bool &result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b)
DDS::ReturnCode_t less_than(bool &result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b, Filter filter)
const ReturnCode_t RETCODE_ILLEGAL_OPERATION
The Internal API and Implementation of OpenDDS.
const ReturnCode_t RETCODE_OK
const TypeKind TK_FLOAT32
const TypeKind TK_STRING8
MemberPath & id(DDS::MemberId id)
DDS::ReturnCode_t enum_bound(DDS::DynamicType_ptr type, DDS::TypeKind &bound_kind)
const_iterator end() const
const char * retcode_to_string(DDS::ReturnCode_t value)
const TypeKind TK_BOOLEAN
const TypeKind TK_STRING16
const ReturnCode_t RETCODE_BAD_PARAMETER
const TypeKind TK_FLOAT128
DDS::ReturnCode_t get_bitmask_value(CORBA::UInt64 &value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
bool is_int(DDS::TypeKind tk)
const TypeKind TK_FLOAT64
DCPS::Extensibility dds_to_opendds_ext(DDS::ExtensibilityKind ext)
const ACE_CDR::ULong DISCRIMINATOR_ID
Implementation specific sentinel for a union discriminator used in DynamicData.
DDS::ReturnCode_t get_keys(DDS::DynamicType_ptr type, MemberPathVec &paths)
const TypeKind TK_STRUCTURE
const LogLevel::Value value
DDS::ReturnCode_t get_uint_value(CORBA::UInt64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
DDS::ReturnCode_t get_member_from_type(DDS::DynamicType_ptr type, DDS::DynamicTypeMember_var &member)
DDS::ReturnCode_t get_member_from_data(DDS::DynamicData_ptr data, DDS::DynamicData_var &container, DDS::MemberId &member_id)
OpenDDS_Dcps_Export LogLevel log_level
DDS::DynamicType_var get_base_type(DDS::DynamicType_ptr type)
const TypeKind TK_ANNOTATION
const character_type * in(void) const
const char * typekind_to_string(TypeKind tk)
DDS::ReturnCode_t get_int_value(CORBA::Int64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
MapType::const_iterator const_iterator
DDS::ReturnCode_t get_enum_value(CORBA::Int32 &value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id)
DDS::ReturnCode_t max_extensibility(DDS::DynamicType_ptr type, DCPS::Extensibility &ext)
const TypeKind TK_BITMASK
#define OPENDDS_ASSERT(C)
const_iterator begin() const
DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t &count)
DDS::ReturnCode_t bitmask_bound(DDS::DynamicType_ptr type, CORBA::UInt64 &bound_max, DDS::TypeKind &bound_kind)
bool is_uint(DDS::TypeKind tk)
extensibility(MUTABLE) struct TypeLookup_getTypes_In
const TypeKind TK_SEQUENCE