| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
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
40 using _ref_type = typename traits<DynamicTypeMember>::ref_type;
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(
67 traits<AnnotationDescriptor>::ref_type& descriptor,
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(
85 traits<VerbatimTextDescriptor>::ref_type& descriptor,
86 uint32_t idx) = 0;
87
93 FASTDDS_EXPORTED_API virtual bool equals(
94 traits<DynamicTypeMember>::ref_type other) = 0;
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
114 traits<DynamicTypeMember>::ref_type _this();
115
116 private:
117
118 DynamicTypeMember(
119 const DynamicTypeMember&) = delete;
120
121 DynamicTypeMember(
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
eprosima::fastdds::dds::DynamicTypeMember::get_verbatim_text_count
virtual FASTDDS_EXPORTED_API uint32_t get_verbatim_text_count()=0
Returns the number of applied verbatim text to the member.
eprosima::fastdds::dds::DynamicTypeMember::~DynamicTypeMember
virtual ~DynamicTypeMember()=default
eprosima::fastdds::dds::DynamicTypeMember::_ref_type
typename traits< DynamicTypeMember >::ref_type _ref_type
Definition DynamicTypeMember.hpp:40
eprosima::fastdds::dds::DynamicTypeMember::_this
traits< DynamicTypeMember >::ref_type _this()
eprosima::fastdds::dds::DynamicTypeMember::DynamicTypeMember
DynamicTypeMember()=default
eprosima::fastdds::dds::DynamicTypeMember::get_id
virtual FASTDDS_EXPORTED_API MemberId get_id()=0
Getter for id property according with the [standard] section 7.5.2.6.4.
eprosima::fastdds::dds::DynamicTypeMember::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::DynamicTypeMember::get_name
virtual FASTDDS_EXPORTED_API ObjectName get_name()=0
Returns the name of this member.
eprosima::fastdds::dds::DynamicTypeMember::get_descriptor
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....
eprosima::fastdds::dds::DynamicTypeMember::get_annotation_count
virtual FASTDDS_EXPORTED_API uint32_t get_annotation_count()=0
Returns the number of applied annotations to the member.
eprosima::fastdds::dds::DynamicTypeMember::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::DynamicTypeMember::equals
virtual FASTDDS_EXPORTED_API bool equals(traits< DynamicTypeMember >::ref_type other)=0
State comparison according with the [standard] sections 7.5.2.6.3.
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
eprosima
eProsima namespace.
eprosima::fastdds::dds::traits::ref_type
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29