8 #ifndef OPENDDS_SAFETY_PROFILE 28 DDS::TypeDescriptor_var get_type_desc(DDS::DynamicType_ptr type)
31 ACE_ERROR((LM_WARNING,
"(%P|%t) WARNING: DynamicDataBase: " 32 "Passed null DynamicType pointer\n"));
33 return DDS::TypeDescriptor_var();
35 DDS::TypeDescriptor_var td;
39 ACE_ERROR((LM_WARNING,
"(%P|%t) WARNING: DynamicDataBase: " 40 "Failed to get type descriptor for %C\n", name.
in()));
64 DDS::DynamicTypeMember_var dtm;
69 return dtm->get_descriptor(value);
113 DDS::DynamicTypeMember_var member;
117 DDS::MemberDescriptor_var descriptor;
123 return descriptor->index();
125 return descriptor->id();
141 " Called function %C on an unsupported type (%C)\n",
155 switch (
type_->get_kind()) {
160 if (bound == 0 ||
id < bound) {
177 DDS::DynamicType_var mtype;
187 DDS::String8_var valAsStr;
193 strInOut = valAsStr._retn();
198 DDS::MemberDescriptor_var& md, DDS::DynamicType_var& type,
202 switch (
type_->get_kind()) {
226 const TypeKind type_kind = type->get_kind();
243 bool invalid_tk =
true;
245 invalid_tk = cmp_type_kind != tk;
254 "trying to %C %C.%C id %u kind %C (%C) as an invalid kind %C\n",
255 method, action, type_name.
in(), member_name.
in(), id,
274 DDS::DynamicTypeMember_var member;
281 DDS::MemberDescriptor_var mdesc;
285 if (mdesc->is_default_label()) {
286 default_branch = mdesc->id();
290 if (lseq[lbl] == disc_default) {
299 return default_branch;
303 bool& found_selected_member, DDS::MemberDescriptor_var& selected_md)
const 305 found_selected_member =
false;
306 bool has_default =
false;
308 DDS::MemberDescriptor_var default_md;
309 for (DDS::UInt32 i = 0; i <
type_->get_member_count(); ++i) {
310 DDS::DynamicTypeMember_var dtm;
311 rc =
type_->get_member_by_index(dtm, i);
318 DDS::MemberDescriptor_var md;
319 rc = dtm->get_descriptor(md);
323 bool found_matched_label =
false;
325 for (DDS::UInt32 j = 0; !found_matched_label && j < labels.
length(); ++j) {
326 if (disc == labels[j]) {
327 found_matched_label =
true;
330 if (found_matched_label) {
332 found_selected_member =
true;
335 if (md->is_default_label()) {
340 if (!found_selected_member && has_default) {
341 selected_md = default_md;
342 found_selected_member =
true;
348 bool& found_selected_member, DDS::MemberDescriptor_var& selected_md)
359 "union discriminator can't fit in int32: %q\n", i64_disc));
368 bool found_selected_member;
369 DDS::MemberDescriptor_var selected_md;
373 ACE_ERROR((
LM_WARNING,
"(%P|%t) WARNING: DynamicDataBase::discriminator_selects_no_member: " 378 return !found_selected_member;
384 DDS::TypeDescriptor_var type_descriptor;
395 DDS::DynamicTypeMember_var member;
400 DDS::MemberDescriptor_var descriptor;
401 ret = member->get_descriptor(descriptor);
405 if (descriptor->is_key()) {
416 warning ?
"WARNING" :
"NOTICE", method_name));
421 #ifndef OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE 430 return DDS::DynamicType::_duplicate(
type_);
455 ACE_ERROR((
LM_NOTICE,
"(%P|%t) NOTICE: DynamicDataBase::clone: Failed to create a copy\n"));
459 return new_copy._retn();
475 DDS::DynamicType_var member_type;
480 const TypeKind tk = member_type->get_kind();
487 value =
static_cast<DDS::Int64
>(tmp);
496 value =
static_cast<DDS::Int64
>(tmp);
513 value =
static_cast<DDS::Int64
>(tmp);
522 value =
static_cast<DDS::Int64
>(tmp);
531 value =
static_cast<DDS::Int64
>(tmp);
540 value =
static_cast<DDS::Int64
>(tmp);
545 return invalid_cast(
"get_int64_value",
TK_INT64, tk);
551 DDS::DynamicType_var member_type;
556 const TypeKind tk = member_type->get_kind();
572 value =
static_cast<DDS::UInt64
>(tmp);
583 value =
static_cast<DDS::UInt64
>(tmp);
612 return invalid_cast(
"get_uint64_value",
TK_UINT64, tk);
621 #endif // OPENDDS_SAFETY_PROFILE
const TypeKind TK_SEQUENCE
bool is_complex(TypeKind tk)
const LogLevel::Value value
DDS::ReturnCode_t unsupported_method(const char *method_name, bool warning=false) const
const TypeKind TK_STRING16
const TypeKind TK_FLOAT128
DDS::ReturnCode_t get_byte_value(inout octet value, in MemberId id)
DDS::ReturnCode_t get_member_type(DDS::DynamicType_var &member_type, DDS::DynamicType_ptr container_type, DDS::MemberId id)
DDS::ReturnCode_t return_loaned_value(DDS::DynamicData_ptr other)
DynamicData_ptr create_data(DynamicType_ptr type)
bool is_type_supported(TypeKind tk, const char *func_name)
Verify that a given type is primitive or string or wstring.
DDS::DynamicType_var get_base_type(DDS::DynamicType_ptr type)
const ACE_CDR::ULong DISCRIMINATOR_ID
Implementation specific sentinel for a union discriminator used in DynamicData.
DDS::TypeDescriptor_var type_desc_
DDS::ReturnCode_t get_boolean_value(inout boolean value, in MemberId id)
DDS::ReturnCode_t get_descriptor(inout TypeDescriptor descriptor)
DDS::Boolean equals(DDS::DynamicData_ptr other)
DDS::ReturnCode_t get_int64_value(DDS::Int64 &value, DDS::MemberId id)
DDS::ReturnCode_t get_descriptor(DDS::MemberDescriptor *&value, MemberId id)
static DDS::MemberId get_union_default_member(DDS::DynamicType *type)
static DynamicDataFactory_ptr get_instance()
const TypeKind TK_BOOLEAN
const char * typekind_to_string(TypeKind tk)
DDS::ReturnCode_t get_enum_value(DDS::Int32 &value, DDS::DynamicType_ptr enum_type, DDS::DynamicData_ptr src, DDS::MemberId id)
static bool has_explicit_keys(DDS::DynamicType *dt)
const TypeKind TK_BITMASK
DDS::ReturnCode_t get_member_by_index(inout DynamicTypeMember member, in unsigned long index)
DDS::ReturnCode_t check_member(DDS::MemberDescriptor_var &member_desc, DDS::DynamicType_var &member_type, const char *method, const char *action, DDS::MemberId id, DDS::TypeKind tk=TK_NONE)
DDS::DynamicData_ptr clone()
bool get_index_from_id(DDS::MemberId id, ACE_CDR::ULong &index, ACE_CDR::ULong bound) const
virtual DDS::ReturnCode_t get_uint64_value_impl(DDS::UInt64 &value, DDS::MemberId id)=0
const ACE_CDR::ULong MEMBER_ID_INVALID
DDS::DynamicType_var type_
The actual (i.e., non-alias) DynamicType of the associated type.
const ReturnCode_t RETCODE_ILLEGAL_OPERATION
DDS::MemberId get_member_id_by_name(const char *name)
const TypeKind TK_STRUCTURE
const TypeKind TK_FLOAT32
DDS::DynamicData_ptr loan_value(DDS::MemberId id)
const TypeKind TK_STRING8
DDS::ReturnCode_t get_char16_value(inout wchar value, in MemberId id)
DDS::ReturnCode_t get_char8_value(inout char value, in MemberId id)
unsigned long get_member_count()
DDS::DynamicType_ptr type()
DDS::DynamicData * interface_from_this() const
OpenDDS_Dcps_Export LogLevel log_level
DDS::ReturnCode_t enum_bound(DDS::DynamicType_ptr enum_type, DDS::TypeKind &bound_kind)
const char * retcode_to_string(DDS::ReturnCode_t value)
virtual DDS::ReturnCode_t get_simple_value(DCPS::Value &value, DDS::MemberId id)
DDS::ReturnCode_t copy(DDS::DynamicData_ptr dest, DDS::DynamicData_ptr src)
const ReturnCode_t RETCODE_ERROR
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
DDS::ReturnCode_t get_enumerator_name(DDS::String8_var &name, DDS::Int32 value, DDS::DynamicType_ptr type)
const ReturnCode_t RETCODE_OK
DDS::ReturnCode_t get_uint64_value(DDS::UInt64 &value, DDS::MemberId id)
DDS::ReturnCode_t get_int_value(DDS::Int64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
const ReturnCode_t RETCODE_UNSUPPORTED
bool discriminator_selects_no_member(DDS::Int32 disc) const
DDS::ReturnCode_t get_uint_value(DDS::UInt64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
const character_type * in(void) const
unsigned char_value(CharType value)
DDS::ReturnCode_t bitmask_bound(DDS::DynamicType_ptr type, DDS::TypeKind &bound_kind)
The Internal API and Implementation of OpenDDS.
bool enum_string_helper(char *&strInOut, MemberId id)
DDS::ReturnCode_t get_selected_union_branch(DDS::Int32 disc, bool &found_selected_member, DDS::MemberDescriptor_var &selected_md) const
DDS::ReturnCode_t set_descriptor(DDS::MemberId id, DDS::MemberDescriptor *value)
ACE_CDR::ULong length() const
const TypeKind TK_FLOAT64
virtual DDS::ReturnCode_t get_int64_value_impl(DDS::Int64 &value, DDS::MemberId id)=0
bool is_basic(TypeKind tk)
const ReturnCode_t RETCODE_BAD_PARAMETER