Line data Source code
1 : #include <DCPS/DdsDcps_pch.h> 2 : 3 : #ifndef OPENDDS_SAFETY_PROFILE 4 : 5 : #include "TypeDescriptorImpl.h" 6 : 7 : #include "DynamicTypeImpl.h" 8 : 9 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 10 : namespace OpenDDS { 11 : namespace XTypes { 12 : 13 2777 : TypeDescriptorImpl::TypeDescriptorImpl() 14 : { 15 2777 : kind(TK_NONE); 16 2777 : extensibility_kind(DDS::FINAL); 17 2777 : is_nested(false); 18 2777 : } 19 : 20 5554 : TypeDescriptorImpl::~TypeDescriptorImpl() 21 5554 : {} 22 : 23 0 : bool TypeDescriptorImpl::equals(DDS::TypeDescriptor* other) 24 : { 25 0 : DynamicTypePtrPairSeen dt_ptr_pair; 26 0 : return test_equality(this, other, dt_ptr_pair); 27 0 : } 28 : 29 0 : CORBA::ValueBase* TypeDescriptorImpl::_copy_value() 30 : { 31 0 : ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_copy_value is not implemented\n")); 32 0 : return 0; 33 : } 34 : 35 0 : CORBA::TypeCode_ptr TypeDescriptorImpl::_tao_type() const 36 : { 37 0 : ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_tao_type is not implemented\n")); 38 0 : return 0; 39 : } 40 : 41 0 : DDS::ReturnCode_t TypeDescriptorImpl::copy_from(DDS::TypeDescriptor*) 42 : { 43 : // FUTURE 44 0 : return DDS::RETCODE_UNSUPPORTED; 45 : } 46 : 47 0 : CORBA::Boolean TypeDescriptorImpl::is_consistent() 48 : { 49 : // FUTURE 50 0 : ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::is_consistent is not implemented\n")); 51 0 : return false; 52 : } 53 : 54 0 : CORBA::Boolean TypeDescriptorImpl::_tao_marshal__DDS_TypeDescriptor(TAO_OutputCDR&, TAO_ChunkInfo&) const 55 : { 56 0 : ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_tao_marshal__DDS_TypeDescriptor is not implemented\n")); 57 0 : return false; 58 : } 59 : 60 0 : CORBA::Boolean TypeDescriptorImpl::_tao_unmarshal__DDS_TypeDescriptor(TAO_InputCDR&, TAO_ChunkInfo&) 61 : { 62 0 : ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_tao_unmarshal__DDS_TypeDescriptor is not implemented\n")); 63 0 : return false; 64 : } 65 : 66 42 : inline bool operator==(const DDS::BoundSeq& lhs, const DDS::BoundSeq& rhs) 67 : { 68 42 : if (lhs.length() == rhs.length()) { 69 53 : for (ACE_CDR::ULong i = 0 ; i < lhs.length() ; ++i) { 70 11 : if (lhs[i] != rhs[i]) { 71 0 : return false; 72 : } 73 : } 74 42 : return true; 75 : } 76 0 : return false; 77 : } 78 : 79 42 : bool test_equality(DDS::TypeDescriptor* lhs, DDS::TypeDescriptor* rhs, DynamicTypePtrPairSeen& dt_ptr_pair) 80 : { 81 42 : if (lhs == rhs) { 82 0 : return true; 83 : } 84 : 85 42 : if (!lhs || !rhs) { 86 0 : return false; 87 : } 88 : 89 : return 90 42 : lhs->kind() == rhs->kind() && 91 42 : std::strcmp(lhs->name(), rhs->name()) == 0 && 92 42 : test_equality(lhs->base_type(), rhs->base_type(), dt_ptr_pair) && 93 42 : test_equality(lhs->discriminator_type(), rhs->discriminator_type(), dt_ptr_pair) && 94 42 : lhs->bound() == rhs->bound() && 95 42 : test_equality(lhs->element_type(), rhs->element_type(), dt_ptr_pair) && 96 42 : test_equality(lhs->key_element_type(), rhs->key_element_type(), dt_ptr_pair) && 97 126 : lhs->extensibility_kind() == rhs->extensibility_kind() && 98 84 : lhs->is_nested() == rhs->is_nested(); 99 : } 100 : 101 : } // namespace XTypes 102 : } // namespace OpenDDS 103 : 104 : OPENDDS_END_VERSIONED_NAMESPACE_DECL 105 : 106 : #endif // OPENDDS_SAFETY_PROFILE