8 #ifndef OPENDDS_SAFETY_PROFILE 33 switch (base_type->get_kind()) {
37 DDS::TypeDescriptor_var td;
59 const TypeKind tk = base_type->get_kind();
64 DDS::DynamicTypeMembersById_var members;
65 rc = base_type->get_all_members(members);
77 it != members_impl->
end(); ++it) {
78 DDS::MemberDescriptor_var md;
79 rc = it->second->get_descriptor(md);
84 DDS::DynamicType_ptr member_type = md->type();
93 ext = std::max(member_ext, ext);
118 "at pos %B with %B left trying to increment by %B\n",
pos,
left, by));
134 "empty or null path\n"));
142 const bool nested_member =
left > 0 ? path[0] ==
'.' :
false;
143 if (nested_member &&
pos == 0) {
146 "at pos 0 found unexpected '.'\n"));
159 for (; i <
left && scan; ++i) {
167 "at pos %B unexpected '%c' in a subscript\n",
pos + i, c));
186 "at pos %B expected to find a ']' to end subscript\n",
pos + i));
195 const char*
const expected =
in_subscript ?
"index or key" :
"member name";
198 "at pos %B expected to find %C before '%c'\n",
pos + i, expected, c));
201 "at pos %B expected to find %C before the end of the path\n",
pos + i, expected));
216 subpath.find_first_not_of(
"0123456789") != DCPS::String::npos) {
219 "\"%C\" is not a valid subscript index\n",
subpath.c_str()));
239 "given \"%C\", which contains subscripts and these are currently not supported\n",
244 DDS::DynamicTypeMember_var dtm;
251 DDS::MemberDescriptor_var md;
252 rc = dtm->get_descriptor(md);
265 "parser failed to parse \"%C\"\n", path.c_str()));
273 DDS::DynamicType_ptr type, DDS::DynamicTypeMember_var& member)
285 MemberIdVec::iterator it = ids.begin();
286 DDS::DynamicType_var current_type = DDS::DynamicType::_duplicate(type);
287 DDS::DynamicTypeMember_var current_member;
294 if (++it == ids.end()) {
298 DDS::MemberDescriptor_var md;
299 rc = current_member->get_descriptor(md);
309 member = current_member;
315 DDS::DynamicData_ptr data, DDS::DynamicData_var& container,
DDS::MemberId& member_id)
322 MemberIdVec::iterator it = ids.begin();
323 DDS::DynamicData_var current_container = DDS::DynamicData::_duplicate(data);
326 if (++it == ids.end()) {
327 member_id = current_id;
331 DDS::DynamicData_var next;
336 current_container = next;
338 container = current_container;
351 const TypeKind kind = base_type->get_kind();
355 DDS::DynamicTypeMembersById_var members;
373 it != members_i->
end(); ++it) {
374 DDS::MemberDescriptor_var md;
387 it != members_i->
end(); ++it) {
388 DDS::MemberDescriptor_var md;
393 if ((filter ==
Filter_NonKeys) != (include_all || md->is_key())) {
395 rc = get_values_i(md->type(), paths,
407 DDS::DynamicTypeMember_var disc;
410 bool include =
false;
419 DDS::MemberDescriptor_var md;
420 rc = disc->get_descriptor(md);
436 paths.push_back(this_path);
442 if (base_path.
level() == 0) {
445 "get_values was passed an invalid topic type: %C\n",
450 paths.push_back(base_path);
460 return get_values_i(type, paths, filter,
MemberPath());
473 count = paths.size();
478 bool is_key(DDS::DynamicType_ptr type,
const char* field)
484 for (
size_t i = 0; i < paths.size(); ++i) {
485 DDS::DynamicTypeMember_var m;
490 if (0 == std::strcmp(name, field)) {
498 template <
typename T>
499 void cmp(
int& result, T a, T b)
519 DDS::DynamicType_var a_type;
526 DDS::DynamicType_var b_type;
536 "trying to compare a %C to a %C\n",
550 a_rc = a_data->get_boolean_value(a_value, a_id);
553 b_rc = b_data->get_boolean_value(b_value, b_id);
555 cmp(result, a_value, b_value);
564 a_rc = a_data->get_byte_value(a_value, a_id);
567 b_rc = b_data->get_byte_value(b_value, b_id);
569 cmp(result, a_value, b_value);
586 cmp(result, a_value, b_value);
603 cmp(result, a_value, b_value);
612 a_rc = a_data->get_float32_value(a_value, a_id);
615 b_rc = b_data->get_float32_value(b_value, b_id);
617 cmp(result, a_value, b_value);
626 a_rc = a_data->get_float64_value(a_value, a_id);
629 b_rc = b_data->get_float64_value(b_value, b_id);
631 cmp(result, a_value, b_value);
640 a_rc = a_data->get_float128_value(a_value, a_id);
643 b_rc = b_data->get_float128_value(b_value, b_id);
645 cmp(result, a_value, b_value);
654 a_rc = a_data->get_char8_value(a_value, a_id);
657 b_rc = b_data->get_char8_value(b_value, b_id);
659 cmp(result, a_value, b_value);
668 a_rc = a_data->get_char16_value(a_value, a_id);
671 b_rc = b_data->get_char16_value(b_value, b_id);
673 cmp(result, a_value, b_value);
682 a_rc = a_data->get_string_value(a_value, a_id);
685 b_rc = b_data->get_string_value(b_value, b_id);
687 result = std::strcmp(a_value.
in(), b_value.
in());
696 a_rc = a_data->get_wstring_value(a_value, a_id);
699 b_rc = b_data->get_wstring_value(b_value, b_id);
701 result = std::wcscmp(a_value.
in(), b_value.
in());
715 cmp(result, a_value, b_value);
729 cmp(result, a_value, b_value);
745 DDS::DynamicData_var a_value;
746 a_rc = a_data->get_complex_value(a_value, a_id);
748 DDS::DynamicData_var b_value;
749 b_rc = b_data->get_complex_value(b_value, b_id);
760 a_rc = b_rc = member_compare(result,
761 a_value, a_value->get_member_id_at_index(i),
762 b_value, b_value->get_member_id_at_index(i));
764 if (result == 0 && a_count != b_count) {
765 result = count == a_count ? -1 : 1;
800 "Could not compare member type %C id %u from %C (%C) to %C (%C)\n",
812 bool& result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b,
Filter filter)
814 DDS::DynamicType_var a_type = a->type();
826 for (MemberPathVec::iterator it = paths.begin(); it != paths.end(); it++) {
827 DDS::DynamicData_var a_container;
829 rc = it->get_member_from_data(a, a_container, a_member_id);
833 "get_member_from_data for a failed: %C\n",
839 DDS::DynamicData_var b_container;
841 rc = it->get_member_from_data(b, b_container, b_member_id);
845 "get_member_from_data for b failed: %C\n",
852 rc = member_compare(compare, a_container, a_member_id, b_container, b_member_id);
857 result = compare < 0;
872 return member_compare(result, a,
id, b,
id);
878 if (sequence_like(container_type->get_kind())) {
879 DDS::TypeDescriptor_var td;
886 DDS::DynamicTypeMember_var dtm;
891 DDS::MemberDescriptor_var md;
892 rc = dtm->get_descriptor(md);
935 rc = src->get_uint8_value(v,
id);
944 rc = src->get_uint16_value(v,
id);
953 rc = src->get_uint32_value(v,
id);
960 rc = src->get_uint64_value(value,
id);
971 return src->set_uint8_value(
id, static_cast<DDS::UInt8>(value));
973 return src->set_uint16_value(
id, static_cast<DDS::UInt16>(value));
975 return src->set_uint32_value(
id, static_cast<DDS::UInt32>(value));
977 return src->set_uint64_value(
id, value);
990 rc = src->get_int8_value(v,
id);
999 rc = src->get_int16_value(v,
id);
1008 rc = src->get_int32_value(v,
id);
1015 rc = src->get_int64_value(value,
id);
1026 return src->set_int8_value(
id, static_cast<DDS::Int8>(value));
1028 return src->set_int16_value(
id, static_cast<DDS::Int16>(value));
1030 return src->set_int32_value(
id, static_cast<DDS::Int32>(value));
1032 return src->set_int64_value(
id, value);
1043 "expected bitmask, got %C\n",
1049 DDS::TypeDescriptor_var td;
1055 const size_t bound_size = td->bound()[0];
1056 if (bound_size >= 1 && bound_size <= 8) {
1058 }
else if (bound_size >= 9 && bound_size <= 16) {
1060 }
else if (bound_size >= 17 && bound_size <= 32) {
1062 }
else if (bound_size >= 33 && bound_size <= 64) {
1067 "Got unexpected bound size %B\n",
1092 "expected enum, got %C\n",
1098 DDS::TypeDescriptor_var td;
1104 const size_t bound_size = td->bound()[0];
1105 if (bound_size >= 1 && bound_size <= 8) {
1107 }
else if (bound_size >= 9 && bound_size <= 16) {
1109 }
else if (bound_size >= 17 && bound_size <= 32) {
1114 "Got unexpected bound size %B\n",
1140 DDS::String8_var&
name, DDS::Int32
value, DDS::DynamicType_ptr type)
1142 DDS::DynamicTypeMember_var dtm;
1143 DDS::ReturnCode_t rc = type->get_member(dtm, static_cast<DDS::MemberId>(value));
1148 DDS::MemberDescriptor_var md;
1149 rc = dtm->get_descriptor(md);
1159 DDS::Int32&
value,
const char*
name, DDS::DynamicType_ptr type)
1161 DDS::DynamicTypeMember_var dtm;
1167 DDS::MemberDescriptor_var md;
1168 rc = dtm->get_descriptor(md);
1173 value =
static_cast<DDS::Int32
>(md->id());
1189 DDS::DynamicType_ptr type, DDS::DynamicData_ptr src,
DDS::MemberId id,
const char* enumeral_name)
1191 DDS::DynamicTypeMember_var dtm;
1196 "No such enumeral named \"%C\"\n",
1201 DDS::MemberDescriptor_var md;
1202 rc = dtm->get_descriptor(md);
1213 #endif // OPENDDS_SAFETY_PROFILE
OpenDDS_Dcps_Export LogLevel log_level
const char * retcode_to_string(DDS::ReturnCode_t value)
const_iterator begin() const
const LogLevel::Value value
const TypeKind TK_ANNOTATION
DDS::ReturnCode_t get_enumerator_value(DDS::Int32 &value, const char *name, DDS::DynamicType_ptr type)
const ReturnCode_t RETCODE_ILLEGAL_OPERATION
const TypeKind TK_FLOAT128
DDS::ReturnCode_t get_member_type(DDS::DynamicType_var &member_type, DDS::DynamicType_ptr container_type, DDS::MemberId id)
const ReturnCode_t RETCODE_OK
DDS::DynamicType_var get_base_type(DDS::DynamicType_ptr type)
DDS::ReturnCode_t get_int_value(CORBA::Int64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
const ReturnCode_t RETCODE_BAD_PARAMETER
DDS::ReturnCode_t max_extensibility(DDS::DynamicType_ptr type, DCPS::Extensibility &ext)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
const_iterator end() const
DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t &count)
DDS::ReturnCode_t set_enum_value(DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id, CORBA::Int32 value)
const ACE_CDR::ULong DISCRIMINATOR_ID
Implementation specific sentinel for a union discriminator used in DynamicData.
#define OPENDDS_ASSERT(C)
bool is_key(DDS::DynamicType_ptr type, const char *field)
const TypeKind TK_STRING16
DDS::ReturnCode_t key_less_than(bool &result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b)
The Internal API and Implementation of OpenDDS.
bool convertToInteger(const String &s, T &value)
const TypeKind TK_STRUCTURE
bool get_index(CORBA::UInt32 &index)
DDS::ReturnCode_t set_int_value(DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind, CORBA::Int64 value)
DDS::ReturnCode_t compare_members(int &result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b, DDS::MemberId id)
DDS::ReturnCode_t bitmask_bound(DDS::DynamicType_ptr type, DDS::TypeKind &bound_kind)
const TypeKind TK_BITMASK
const TypeKind TK_FLOAT32
DDS::ReturnCode_t get_keys(DDS::DynamicType_ptr type, MemberPathVec &paths)
DDS::ReturnCode_t set_uint_value(DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind, CORBA::UInt64 value)
const TypeKind TK_BOOLEAN
DDS::ReturnCode_t enum_bound(DDS::DynamicType_ptr type, DDS::TypeKind &bound_kind)
bool is_int(DDS::TypeKind tk)
DDS::ReturnCode_t get_member_from_type(DDS::DynamicType_ptr type, DDS::DynamicTypeMember_var &member)
const TypeKind TK_FLOAT64
const TypeKind TK_STRING8
DDS::ReturnCode_t get_bitmask_value(CORBA::UInt64 &value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id)
const TypeKind TK_SEQUENCE
DDS::ReturnCode_t get_member_from_data(DDS::DynamicData_ptr data, DDS::DynamicData_var &container, DDS::MemberId &member_id)
MemberPath & id(DDS::MemberId id)
bool is_uint(DDS::TypeKind tk)
DDS::ReturnCode_t get_uint_value(CORBA::UInt64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
DDS::ReturnCode_t less_than(bool &result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b, Filter filter)
const char * typekind_to_string(TypeKind tk)
DDS::ReturnCode_t get_enum_value(CORBA::Int32 &value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id)
MapType::const_iterator const_iterator
DDS::ReturnCode_t get_enumerator_name(DDS::String8_var &name, DDS::Int32 value, DDS::DynamicType_ptr type)
DDS::ReturnCode_t get_values(DDS::DynamicType_ptr type, MemberPathVec &paths, Filter filter)
const character_type * in(void) const
const ReturnCode_t RETCODE_UNSUPPORTED
extensibility(MUTABLE) struct TypeLookup_getTypes_In
DDS::ReturnCode_t resolve_string_path(DDS::DynamicType_ptr type, const DCPS::String &path)
DCPS::Extensibility dds_to_opendds_ext(DDS::ExtensibilityKind ext)