| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
DynamicType.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__DYNAMICTYPE_HPP
16#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPE_HPP
17
18#include <memory>
19
20#include <fastdds/dds/core/ReturnCode.hpp>
21#include <fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp>
22#include <fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp>
23#include <fastdds/dds/xtypes/dynamic_types/TypeDescriptor.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
32 class DynamicType : public std::enable_shared_from_this<DynamicType>
33{
34 public:
35
36 using _ref_type = typename traits<DynamicType>::ref_type;
37
45 FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor(
46 traits<TypeDescriptor>::ref_type& descriptor) = 0;
47
52 FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0;
53
58 FASTDDS_EXPORTED_API virtual TypeKind get_kind() = 0;
59
68 FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_name(
69 traits<DynamicTypeMember>::ref_type& member,
70 const ObjectName& name) = 0;
71
78 FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members_by_name(
79 DynamicTypeMembersByName& member) = 0;
80
89 FASTDDS_EXPORTED_API virtual ReturnCode_t get_member(
90 traits<DynamicTypeMember>::ref_type& member,
91 MemberId id) = 0;
92
99 FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members(
100 DynamicTypeMembersById& member) = 0;
101
106 FASTDDS_EXPORTED_API virtual uint32_t get_member_count() = 0;
107
116 FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_index(
117 traits<DynamicTypeMember>::ref_type& member,
118 uint32_t index) = 0;
119
124 FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0;
125
134 FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation(
135 traits<AnnotationDescriptor>::ref_type& descriptor,
136 uint32_t idx) = 0;
137
142 FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0;
143
152 FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text(
153 traits<VerbatimTextDescriptor>::ref_type& descriptor,
154 uint32_t idx) = 0;
155
161 FASTDDS_EXPORTED_API virtual bool equals(
162 traits<DynamicType>::ref_type other) = 0;
163
164 protected:
165
166 DynamicType() = default;
167
168 virtual ~DynamicType() = default;
169
170 traits<DynamicType>::ref_type _this();
171
172 private:
173
174 DynamicType(
175 const DynamicType&) = delete;
176
177 DynamicType(
178 DynamicType&&) = delete;
179
180 DynamicType& operator =(
181 const DynamicType&) = delete;
182
183 DynamicType& operator =(
184 DynamicType&&) = delete;
185};
186
187} // namespace dds
188} // namespace fastdds
189} // namespace eprosima
190
191#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPE_HPP
eprosima::fastdds::dds::DynamicType::get_member
virtual FASTDDS_EXPORTED_API ReturnCode_t get_member(traits< DynamicTypeMember >::ref_type &member, MemberId id)=0
Returns the member that corresponds to the specified MemberId.
eprosima::fastdds::dds::DynamicType::get_verbatim_text_count
virtual FASTDDS_EXPORTED_API uint32_t get_verbatim_text_count()=0
Returns the number of applied verbatim text to the type.
eprosima::fastdds::dds::DynamicType::get_member_by_name
virtual FASTDDS_EXPORTED_API ReturnCode_t get_member_by_name(traits< DynamicTypeMember >::ref_type &member, const ObjectName &name)=0
Returns the member that corresponds to the specified name.
eprosima::fastdds::dds::DynamicType::get_all_members_by_name
virtual FASTDDS_EXPORTED_API ReturnCode_t get_all_members_by_name(DynamicTypeMembersByName &member)=0
Returns all members by ObjectName.
eprosima::fastdds::dds::DynamicType::get_member_by_index
virtual FASTDDS_EXPORTED_API ReturnCode_t get_member_by_index(traits< DynamicTypeMember >::ref_type &member, uint32_t index)=0
This operation returns the member that corresponds to the specified index.
eprosima::fastdds::dds::DynamicType::DynamicType
DynamicType()=default
eprosima::fastdds::dds::DynamicType::get_descriptor
virtual FASTDDS_EXPORTED_API ReturnCode_t get_descriptor(traits< TypeDescriptor >::ref_type &descriptor)=0
Provides a summary of the state of this type overwriting a provided object (see [standard] 7....
eprosima::fastdds::dds::DynamicType::get_kind
virtual FASTDDS_EXPORTED_API TypeKind get_kind()=0
Returns the TypeKind associated.
eprosima::fastdds::dds::DynamicType::get_annotation
virtual FASTDDS_EXPORTED_API ReturnCode_t get_annotation(traits< AnnotationDescriptor >::ref_type &descriptor, uint32_t idx)=0
Returns an applied annotation by index.
eprosima::fastdds::dds::DynamicType::get_all_members
virtual FASTDDS_EXPORTED_API ReturnCode_t get_all_members(DynamicTypeMembersById &member)=0
Returns all members by MemberId.
eprosima::fastdds::dds::DynamicType::_ref_type
typename traits< DynamicType >::ref_type _ref_type
Definition DynamicType.hpp:36
eprosima::fastdds::dds::DynamicType::get_member_count
virtual FASTDDS_EXPORTED_API uint32_t get_member_count()=0
This operation returns the current number of members.
eprosima::fastdds::dds::DynamicType::get_name
virtual FASTDDS_EXPORTED_API ObjectName get_name()=0
Returns the fully qualified name of this type.
eprosima::fastdds::dds::DynamicType::get_annotation_count
virtual FASTDDS_EXPORTED_API uint32_t get_annotation_count()=0
Returns the number of applied annotations to the type.
eprosima::fastdds::dds::DynamicType::~DynamicType
virtual ~DynamicType()=default
eprosima::fastdds::dds::DynamicType::get_verbatim_text
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.
eprosima::fastdds::dds::DynamicType::equals
virtual FASTDDS_EXPORTED_API bool equals(traits< DynamicType >::ref_type other)=0
State comparison according with the [standard] sections 7.5.2.8.4.
eprosima::fastdds::dds::DynamicType::_this
traits< DynamicType >::ref_type _this()
eprosima::fastdds::dds
Definition BuiltinTopicKey.hpp:26
eprosima::fastdds::dds::MemberId
uint32_t MemberId
Definition dynamic_language_binding.hpp:122
eprosima::fastdds::dds::DynamicTypeMembersById
std::map< MemberId, traits< DynamicTypeMember >::ref_type > DynamicTypeMembersById
Definition DynamicTypeMember.hpp:133
eprosima::fastdds::dds::ReturnCode_t
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eprosima::fastdds::dds::ObjectName
eprosima::fastcdr::fixed_string< 256 > ObjectName
Definition dynamic_language_binding.hpp:66
eprosima::fastdds::dds::DynamicTypeMembersByName
std::map< ObjectName, traits< DynamicTypeMember >::ref_type > DynamicTypeMembersByName
Definition DynamicTypeMember.hpp:131
eprosima::fastdds::dds::TypeKind
uint8_t TypeKind
Definition dynamic_language_binding.hpp:70
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::dds::traits::ref_type
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29