Fast DDS  Version 3.6.1.0
Fast DDS
DynamicTypeMember.hpp
1 // Copyright 2023 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 FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPEMEMBER_HPP
16 #define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPEMEMBER_HPP
17 
18 #include <map>
19 #include <memory>
20 
21 #include <fastdds/dds/core/ReturnCode.hpp>
22 #include <fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp>
23 #include <fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp>
24 #include <fastdds/dds/xtypes/dynamic_types/Types.hpp>
25 #include <fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp>
26 #include <fastdds/fastdds_dll.hpp>
27 
28 namespace eprosima {
29 namespace fastdds {
30 namespace dds {
31 
36 class DynamicTypeMember : public std::enable_shared_from_this<DynamicTypeMember>
37 {
38 public:
39 
41 
49  FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor(
50  traits<MemberDescriptor>::ref_type& descriptor) = 0;
51 
56  FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0;
57 
66  FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation(
68  uint32_t idx) = 0;
69 
74  FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0;
75 
84  FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text(
86  uint32_t idx) = 0;
87 
93  FASTDDS_EXPORTED_API virtual bool equals(
95 
100  FASTDDS_EXPORTED_API virtual MemberId get_id() = 0;
101 
106  FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0;
107 
108 protected:
109 
110  DynamicTypeMember() = default;
111 
112  virtual ~DynamicTypeMember() = default;
113 
115 
116 private:
117 
119  const DynamicTypeMember&) = delete;
120 
122  DynamicTypeMember&&) = delete;
123 
124  DynamicTypeMember& operator =(
125  const DynamicTypeMember&) = delete;
126 
127  DynamicTypeMember& operator =(
128  DynamicTypeMember&&) = delete;
129 };
130 
131 typedef std::map<ObjectName, traits<DynamicTypeMember>::ref_type> DynamicTypeMembersByName;
132 
133 typedef std::map<MemberId, traits<DynamicTypeMember>::ref_type> DynamicTypeMembersById;
134 
135 } // namespace dds
136 } // namespace fastdds
137 } // namespace eprosima
138 
139 #endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPEMEMBER_HPP
Represents a "member" of a type.
Definition: DynamicTypeMember.hpp:37
virtual FASTDDS_EXPORTED_API uint32_t get_verbatim_text_count()=0
Returns the number of applied verbatim text to the member.
typename traits< DynamicTypeMember >::ref_type _ref_type
Definition: DynamicTypeMember.hpp:40
virtual FASTDDS_EXPORTED_API MemberId get_id()=0
Getter for id property according with the [standard] section 7.5.2.6.4.
virtual FASTDDS_EXPORTED_API ReturnCode_t get_annotation(traits< AnnotationDescriptor >::ref_type &descriptor, uint32_t idx)=0
Returns an applied annotation by index.
virtual FASTDDS_EXPORTED_API ObjectName get_name()=0
Returns the name of this member.
virtual FASTDDS_EXPORTED_API ReturnCode_t get_descriptor(traits< MemberDescriptor >::ref_type &descriptor)=0
Provides a summary of the state of this type overwriting a provided object (see [standard] 7....
virtual FASTDDS_EXPORTED_API uint32_t get_annotation_count()=0
Returns the number of applied annotations to the member.
virtual FASTDDS_EXPORTED_API ReturnCode_t get_verbatim_text(traits< VerbatimTextDescriptor >::ref_type &descriptor, uint32_t idx)=0
Returns an applied verbatim text by index.
virtual FASTDDS_EXPORTED_API bool equals(traits< DynamicTypeMember >::ref_type other)=0
State comparison according with the [standard] sections 7.5.2.6.3.
traits< DynamicTypeMember >::ref_type _this()
Definition: DomainParticipant.hpp:46
uint32_t MemberId
Definition: dynamic_language_binding.hpp:122
std::map< MemberId, traits< DynamicTypeMember >::ref_type > DynamicTypeMembersById
Definition: DynamicTypeMember.hpp:133
int32_t ReturnCode_t
Definition: DDSReturnCode.hpp:59
eprosima::fastcdr::fixed_string< 256 > ObjectName
Definition: dynamic_language_binding.hpp:66
std::map< ObjectName, traits< DynamicTypeMember >::ref_type > DynamicTypeMembersByName
Definition: DynamicTypeMember.hpp:131
typename ::std::shared_ptr< T > ref_type
Definition: type_traits.hpp:29