OpenDDS  Snapshot(2023/01/18-09:55)
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 enum Filter {
69 };
70 
72  DDS::DynamicType_ptr type, MemberPathVec& paths, Filter filter);
73 OpenDDS_Dcps_Export DDS::ReturnCode_t get_keys(DDS::DynamicType_ptr type, MemberPathVec& paths);
74 OpenDDS_Dcps_Export DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t& count);
75 
77  bool& result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b, Filter filter);
79  bool& result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b);
80 
83 
85  CORBA::UInt64& value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind);
87  CORBA::Int64& value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind);
88 
90  DDS::DynamicType_ptr type, CORBA::UInt64& bound_max, DDS::TypeKind& bound_kind);
92  CORBA::UInt64& value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id);
93 
94 OpenDDS_Dcps_Export DDS::ReturnCode_t enum_bound(DDS::DynamicType_ptr type, DDS::TypeKind& bound_kind);
96  CORBA::Int32& value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id);
97 
98 } // namespace XTypes
99 } // namespace OpenDDS
101 
102 #endif // OPENDDS_SAFETY_PROFILE
103 #endif
MemberPath(const MemberPath &other, DDS::MemberId id)
Definition: XTypes/Utils.h:37
DDS::ReturnCode_t get_values(DDS::DynamicType_ptr type, MemberPathVec &paths, Filter filter)
DDS::ReturnCode_t key_less_than(bool &result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b)
DDS::ReturnCode_t less_than(bool &result, DDS::DynamicData_ptr a, DDS::DynamicData_ptr b, Filter filter)
ACE_CDR::Int32 Int32
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
MemberPath & id(DDS::MemberId id)
Definition: XTypes/Utils.h:43
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
DDS::ReturnCode_t enum_bound(DDS::DynamicType_ptr type, DDS::TypeKind &bound_kind)
typedef OPENDDS_VECTOR(MemberPair) MatchedSet
DDS::ReturnCode_t get_bitmask_value(CORBA::UInt64 &value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id)
ACE_CDR::UInt64 UInt64
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
bool is_int(DDS::TypeKind tk)
DCPS::Extensibility dds_to_opendds_ext(DDS::ExtensibilityKind ext)
ACE_CDR::ULong MemberId
Definition: TypeObject.h:829
DDS::ReturnCode_t get_keys(DDS::DynamicType_ptr type, MemberPathVec &paths)
ACE_CDR::Int64 Int64
const LogLevel::Value value
Definition: debug.cpp:61
DDS::ReturnCode_t get_uint_value(CORBA::UInt64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
DDS::ReturnCode_t get_int_value(CORBA::Int64 &value, DDS::DynamicData_ptr src, DDS::MemberId id, DDS::TypeKind kind)
DDS::ReturnCode_t get_enum_value(CORBA::Int32 &value, DDS::DynamicType_ptr type, DDS::DynamicData_ptr src, DDS::MemberId id)
DDS::ReturnCode_t max_extensibility(DDS::DynamicType_ptr type, DCPS::Extensibility &ext)
DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t &count)
DDS::ReturnCode_t bitmask_bound(DDS::DynamicType_ptr type, CORBA::UInt64 &bound_max, DDS::TypeKind &bound_kind)
bool is_uint(DDS::TypeKind tk)
ACE_CDR::Octet TypeKind
Definition: TypeObject.h:139
extensibility(MUTABLE) struct TypeLookup_getTypes_In
Definition: TypeLookup.idl:29
ExtensibilityKind