| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
MemberDescriptor.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__MEMBERDESCRIPTOR_HPP
16#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__MEMBERDESCRIPTOR_HPP
17
18#include <cstdint>
19#include <string>
20#include <vector>
21
22#include <fastdds/dds/core/ReturnCode.hpp>
23#include <fastdds/dds/xtypes/dynamic_types/Types.hpp>
24#include <fastdds/fastdds_dll.hpp>
25
26 namespace eprosima {
27 namespace fastdds {
28 namespace dds {
29
30 class DynamicType;
31
32 class FASTDDS_EXPORTED_API MemberDescriptor
33{
34 public:
35
36 using _ref_type = typename traits<MemberDescriptor>::ref_type;
37
42 virtual ObjectName& name() = 0;
43
48 virtual const ObjectName& name() const = 0;
49
54 virtual void name(
55 const ObjectName& name) = 0;
56
61 virtual void name(
62 ObjectName&& name) = 0;
63
68 virtual MemberId id() const = 0;
69
74 virtual MemberId& id() = 0;
75
80 virtual void id(
81 MemberId id) = 0;
82
87 virtual traits<DynamicType>::ref_type type() const = 0;
88
93 virtual traits<DynamicType>::ref_type& type() = 0;
94
99 virtual void type(
100 traits<DynamicType>::ref_type type) = 0;
101
106 virtual std::string& default_value() = 0;
107
112 virtual const std::string& default_value() const = 0;
113
118 virtual void default_value(
119 const std::string& default_value) = 0;
120
125 virtual void default_value(
126 std::string&& default_value) = 0;
127
132 virtual uint32_t& index() = 0;
133
138 virtual uint32_t index() const = 0;
139
144 virtual const UnionCaseLabelSeq& label() const = 0;
145
150 virtual UnionCaseLabelSeq& label() = 0;
151
156 virtual void label(
157 const UnionCaseLabelSeq& label) = 0;
158
163 virtual void label(
164 UnionCaseLabelSeq&& label) = 0;
165
170 virtual TryConstructKind try_construct_kind() const = 0;
171
176 virtual TryConstructKind& try_construct_kind() = 0;
177
182 virtual void try_construct_kind(
183 TryConstructKind try_construct_kind) = 0;
184
189 virtual bool is_key() const = 0;
190
195 virtual bool& is_key() = 0;
196
201 virtual void is_key(
202 bool is_key) = 0;
203
208 virtual bool is_optional() const = 0;
209
214 virtual bool& is_optional() = 0;
215
220 virtual void is_optional(
221 bool is_optional) = 0;
222
227 virtual bool is_must_understand() const = 0;
228
233 virtual bool& is_must_understand() = 0;
234
239 virtual void is_must_understand(
240 bool is_must_understand) = 0;
241
246 virtual bool is_shared() const = 0;
247
252 virtual bool& is_shared() = 0;
253
258 virtual void is_shared(
259 bool is_shared) = 0;
260
265 virtual bool is_default_label() const = 0;
266
271 virtual bool& is_default_label() = 0;
272
277 virtual void is_default_label(
278 bool is_default_label) = 0;
279
287 virtual ReturnCode_t copy_from(
288 traits<MemberDescriptor>::ref_type descriptor) = 0;
289
295 virtual bool equals(
296 traits<MemberDescriptor>::ref_type descriptor) = 0;
297
303 virtual bool is_consistent() = 0;
304
305 protected:
306
307 MemberDescriptor() = default;
308
309 MemberDescriptor(
310 const MemberDescriptor& type) = default;
311
312 MemberDescriptor(
313 MemberDescriptor&& type) = default;
314
315 virtual ~MemberDescriptor() = default;
316
317 private:
318
319 MemberDescriptor& operator =(
320 const MemberDescriptor& type) = delete;
321
322 MemberDescriptor& operator =(
323 MemberDescriptor&& type) = delete;
324
325};
326
327} // namespace dds
328} // namespace fastdds
329} // namespace eprosima
330
331#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__MEMBERDESCRIPTOR_HPP
eprosima::fastdds::dds::DynamicType
Definition DynamicType.hpp:33
eprosima::fastdds::dds::MemberDescriptor::label
virtual const UnionCaseLabelSeq & label() const =0
Returns the labels the member belongs to.
eprosima::fastdds::dds::MemberDescriptor::label
virtual void label(UnionCaseLabelSeq &&label)=0
Modifies the labels the member belongs to by move.
eprosima::fastdds::dds::MemberDescriptor::id
virtual MemberId & id()=0
Returns the MemberId of the member.
eprosima::fastdds::dds::MemberDescriptor::is_optional
virtual bool & is_optional()=0
Returns the if the member is optional.
eprosima::fastdds::dds::MemberDescriptor::type
virtual traits< DynamicType >::ref_type & type()=0
Returns a reference to the member's type.
eprosima::fastdds::dds::MemberDescriptor::type
virtual traits< DynamicType >::ref_type type() const =0
Returns a reference to the member's type.
eprosima::fastdds::dds::MemberDescriptor::is_consistent
virtual bool is_consistent()=0
Indicates whether the states of all of this descriptor's properties are consistent according with the...
eprosima::fastdds::dds::MemberDescriptor::try_construct_kind
virtual TryConstructKind & try_construct_kind()=0
Returns the TryConstructKind of the member.
eprosima::fastdds::dds::MemberDescriptor::MemberDescriptor
MemberDescriptor(const MemberDescriptor &type)=default
eprosima::fastdds::dds::MemberDescriptor::~MemberDescriptor
virtual ~MemberDescriptor()=default
eprosima::fastdds::dds::MemberDescriptor::MemberDescriptor
MemberDescriptor()=default
eprosima::fastdds::dds::MemberDescriptor::is_optional
virtual bool is_optional() const =0
Returns the if the member is optional.
eprosima::fastdds::dds::MemberDescriptor::name
virtual void name(ObjectName &&name)=0
Modifies the underlying member's name by move.
eprosima::fastdds::dds::MemberDescriptor::is_key
virtual bool is_key() const =0
Returns the if the member is key.
eprosima::fastdds::dds::MemberDescriptor::_ref_type
typename traits< MemberDescriptor >::ref_type _ref_type
Definition MemberDescriptor.hpp:36
eprosima::fastdds::dds::MemberDescriptor::index
virtual uint32_t & index()=0
Returns the order of definition of the member.
eprosima::fastdds::dds::MemberDescriptor::name
virtual ObjectName & name()=0
Returns the name of this member.
eprosima::fastdds::dds::MemberDescriptor::copy_from
virtual ReturnCode_t copy_from(traits< MemberDescriptor >::ref_type descriptor)=0
Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7....
eprosima::fastdds::dds::MemberDescriptor::id
virtual MemberId id() const =0
Returns the MemberId of the member.
eprosima::fastdds::dds::MemberDescriptor::index
virtual uint32_t index() const =0
Returns the order of definition of the member.
eprosima::fastdds::dds::MemberDescriptor::try_construct_kind
virtual void try_construct_kind(TryConstructKind try_construct_kind)=0
Modifies the TryConstructKind of the member.
eprosima::fastdds::dds::MemberDescriptor::is_shared
virtual void is_shared(bool is_shared)=0
Modifies if the member is shared.
eprosima::fastdds::dds::MemberDescriptor::name
virtual void name(const ObjectName &name)=0
Modifies the underlying member's name by copy.
eprosima::fastdds::dds::MemberDescriptor::default_value
virtual void default_value(const std::string &default_value)=0
Modifies the underlying default value by copy.
eprosima::fastdds::dds::MemberDescriptor::MemberDescriptor
MemberDescriptor(MemberDescriptor &&type)=default
eprosima::fastdds::dds::MemberDescriptor::default_value
virtual std::string & default_value()=0
Returns the default value.
eprosima::fastdds::dds::MemberDescriptor::name
virtual const ObjectName & name() const =0
Returns the name of this member.
eprosima::fastdds::dds::MemberDescriptor::try_construct_kind
virtual TryConstructKind try_construct_kind() const =0
Returns the TryConstructKind of the member.
eprosima::fastdds::dds::MemberDescriptor::is_must_understand
virtual bool & is_must_understand()=0
Returns the if the member is must_understand.
eprosima::fastdds::dds::MemberDescriptor::is_must_understand
virtual bool is_must_understand() const =0
Returns the if the member is must_understand.
eprosima::fastdds::dds::MemberDescriptor::label
virtual void label(const UnionCaseLabelSeq &label)=0
Modifies the labels the member belongs to by copy.
eprosima::fastdds::dds::MemberDescriptor::is_optional
virtual void is_optional(bool is_optional)=0
Modifies if the member is optional.
eprosima::fastdds::dds::MemberDescriptor::is_default_label
virtual bool & is_default_label()=0
Returns the if the member is default_label.
eprosima::fastdds::dds::MemberDescriptor::default_value
virtual const std::string & default_value() const =0
Returns the default value.
eprosima::fastdds::dds::MemberDescriptor::is_shared
virtual bool & is_shared()=0
Returns the if the member is shared.
eprosima::fastdds::dds::MemberDescriptor::is_default_label
virtual bool is_default_label() const =0
Returns the if the member is default_label.
eprosima::fastdds::dds::MemberDescriptor::is_key
virtual bool & is_key()=0
Returns the if the member is key.
eprosima::fastdds::dds::MemberDescriptor::is_key
virtual void is_key(bool is_key)=0
Modifies if the member is key.
eprosima::fastdds::dds::MemberDescriptor::label
virtual UnionCaseLabelSeq & label()=0
Returns the labels the member belongs to.
eprosima::fastdds::dds::MemberDescriptor::is_default_label
virtual void is_default_label(bool is_default_label)=0
Modifies if the member is default_label.
eprosima::fastdds::dds::MemberDescriptor::default_value
virtual void default_value(std::string &&default_value)=0
Modifies the underlying default value by move.
eprosima::fastdds::dds::MemberDescriptor::id
virtual void id(MemberId id)=0
Modifies the underlying MemberId.
eprosima::fastdds::dds::MemberDescriptor::is_shared
virtual bool is_shared() const =0
Returns the if the member is shared.
eprosima::fastdds::dds::MemberDescriptor::equals
virtual bool equals(traits< MemberDescriptor >::ref_type descriptor)=0
Compares according with the [standard] section 7.5.2.7.4.
eprosima::fastdds::dds::MemberDescriptor::type
virtual void type(traits< DynamicType >::ref_type type)=0
Modifies the underlying member's type reference.
eprosima::fastdds::dds::MemberDescriptor::is_must_understand
virtual void is_must_understand(bool is_must_understand)=0
Modifies if the member is must_understand.
eprosima::fastdds::dds::TryConstructKind
TryConstructKind
This class represents the enumeration TryConstructKind defined by the user in the IDL file.
Definition dynamic_language_binding.hpp:117
eprosima::fastdds::dds
Definition BuiltinTopicKey.hpp:26
eprosima::fastdds::dds::MemberId
uint32_t MemberId
Definition dynamic_language_binding.hpp:122
eprosima::fastdds::dds::UnionCaseLabelSeq
std::vector< int32_t > UnionCaseLabelSeq
Definition dynamic_language_binding.hpp:124
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
eprosima
eProsima namespace.
eprosima::fastdds::dds::traits::ref_type
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29