OpenDDS  Snapshot(2022/12/09-19:23)
XTypes/Utils.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.opendds.org/license.html
4  */
5 
6 #ifndef OPENDDS_DCPS_XTYPES_UTILS_H
7 #define OPENDDS_DCPS_XTYPES_UTILS_H
8 
9 #ifndef OPENDDS_SAFETY_PROFILE
10 # include <dds/DCPS/Serializer.h>
11 
12 # include <dds/DdsDynamicDataC.h>
13 
15 namespace OpenDDS {
16 namespace XTypes {
17 
19  DDS::DynamicType_ptr type, DCPS::Extensibility& ext);
21  DDS::DynamicType_ptr type, DCPS::Extensibility& ext);
23 
24 /*
25  * Provides access to a specific member using MemberIds that may be nested
26  * inside a DynamicType or DynamicData.
27  */
29 public:
30  typedef OPENDDS_VECTOR(DDS::MemberId) MemberIdVec;
31  MemberIdVec ids;
32 
34  {
35  }
36 
38  : ids(other.ids)
39  {
40  ids.push_back(id);
41  }
42 
44  {
45  ids.push_back(id);
46  return *this;
47  }
48 
49  size_t level() const { return ids.size(); }
50 
51  DDS::ReturnCode_t get_member_from_type(
52  DDS::DynamicType_ptr type, DDS::DynamicTypeMember_var& member);
53 
54  /**
55  * DynamicData itself holds the access methods to its members, so in order to
56  * access them, we have to give both the containing Dynamic Data and the
57  * member ID.
58  */
59  DDS::ReturnCode_t get_member_from_data(
60  DDS::DynamicData_ptr data, DDS::DynamicData_var& container, DDS::MemberId& member_id);
61 };
62 typedef OPENDDS_VECTOR(MemberPath) MemberPathVec;
63 
64 OpenDDS_Dcps_Export DDS::ReturnCode_t get_keys(DDS::DynamicType_ptr type, MemberPathVec& paths);
65 OpenDDS_Dcps_Export DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t& count);
66 
67 } // namespace XTypes
68 } // namespace OpenDDS
70 
71 #endif // OPENDDS_SAFETY_PROFILE
72 #endif
DDS::ReturnCode_t max_extensibility(DDS::DynamicType_ptr type, DCPS::Extensibility &ext)
DDS::ReturnCode_t get_keys(DDS::DynamicType_ptr type, MemberPathVec &paths)
DDS::ReturnCode_t extensibility(DDS::DynamicType_ptr type, DCPS::Extensibility &ext)
ACE_CDR::ULong MemberId
Definition: TypeObject.h:829
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
MemberPath & id(DDS::MemberId id)
Definition: XTypes/Utils.h:43
MemberPath(const MemberPath &other, DDS::MemberId id)
Definition: XTypes/Utils.h:37
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
DCPS::Extensibility dds_to_opendds_ext(DDS::ExtensibilityKind ext)
DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t &count)
typedef OPENDDS_VECTOR(MemberPair) MatchedSet
ExtensibilityKind
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28