Fast DDS  Version 3.0.1
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
26namespace eprosima {
27namespace fastdds {
28namespace dds {
29
30class DynamicType;
31
32class FASTDDS_EXPORTED_API MemberDescriptor
33{
34public:
35
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
88
94
99 virtual void type(
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
171
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
289
295 virtual bool equals(
297
303 virtual bool is_consistent() = 0;
304
305protected:
306
307 MemberDescriptor() = default;
308
310 const MemberDescriptor& type) = default;
311
313 MemberDescriptor&& type) = default;
314
315 virtual ~MemberDescriptor() = default;
316
317private:
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
Definition MemberDescriptor.hpp:33
virtual const UnionCaseLabelSeq & label() const =0
Returns the labels the member belongs to.
virtual void label(UnionCaseLabelSeq &&label)=0
Modifies the labels the member belongs to by move.
virtual MemberId & id()=0
Returns the MemberId of the member.
virtual bool & is_optional()=0
Returns the if the member is optional.
virtual traits< DynamicType >::ref_type & type()=0
Returns a reference to the member's type.
virtual traits< DynamicType >::ref_type type() const =0
Returns a reference to the member's type.
virtual bool is_consistent()=0
Indicates whether the states of all of this descriptor's properties are consistent according with the...
virtual TryConstructKind & try_construct_kind()=0
Returns the TryConstructKind of the member.
MemberDescriptor(const MemberDescriptor &type)=default
virtual bool is_optional() const =0
Returns the if the member is optional.
virtual void name(ObjectName &&name)=0
Modifies the underlying member's name by move.
virtual bool is_key() const =0
Returns the if the member is key.
typename traits< MemberDescriptor >::ref_type _ref_type
Definition MemberDescriptor.hpp:36
virtual uint32_t & index()=0
Returns the order of definition of the member.
virtual ObjectName & name()=0
Returns the name of this member.
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....
virtual MemberId id() const =0
Returns the MemberId of the member.
virtual uint32_t index() const =0
Returns the order of definition of the member.
virtual void try_construct_kind(TryConstructKind try_construct_kind)=0
Modifies the TryConstructKind of the member.
virtual void is_shared(bool is_shared)=0
Modifies if the member is shared.
virtual void name(const ObjectName &name)=0
Modifies the underlying member's name by copy.
virtual void default_value(const std::string &default_value)=0
Modifies the underlying default value by copy.
MemberDescriptor(MemberDescriptor &&type)=default
virtual std::string & default_value()=0
Returns the default value.
virtual const ObjectName & name() const =0
Returns the name of this member.
virtual TryConstructKind try_construct_kind() const =0
Returns the TryConstructKind of the member.
virtual bool & is_must_understand()=0
Returns the if the member is must_understand.
virtual bool is_must_understand() const =0
Returns the if the member is must_understand.
virtual void label(const UnionCaseLabelSeq &label)=0
Modifies the labels the member belongs to by copy.
virtual void is_optional(bool is_optional)=0
Modifies if the member is optional.
virtual bool & is_default_label()=0
Returns the if the member is default_label.
virtual const std::string & default_value() const =0
Returns the default value.
virtual bool & is_shared()=0
Returns the if the member is shared.
virtual bool is_default_label() const =0
Returns the if the member is default_label.
virtual bool & is_key()=0
Returns the if the member is key.
virtual void is_key(bool is_key)=0
Modifies if the member is key.
virtual UnionCaseLabelSeq & label()=0
Returns the labels the member belongs to.
virtual void is_default_label(bool is_default_label)=0
Modifies if the member is default_label.
virtual void default_value(std::string &&default_value)=0
Modifies the underlying default value by move.
virtual void id(MemberId id)=0
Modifies the underlying MemberId.
virtual bool is_shared() const =0
Returns the if the member is shared.
virtual bool equals(traits< MemberDescriptor >::ref_type descriptor)=0
Compares according with the [standard] section 7.5.2.7.4.
virtual void type(traits< DynamicType >::ref_type type)=0
Modifies the underlying member's type reference.
virtual void is_must_understand(bool is_must_understand)=0
Modifies if the member is must_understand.
TryConstructKind
This class represents the enumeration TryConstructKind defined by the user in the IDL file.
Definition dynamic_language_binding.hpp:117
Definition DomainParticipant.hpp:45
uint32_t MemberId
Definition dynamic_language_binding.hpp:122
std::vector< int32_t > UnionCaseLabelSeq
Definition dynamic_language_binding.hpp:124
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eprosima::fastcdr::fixed_string< 256 > ObjectName
Definition dynamic_language_binding.hpp:66
eProsima namespace.
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29