OpenDDS  Snapshot(2023/04/28-20:55)
MemberDescriptorImpl.cpp
Go to the documentation of this file.
1 #include <DCPS/DdsDcps_pch.h>
2 
3 #ifndef OPENDDS_SAFETY_PROFILE
4 
5 #include "MemberDescriptorImpl.h"
6 
7 #include "DynamicTypeImpl.h"
8 
10 namespace OpenDDS {
11 namespace XTypes {
12 
14 {
16  index(0);
17  try_construct_kind(DDS::DISCARD);
18  is_key(false);
19  is_optional(false);
20  is_must_understand(false);
21  is_shared(false);
22  is_default_label(false);
23 }
24 
26 {}
27 
29 {
30  DynamicTypePtrPairSeen dt_ptr_pair;
31  return test_equality(this, other, dt_ptr_pair);
32 }
33 
35 {
36  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_copy_value is not implemented\n"));
37  return 0;
38 }
39 
41 {
42  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_tao_type is not implemented\n"));
43  return 0;
44 }
45 
47 {
48  // FUTURE
50 }
51 
53 {
54  // FUTURE
55  ACE_ERROR((LM_ERROR, "(%P|%t) ERRROR: MemberDescriptorImpl::is_consistent is not implemented\n"));
56  return false;
57 }
58 
60 {
61  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_tao_marshal__DDS_MemberDescriptor is not implemented\n"));
62  return false;
63 }
64 
66 {
67  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_tao_unmarshal__DDS_MemberDescriptor is not implemented\n"));
68  return false;
69 }
70 
71 inline bool operator==(const DDS::UnionCaseLabelSeq& lhs, const DDS::UnionCaseLabelSeq& rhs)
72 {
73  if (lhs.length() == rhs.length()) {
74  for (ACE_CDR::ULong i = 0; i < lhs.length(); ++i) {
75  if (lhs[i] != rhs[i]) {
76  return false;
77  }
78  }
79  return true;
80  }
81  return false;
82 }
83 
84 bool test_equality(DDS::MemberDescriptor* lhs, DDS::MemberDescriptor* rhs, DynamicTypePtrPairSeen& dt_ptr_pair)
85 {
86  const DDS::DynamicType_ptr lhs_type = lhs->type();
87  const DDS::DynamicType_ptr rhs_type = rhs->type();
88  return
89  std::strcmp(lhs->name(), rhs->name()) == 0 &&
90  lhs->id() == rhs->id() &&
91  test_equality(lhs_type, rhs_type, dt_ptr_pair) &&
92  lhs->default_value() == rhs->default_value() &&
93  lhs->index() == rhs->index() &&
94  lhs->label() == rhs->label() &&
95  lhs->try_construct_kind() == rhs->try_construct_kind() &&
96  lhs->is_key() == rhs->is_key() &&
97  lhs->is_optional() == rhs->is_optional() &&
98  lhs->is_must_understand() == rhs->is_must_understand() &&
99  lhs->is_shared() == rhs->is_shared() &&
100  lhs->is_default_label() == rhs->is_default_label();
101 }
102 
103 } // namespace XTypes
104 } // namespace OpenDDS
105 
107 
108 #endif // OPENDDS_SAFETY_PROFILE
bool is_key(DDS::DynamicType_ptr type, const char *field)
#define ACE_ERROR(X)
bool operator==(const DDS::UnionCaseLabelSeq &lhs, const DDS::UnionCaseLabelSeq &rhs)
bool equals(DDS::MemberDescriptor *other)
::CORBA::Boolean _tao_marshal__DDS_MemberDescriptor(TAO_OutputCDR &, TAO_ChunkInfo &) const
bool test_equality(DDS::DynamicType_ptr lhs, DDS::DynamicType_ptr rhs, DynamicTypePtrPairSeen &dt_ptr_pair)
public boolean is_optional
DDS::ReturnCode_t copy_from(DDS::MemberDescriptor *)
public unsigned long index
public UnionCaseLabelSeq label
ACE_CDR::Boolean Boolean
public TryConstructKind try_construct_kind
public string default_value
const ACE_CDR::ULong MEMBER_ID_INVALID
Definition: TypeObject.h:911
ACE_UINT32 ULong
public boolean is_shared
public DynamicType type
::CORBA::Boolean _tao_unmarshal__DDS_MemberDescriptor(TAO_InputCDR &, TAO_ChunkInfo &)
public boolean is_default_label
public boolean is_must_understand
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
const ReturnCode_t RETCODE_UNSUPPORTED
public ObjectName name
LM_ERROR
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
ACE_CDR::ULong length() const
Definition: TypeObject.h:167