OpenDDS  Snapshot(2023/04/28-20:55)
TypeDescriptorImpl.cpp
Go to the documentation of this file.
1 #include <DCPS/DdsDcps_pch.h>
2 
3 #ifndef OPENDDS_SAFETY_PROFILE
4 
5 #include "TypeDescriptorImpl.h"
6 
7 #include "DynamicTypeImpl.h"
8 
10 namespace OpenDDS {
11 namespace XTypes {
12 
14 {
15  kind(TK_NONE);
16  extensibility_kind(DDS::FINAL);
17  is_nested(false);
18 }
19 
21 {}
22 
24 {
25  DynamicTypePtrPairSeen dt_ptr_pair;
26  return test_equality(this, other, dt_ptr_pair);
27 }
28 
30 {
31  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_copy_value is not implemented\n"));
32  return 0;
33 }
34 
36 {
37  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_tao_type is not implemented\n"));
38  return 0;
39 }
40 
42 {
43  // FUTURE
45 }
46 
48 {
49  // FUTURE
50  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::is_consistent is not implemented\n"));
51  return false;
52 }
53 
55 {
56  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_tao_marshal__DDS_TypeDescriptor is not implemented\n"));
57  return false;
58 }
59 
61 {
62  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TypeDescriptorImpl::_tao_unmarshal__DDS_TypeDescriptor is not implemented\n"));
63  return false;
64 }
65 
66 inline bool operator==(const DDS::BoundSeq& lhs, const DDS::BoundSeq& rhs)
67 {
68  if (lhs.length() == rhs.length()) {
69  for (ACE_CDR::ULong i = 0 ; i < lhs.length() ; ++i) {
70  if (lhs[i] != rhs[i]) {
71  return false;
72  }
73  }
74  return true;
75  }
76  return false;
77 }
78 
79 bool test_equality(DDS::TypeDescriptor* lhs, DDS::TypeDescriptor* rhs, DynamicTypePtrPairSeen& dt_ptr_pair)
80 {
81  if (lhs == rhs) {
82  return true;
83  }
84 
85  if (!lhs || !rhs) {
86  return false;
87  }
88 
89  return
90  lhs->kind() == rhs->kind() &&
91  std::strcmp(lhs->name(), rhs->name()) == 0 &&
92  test_equality(lhs->base_type(), rhs->base_type(), dt_ptr_pair) &&
93  test_equality(lhs->discriminator_type(), rhs->discriminator_type(), dt_ptr_pair) &&
94  lhs->bound() == rhs->bound() &&
95  test_equality(lhs->element_type(), rhs->element_type(), dt_ptr_pair) &&
96  test_equality(lhs->key_element_type(), rhs->key_element_type(), dt_ptr_pair) &&
97  lhs->extensibility_kind() == rhs->extensibility_kind() &&
98  lhs->is_nested() == rhs->is_nested();
99 }
100 
101 } // namespace XTypes
102 } // namespace OpenDDS
103 
105 
106 #endif // OPENDDS_SAFETY_PROFILE
#define ACE_ERROR(X)
public ObjectName name
sequence< unsigned long > BoundSeq
CORBA::Boolean _tao_unmarshal__DDS_TypeDescriptor(TAO_InputCDR &, TAO_ChunkInfo &)
bool operator==(const DDS::UnionCaseLabelSeq &lhs, const DDS::UnionCaseLabelSeq &rhs)
public DynamicType base_type
bool test_equality(DDS::DynamicType_ptr lhs, DDS::DynamicType_ptr rhs, DynamicTypePtrPairSeen &dt_ptr_pair)
public DynamicType element_type
CORBA::TypeCode_ptr _tao_type() const
public boolean is_nested
public DynamicType discriminator_type
ACE_CDR::Boolean Boolean
public BoundSeq bound
ACE_UINT32 ULong
public DynamicType key_element_type
public ExtensibilityKind extensibility_kind
CORBA::Boolean _tao_marshal__DDS_TypeDescriptor(TAO_OutputCDR &, TAO_ChunkInfo &) const
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
const ReturnCode_t RETCODE_UNSUPPORTED
const TypeKind TK_NONE
Definition: TypeObject.h:213
DDS::ReturnCode_t copy_from(DDS::TypeDescriptor *)
LM_ERROR
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
public TypeKind kind
CORBA::Boolean equals(DDS::TypeDescriptor *)