Fast DDS  Version 3.1.0
Fast DDS
Loading...
Searching...
No Matches
TypeDescriptor.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__TYPEDESCRIPTOR_HPP
16#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__TYPEDESCRIPTOR_HPP
17
18#include <fastdds/dds/core/ReturnCode.hpp>
19#include <fastdds/dds/xtypes/dynamic_types/Types.hpp>
20#include <fastdds/fastdds_dll.hpp>
21
22namespace eprosima {
23namespace fastdds {
24namespace dds {
25
26class DynamicType;
27
31class FASTDDS_EXPORTED_API TypeDescriptor
32{
33public:
34
36
41 virtual TypeKind kind() const = 0;
42
47 virtual TypeKind& kind() = 0;
48
53 virtual void kind(
54 TypeKind kind) = 0;
55
60 virtual ObjectName& name() = 0;
61
66 virtual const ObjectName& name() const = 0;
67
72 virtual void name(
73 const ObjectName& name) = 0;
74
79 virtual void name(
80 ObjectName&& name) = 0;
81
87
93
98 virtual void base_type(
100
106
112
117 virtual void discriminator_type(
119
124 virtual const BoundSeq& bound() const = 0;
125
130 virtual BoundSeq& bound() = 0;
131
136 virtual void bound(
137 const BoundSeq& bound) = 0;
138
143 virtual void bound(
144 BoundSeq&& bound) = 0;
145
151
157
162 virtual void element_type(
164
170
176
181 virtual void key_element_type(
183
184
190
196
201 virtual void extensibility_kind(
202 ExtensibilityKind extensibility_kind) = 0;
203
208 virtual bool is_nested() const = 0;
209
214 virtual bool& is_nested() = 0;
215
220 virtual void is_nested(
221 bool is_nested) = 0;
222
231 traits<TypeDescriptor>::ref_type descriptor) = 0;
232
238 virtual bool equals(
239 traits<TypeDescriptor>::ref_type descriptor) = 0;
240
246 virtual bool is_consistent() = 0;
247
248protected:
249
250 TypeDescriptor() = default;
251
253 const TypeDescriptor& type) = default;
254
256 TypeDescriptor&& type) = default;
257
258 virtual ~TypeDescriptor() = default;
259
260private:
261
262 TypeDescriptor& operator =(
263 const TypeDescriptor& type) = delete;
264
265 TypeDescriptor& operator =(
266 TypeDescriptor&& type) = delete;
267
268};
269
270} // namespace dds
271} // namespace fastdds
272} // namespace eprosima
273
274#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__TYPEDESCRIPTOR_HPP
TypeDescriptor definition according to [standard] section 7.5.2.4.
Definition TypeDescriptor.hpp:32
virtual void kind(TypeKind kind)=0
Modifies the underlying TypeKind.
virtual traits< DynamicType >::ref_type & discriminator_type()=0
Returns a reference discriminator type.
virtual void bound(const BoundSeq &bound)=0
Modifies the underlying bound by copy.
virtual void base_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying base type reference.
virtual void extensibility_kind(ExtensibilityKind extensibility_kind)=0
Modifies the extensibility kind.
virtual bool is_consistent()=0
Indicates whether the states of all of this descriptor's properties are consistent according with the...
virtual TypeKind & kind()=0
Returns the TypeKind associated.
virtual BoundSeq & bound()=0
Returns the bound.
virtual void key_element_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying key element type reference.
virtual void name(ObjectName &&name)=0
Modifies the underlying type name by move.
virtual traits< DynamicType >::ref_type & element_type()=0
Returns a reference element type.
virtual ExtensibilityKind extensibility_kind() const =0
Returns the extensibility kind.
virtual ObjectName & name()=0
Returns the fully qualified name of this type.
virtual ExtensibilityKind & extensibility_kind()=0
Returns the extensibility kind.
virtual traits< DynamicType >::ref_type discriminator_type() const =0
Returns a reference discriminator type.
virtual traits< DynamicType >::ref_type & key_element_type()=0
Returns a reference key element type.
virtual void bound(BoundSeq &&bound)=0
Modifies the underlying bound by move.
virtual traits< DynamicType >::ref_type element_type() const =0
Returns a reference element type.
virtual bool & is_nested()=0
Returns the is_nested property.
virtual bool equals(traits< TypeDescriptor >::ref_type descriptor)=0
Compares according with the [standard] section 7.5.2.4.6.
virtual void name(const ObjectName &name)=0
Modifies the underlying type name by copy.
virtual void is_nested(bool is_nested)=0
Modifies the is_nested property.
virtual void discriminator_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying discriminator type reference.
virtual const BoundSeq & bound() const =0
Returns the bound.
virtual const ObjectName & name() const =0
Returns the fully qualified name of this type.
virtual bool is_nested() const =0
Returns the is_nested property.
TypeDescriptor(const TypeDescriptor &type)=default
typename traits< TypeDescriptor >::ref_type _ref_type
Definition TypeDescriptor.hpp:35
virtual TypeKind kind() const =0
Returns the TypeKind associated.
virtual traits< DynamicType >::ref_type key_element_type() const =0
Returns a reference key element type.
virtual traits< DynamicType >::ref_type base_type() const =0
Returns a reference to the base type.
virtual ReturnCode_t copy_from(traits< TypeDescriptor >::ref_type descriptor)=0
Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7....
virtual traits< DynamicType >::ref_type & base_type()=0
Returns a reference to the base type.
virtual void element_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying element type reference.
TypeDescriptor(TypeDescriptor &&type)=default
ExtensibilityKind
This class represents the enumeration ExtensibilityKind defined by the user in the IDL file.
Definition dynamic_language_binding.hpp:107
Definition DomainParticipant.hpp:45
std::vector< uint32_t > BoundSeq
Definition dynamic_language_binding.hpp:68
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eprosima::fastcdr::fixed_string< 256 > ObjectName
Definition dynamic_language_binding.hpp:66
uint8_t TypeKind
Definition dynamic_language_binding.hpp:70
eProsima namespace.
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29