Fast DDS  Version 3.6.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
128
137
145 virtual void literal_type(
147
152 virtual const BoundSeq& bound() const = 0;
153
158 virtual BoundSeq& bound() = 0;
159
164 virtual void bound(
165 const BoundSeq& bound) = 0;
166
171 virtual void bound(
172 BoundSeq&& bound) = 0;
173
179
185
190 virtual void element_type(
192
198
204
209 virtual void key_element_type(
211
212
218
224
229 virtual void extensibility_kind(
231
236 virtual bool is_nested() const = 0;
237
242 virtual bool& is_nested() = 0;
243
248 virtual void is_nested(
249 bool is_nested) = 0;
250
259 traits<TypeDescriptor>::ref_type descriptor) = 0;
260
266 virtual bool equals(
267 traits<TypeDescriptor>::ref_type descriptor) = 0;
268
274 virtual bool is_consistent() = 0;
275
276protected:
277
278 TypeDescriptor() = default;
279
281 const TypeDescriptor& type) = default;
282
284 TypeDescriptor&& type) = default;
285
286 virtual ~TypeDescriptor() = default;
287
288private:
289
290 TypeDescriptor& operator =(
291 const TypeDescriptor& type) = delete;
292
293 TypeDescriptor& operator =(
294 TypeDescriptor&& type) = delete;
295
296};
297
298} // namespace dds
299} // namespace fastdds
300} // namespace eprosima
301
302#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__TYPEDESCRIPTOR_HPP
Definition DynamicType.hpp:33
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 & literal_type()=0
Returns a reference to the literal type.
virtual traits< DynamicType >::ref_type literal_type() const =0
Returns a reference to the literal 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 void literal_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying literal type reference.
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 BuiltinTopicKey.hpp:26
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