Fast RTPS  Version 2.5.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:
34 
35  uint32_t get_index() const;
36 
37  void set_index(uint32_t index);
38 
39  void set_parent(DynamicType* pType);
40 
41  friend class DynamicTypeBuilder;
42  friend class DynamicType;
43  friend class DynamicData;
44 
45 public:
47 
49 
51  const MemberDescriptor* descriptor,
52  MemberId id);
53 
55 
57 
59  const std::string& annotation_name,
60  const std::string& key,
61  const std::string& value);
62 
63  bool equals(const DynamicTypeMember*) const;
64 
66  AnnotationDescriptor& descriptor,
67  uint32_t idx);
68 
70 
71  bool key_annotation() const;
72 
73  std::vector<uint64_t> get_union_labels() const;
74 
76 
77  MemberId get_id() const;
78 
79  std::string get_name() const;
80 
81  bool is_default_union_value() const;
82 
84  {
85  return &descriptor_;
86  }
87 };
88 
89 } // namespace types
90 } // namespace fastrtps
91 } // namespace eprosima
92 
93 #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:32
ReturnCode_t get_annotation(AnnotationDescriptor &descriptor, uint32_t idx)
std::vector< uint64_t > get_union_labels() const
ReturnCode_t apply_annotation(AnnotationDescriptor &descriptor)
const MemberDescriptor * get_descriptor() const
Definition: DynamicTypeMember.h:83
DynamicType * parent_
Definition: DynamicTypeMember.h:31
MemberId id_
Definition: DynamicTypeMember.h:33
DynamicTypeMember(const DynamicTypeMember *other)
ReturnCode_t apply_annotation(const std::string &annotation_name, const std::string &key, const std::string &value)
DynamicTypeMember(const MemberDescriptor *descriptor, MemberId id)
bool equals(const DynamicTypeMember *) const
ReturnCode_t get_descriptor(MemberDescriptor *descriptor) 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