Fast RTPS  Version 2.8.1
Fast RTPS
DynamicTypeMember.h
1 // Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef TYPES_DYNAMIC_TYPE_MEMBER_H
16 #define TYPES_DYNAMIC_TYPE_MEMBER_H
17 
18 #include <fastrtps/types/TypesBase.h>
19 #include <fastrtps/types/MemberDescriptor.h>
20 
21 namespace eprosima {
22 namespace fastrtps {
23 namespace types {
24 
25 class AnnotationDescriptor;
26 class DynamicType;
27 
29 {
30 protected:
31 
35 
36  uint32_t get_index() const;
37 
38  void set_index(
39  uint32_t index);
40 
41  void set_parent(
42  DynamicType* pType);
43 
44  friend class DynamicTypeBuilder;
45  friend class DynamicType;
46  friend class DynamicData;
47 
48 public:
49 
50  RTPS_DllAPI DynamicTypeMember();
51 
52  RTPS_DllAPI DynamicTypeMember(
53  const DynamicTypeMember* other);
54 
55  RTPS_DllAPI DynamicTypeMember(
56  const MemberDescriptor* descriptor,
57  MemberId id);
58 
60 
62  AnnotationDescriptor& descriptor);
63 
65  const std::string& annotation_name,
66  const std::string& key,
67  const std::string& value);
68 
69  RTPS_DllAPI bool equals(
70  const DynamicTypeMember*) const;
71 
73  AnnotationDescriptor& descriptor,
74  uint32_t idx);
75 
76  RTPS_DllAPI uint32_t get_annotation_count();
77 
78  RTPS_DllAPI bool key_annotation() const;
79 
80  RTPS_DllAPI std::vector<uint64_t> get_union_labels() const;
81 
83  MemberDescriptor* descriptor) const;
84 
85  RTPS_DllAPI MemberId get_id() const;
86 
87  RTPS_DllAPI std::string get_name() const;
88 
89  RTPS_DllAPI bool is_default_union_value() const;
90 
91  RTPS_DllAPI const MemberDescriptor* get_descriptor() const
92  {
93  return &descriptor_;
94  }
95 
96 };
97 
98 } // namespace types
99 } // namespace fastrtps
100 } // namespace eprosima
101 
102 #endif // TYPES_DYNAMIC_TYPE_MEMBER_H
Definition: AnnotationDescriptor.h:29
Definition: DynamicData.h:44
Definition: DynamicTypeBuilder.h:32
Definition: DynamicType.h:38
Definition: DynamicTypeMember.h:29
MemberDescriptor descriptor_
Definition: DynamicTypeMember.h:33
RTPS_DllAPI DynamicTypeMember(const DynamicTypeMember *other)
RTPS_DllAPI const MemberDescriptor * get_descriptor() const
Definition: DynamicTypeMember.h:91
RTPS_DllAPI ReturnCode_t apply_annotation(AnnotationDescriptor &descriptor)
RTPS_DllAPI bool equals(const DynamicTypeMember *) const
RTPS_DllAPI std::string get_name() const
RTPS_DllAPI ReturnCode_t get_annotation(AnnotationDescriptor &descriptor, uint32_t idx)
RTPS_DllAPI ReturnCode_t get_descriptor(MemberDescriptor *descriptor) const
DynamicType * parent_
Definition: DynamicTypeMember.h:32
MemberId id_
Definition: DynamicTypeMember.h:34
RTPS_DllAPI bool is_default_union_value() const
RTPS_DllAPI MemberId get_id() const
RTPS_DllAPI DynamicTypeMember(const MemberDescriptor *descriptor, MemberId id)
RTPS_DllAPI ReturnCode_t apply_annotation(const std::string &annotation_name, const std::string &key, const std::string &value)
RTPS_DllAPI std::vector< uint64_t > get_union_labels() const
Definition: MemberDescriptor.h:29
This class represents the enumeration ReturnCode_t.
Definition: TypesBase.h:189
uint32_t MemberId
Definition: TypesBase.h:272
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23