OpenDDS  Snapshot(2023/04/28-20:55)
MemberDescriptorImpl.h
Go to the documentation of this file.
1 #ifndef OPENDDS_DCPS_XTYPES_MEMBER_DESCRIPTOR_IMPL_H
2 #define OPENDDS_DCPS_XTYPES_MEMBER_DESCRIPTOR_IMPL_H
3 
4 #ifndef OPENDDS_SAFETY_PROFILE
5 
6 #include "TypeObject.h"
7 
8 #include <dds/DCPS/RcObject.h>
9 #include <dds/DCPS/RcHandle_T.h>
10 #include <dds/DdsDynamicDataC.h>
11 
13 namespace OpenDDS {
14 namespace XTypes {
15 
17  : public virtual OBV_DDS::MemberDescriptor
18  , public virtual CORBA::DefaultValueRefCountBase
19 {
20 public:
23  MemberDescriptorImpl(const char* a_name, bool a_is_key)
24  {
25  name(a_name);
26  id(0);
27  index(0);
28  try_construct_kind(DDS::USE_DEFAULT);
29  is_key(a_is_key);
30  is_optional(false);
31  is_must_understand(false);
32  is_shared(false);
33  is_default_label(false);
34  }
35 
36  bool equals(DDS::MemberDescriptor* other);
38  ::CORBA::Boolean is_consistent();
39 
40  CORBA::ValueBase* _copy_value();
41  CORBA::TypeCode_ptr _tao_type() const;
42 
43 private:
44  ::CORBA::Boolean _tao_marshal__DDS_MemberDescriptor(TAO_OutputCDR &, TAO_ChunkInfo &) const;
45  ::CORBA::Boolean _tao_unmarshal__DDS_MemberDescriptor(TAO_InputCDR &, TAO_ChunkInfo &);
46 };
47 
48 typedef std::pair<const DDS::DynamicType*, const DDS::DynamicType*> DynamicTypePtrPair;
49 typedef OPENDDS_SET(DynamicTypePtrPair) DynamicTypePtrPairSeen;
50 
51 bool test_equality(DDS::MemberDescriptor* lhs, DDS::MemberDescriptor* rhs, DynamicTypePtrPairSeen& dt_ptr_pair);
52 
53 } // namespace XTypes
54 } // namespace OpenDDS
55 
57 
58 #else
59 
60 namespace DDS {
61 
62 class MemberDescriptor {
63 public:
64  // a_name should be shallow-copyable, e.g., a string literal.
65  MemberDescriptor(const char* a_name, bool a_is_key)
66  : name_(a_name)
67  , is_key_(a_is_key)
68  { }
69 
70  const char* name() const { return name_; }
71  bool is_key() const { return is_key_; }
72 
73 private:
74  const char* name_;
75  bool is_key_;
76 };
77 
78 }
79 
81 
82 namespace OpenDDS {
83 namespace XTypes {
84 
86 
87 } // namespace XTypes
88 } // namespace OpenDDS
89 
91 
92 #endif // OPENDDS_SAFETY_PROFILE
93 
94 #endif /* OPENDDS_DCPS_XTYPES_MEMBER_DESCRIPTOR_IMPL_H */
bool is_key(DDS::DynamicType_ptr type, const char *field)
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
MemberDescriptorImpl(const char *a_name, bool a_is_key)
bool test_equality(DDS::DynamicType_ptr lhs, DDS::DynamicType_ptr rhs, DynamicTypePtrPairSeen &dt_ptr_pair)
ACE_CDR::Boolean Boolean
The End User API.
typedef OPENDDS_SET(DynamicTypePtrPair) DynamicTypePtrPairSeen
const char *const name
Definition: debug.cpp:60
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
std::pair< const DDS::DynamicType *, const DDS::DynamicType * > DynamicTypePtrPair
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28