| Fast DDS Version 3.3.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
22 namespace eprosima {
23 namespace fastdds {
24 namespace dds {
25
26 class DynamicType;
27
31 class FASTDDS_EXPORTED_API TypeDescriptor
32{
33 public:
34
35 using _ref_type = typename traits<TypeDescriptor>::ref_type;
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
86 virtual traits<DynamicType>::ref_type base_type() const = 0;
87
92 virtual traits<DynamicType>::ref_type& base_type() = 0;
93
98 virtual void base_type(
99 traits<DynamicType>::ref_type type) = 0;
100
105 virtual traits<DynamicType>::ref_type discriminator_type() const = 0;
106
111 virtual traits<DynamicType>::ref_type& discriminator_type() = 0;
112
117 virtual void discriminator_type(
118 traits<DynamicType>::ref_type type) = 0;
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
150 virtual traits<DynamicType>::ref_type element_type() const = 0;
151
156 virtual traits<DynamicType>::ref_type& element_type() = 0;
157
162 virtual void element_type(
163 traits<DynamicType>::ref_type type) = 0;
164
169 virtual traits<DynamicType>::ref_type key_element_type() const = 0;
170
175 virtual traits<DynamicType>::ref_type& key_element_type() = 0;
176
181 virtual void key_element_type(
182 traits<DynamicType>::ref_type type) = 0;
183
184
189 virtual ExtensibilityKind extensibility_kind() const = 0;
190
195 virtual ExtensibilityKind& extensibility_kind() = 0;
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
230 virtual ReturnCode_t copy_from(
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
248 protected:
249
250 TypeDescriptor() = default;
251
252 TypeDescriptor(
253 const TypeDescriptor& type) = default;
254
255 TypeDescriptor(
256 TypeDescriptor&& type) = default;
257
258 virtual ~TypeDescriptor() = default;
259
260 private:
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
eprosima::fastdds::dds::DynamicType
Definition DynamicType.hpp:33
eprosima::fastdds::dds::TypeDescriptor::kind
virtual void kind(TypeKind kind)=0
Modifies the underlying TypeKind.
eprosima::fastdds::dds::TypeDescriptor::~TypeDescriptor
virtual ~TypeDescriptor()=default
eprosima::fastdds::dds::TypeDescriptor::discriminator_type
virtual traits< DynamicType >::ref_type & discriminator_type()=0
Returns a reference discriminator type.
eprosima::fastdds::dds::TypeDescriptor::bound
virtual void bound(const BoundSeq &bound)=0
Modifies the underlying bound by copy.
eprosima::fastdds::dds::TypeDescriptor::base_type
virtual void base_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying base type reference.
eprosima::fastdds::dds::TypeDescriptor::extensibility_kind
virtual void extensibility_kind(ExtensibilityKind extensibility_kind)=0
Modifies the extensibility kind.
eprosima::fastdds::dds::TypeDescriptor::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::TypeDescriptor::kind
virtual TypeKind & kind()=0
Returns the TypeKind associated.
eprosima::fastdds::dds::TypeDescriptor::bound
virtual BoundSeq & bound()=0
Returns the bound.
eprosima::fastdds::dds::TypeDescriptor::key_element_type
virtual void key_element_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying key element type reference.
eprosima::fastdds::dds::TypeDescriptor::name
virtual void name(ObjectName &&name)=0
Modifies the underlying type name by move.
eprosima::fastdds::dds::TypeDescriptor::element_type
virtual traits< DynamicType >::ref_type & element_type()=0
Returns a reference element type.
eprosima::fastdds::dds::TypeDescriptor::extensibility_kind
virtual ExtensibilityKind extensibility_kind() const =0
Returns the extensibility kind.
eprosima::fastdds::dds::TypeDescriptor::name
virtual ObjectName & name()=0
Returns the fully qualified name of this type.
eprosima::fastdds::dds::TypeDescriptor::extensibility_kind
virtual ExtensibilityKind & extensibility_kind()=0
Returns the extensibility kind.
eprosima::fastdds::dds::TypeDescriptor::discriminator_type
virtual traits< DynamicType >::ref_type discriminator_type() const =0
Returns a reference discriminator type.
eprosima::fastdds::dds::TypeDescriptor::key_element_type
virtual traits< DynamicType >::ref_type & key_element_type()=0
Returns a reference key element type.
eprosima::fastdds::dds::TypeDescriptor::bound
virtual void bound(BoundSeq &&bound)=0
Modifies the underlying bound by move.
eprosima::fastdds::dds::TypeDescriptor::element_type
virtual traits< DynamicType >::ref_type element_type() const =0
Returns a reference element type.
eprosima::fastdds::dds::TypeDescriptor::is_nested
virtual bool & is_nested()=0
Returns the is_nested property.
eprosima::fastdds::dds::TypeDescriptor::equals
virtual bool equals(traits< TypeDescriptor >::ref_type descriptor)=0
Compares according with the [standard] section 7.5.2.4.6.
eprosima::fastdds::dds::TypeDescriptor::name
virtual void name(const ObjectName &name)=0
Modifies the underlying type name by copy.
eprosima::fastdds::dds::TypeDescriptor::is_nested
virtual void is_nested(bool is_nested)=0
Modifies the is_nested property.
eprosima::fastdds::dds::TypeDescriptor::discriminator_type
virtual void discriminator_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying discriminator type reference.
eprosima::fastdds::dds::TypeDescriptor::bound
virtual const BoundSeq & bound() const =0
Returns the bound.
eprosima::fastdds::dds::TypeDescriptor::name
virtual const ObjectName & name() const =0
Returns the fully qualified name of this type.
eprosima::fastdds::dds::TypeDescriptor::is_nested
virtual bool is_nested() const =0
Returns the is_nested property.
eprosima::fastdds::dds::TypeDescriptor::TypeDescriptor
TypeDescriptor(const TypeDescriptor &type)=default
eprosima::fastdds::dds::TypeDescriptor::_ref_type
typename traits< TypeDescriptor >::ref_type _ref_type
Definition TypeDescriptor.hpp:35
eprosima::fastdds::dds::TypeDescriptor::TypeDescriptor
TypeDescriptor()=default
eprosima::fastdds::dds::TypeDescriptor::kind
virtual TypeKind kind() const =0
Returns the TypeKind associated.
eprosima::fastdds::dds::TypeDescriptor::key_element_type
virtual traits< DynamicType >::ref_type key_element_type() const =0
Returns a reference key element type.
eprosima::fastdds::dds::TypeDescriptor::base_type
virtual traits< DynamicType >::ref_type base_type() const =0
Returns a reference to the base type.
eprosima::fastdds::dds::TypeDescriptor::copy_from
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....
eprosima::fastdds::dds::TypeDescriptor::base_type
virtual traits< DynamicType >::ref_type & base_type()=0
Returns a reference to the base type.
eprosima::fastdds::dds::TypeDescriptor::element_type
virtual void element_type(traits< DynamicType >::ref_type type)=0
Modifies the underlying element type reference.
eprosima::fastdds::dds::TypeDescriptor::TypeDescriptor
TypeDescriptor(TypeDescriptor &&type)=default
eprosima::fastdds::dds::ExtensibilityKind
ExtensibilityKind
This class represents the enumeration ExtensibilityKind defined by the user in the IDL file.
Definition dynamic_language_binding.hpp:107
eprosima::fastdds::dds
Definition BuiltinTopicKey.hpp:26
eprosima::fastdds::dds::BoundSeq
std::vector< uint32_t > BoundSeq
Definition dynamic_language_binding.hpp:68
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::TypeKind
uint8_t TypeKind
Definition dynamic_language_binding.hpp:70
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::dds::traits::ref_type
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29