| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
DynamicTypeBuilderFactory.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__DYNAMICTYPEBUILDERFACTORY_HPP
16#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPEBUILDERFACTORY_HPP
17
18#include <memory>
19#include <string>
20
21#include <fastdds/dds/core/ReturnCode.hpp>
22#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>
23#include <fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp>
24#include <fastdds/dds/xtypes/dynamic_types/Types.hpp>
25#include <fastdds/fastdds_dll.hpp>
26
27 namespace eprosima {
28 namespace fastdds {
29 namespace dds {
30
31 namespace xtypes {
32 class TypeObject;
33} // namespace xtypes
34
35 class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTypeBuilderFactory>
36{
37 public:
38
39 using _ref_type = typename traits<DynamicTypeBuilderFactory>::ref_type;
40
46 FASTDDS_EXPORTED_API static traits<DynamicTypeBuilderFactory>::ref_type get_instance();
47
54 FASTDDS_EXPORTED_API static ReturnCode_t delete_instance();
55
61 FASTDDS_EXPORTED_API virtual traits<DynamicType>::ref_type get_primitive_type(
62 TypeKind kind) = 0;
63
69 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_type(
70 traits<TypeDescriptor>::ref_type descriptor) = 0;
71
77 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_type_copy(
78 traits<DynamicType>::ref_type type) = 0;
79
85 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_type_w_type_object(
86 const xtypes::TypeObject& type_object) = 0;
87
94 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_string_type(
95 uint32_t bound) = 0;
96
103 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_wstring_type(
104 uint32_t bound) = 0;
105
113 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_sequence_type(
114 traits<DynamicType>::ref_type element_type,
115 uint32_t bound) = 0;
116
123 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_array_type(
124 traits<DynamicType>::ref_type element_type,
125 const BoundSeq& bound) = 0;
126
135 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_map_type(
136 traits<DynamicType>::ref_type key_element_type,
137 traits<DynamicType>::ref_type element_type,
138 uint32_t bound) = 0;
139
145 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_bitmask_type(
146 uint32_t bound) = 0;
147
152 FASTDDS_EXPORTED_API virtual void set_preprocessor(
153 const std::string& preprocessor) = 0;
154
163 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_type_w_uri(
164 const std::string& document_url,
165 const std::string& type_name,
166 const IncludePathSeq& include_paths) = 0;
167
177 FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_type_w_document(
178 const std::string& document,
179 const std::string& type_name,
180 const IncludePathSeq& include_paths) = 0;
181
188 FASTDDS_EXPORTED_API virtual ReturnCode_t delete_type(
189 traits<DynamicType>::ref_type& type) = 0;
190
191 protected:
192
193 DynamicTypeBuilderFactory() = default;
194
195 virtual ~DynamicTypeBuilderFactory() = default;
196
197 traits<DynamicTypeBuilderFactory>::ref_type _this();
198
199 private:
200
201 DynamicTypeBuilderFactory(
202 const DynamicTypeBuilderFactory&) = delete;
203
204 DynamicTypeBuilderFactory(
205 DynamicTypeBuilderFactory&&) = delete;
206
207 DynamicTypeBuilderFactory& operator =(
208 const DynamicTypeBuilderFactory&) = delete;
209
210 DynamicTypeBuilderFactory& operator =(
211 DynamicTypeBuilderFactory&&) = delete;
212
213};
214
215} // namespace dds
216} // namespace fastdds
217} // namespace eprosima
218
219#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPEBUILDERFACTORY_HPP
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_bitmask_type
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_bitmask_type(uint32_t bound)=0
Creates a new DynamicTypeBuilder reference representing a bitmask.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::_this
traits< DynamicTypeBuilderFactory >::ref_type _this()
eprosima::fastdds::dds::DynamicTypeBuilderFactory::get_primitive_type
virtual FASTDDS_EXPORTED_API traits< DynamicType >::ref_type get_primitive_type(TypeKind kind)=0
Retrieves the cached DynamicType reference associated to a given primitive.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_type_w_uri
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_type_w_uri(const std::string &document_url, const std::string &type_name, const IncludePathSeq &include_paths)=0
Creates a new DynamicTypeBuilder reference by parsing the type description at the given URL.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_array_type
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_array_type(traits< DynamicType >::ref_type element_type, const BoundSeq &bound)=0
Creates a new DynamicTypeBuilder reference representing an array.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::_ref_type
typename traits< DynamicTypeBuilderFactory >::ref_type _ref_type
Definition DynamicTypeBuilderFactory.hpp:39
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_map_type
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_map_type(traits< DynamicType >::ref_type key_element_type, traits< DynamicType >::ref_type element_type, uint32_t bound)=0
Creates a new DynamicTypeBuilder reference representing a map.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_string_type
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_string_type(uint32_t bound)=0
Creates a new DynamicTypeBuilder reference representing a bounded string type.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::delete_instance
static FASTDDS_EXPORTED_API ReturnCode_t delete_instance()
Resets the singleton reference.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::DynamicTypeBuilderFactory
DynamicTypeBuilderFactory()=default
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_wstring_type
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_wstring_type(uint32_t bound)=0
Creates a new DynamicTypeBuilder reference representing a bounded wstring type.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_sequence_type
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_sequence_type(traits< DynamicType >::ref_type element_type, uint32_t bound)=0
Creates a new DynamicTypeBuilder reference representing a sequence.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_type_copy
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_type_copy(traits< DynamicType >::ref_type type)=0
Creates a new DynamicTypeBuilder reference based on the given DynamicType reference.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_type_w_type_object
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_type_w_type_object(const xtypes::TypeObject &type_object)=0
Creates a new DynamicTypeBuilder reference based on the given TypeObject instance.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_type_w_document
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_type_w_document(const std::string &document, const std::string &type_name, const IncludePathSeq &include_paths)=0
Creates a new DynamicTypeBuilder reference by parsing the type description contained in the given str...
eprosima::fastdds::dds::DynamicTypeBuilderFactory::~DynamicTypeBuilderFactory
virtual ~DynamicTypeBuilderFactory()=default
eprosima::fastdds::dds::DynamicTypeBuilderFactory::delete_type
virtual FASTDDS_EXPORTED_API ReturnCode_t delete_type(traits< DynamicType >::ref_type &type)=0
Resets the internal reference if it is cached.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::get_instance
static FASTDDS_EXPORTED_API traits< DynamicTypeBuilderFactory >::ref_type get_instance()
Returns the singleton factory object.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::create_type
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_type(traits< TypeDescriptor >::ref_type descriptor)=0
Creates a new DynamicTypeBuilder reference based on the given TypeDescriptor state.
eprosima::fastdds::dds::DynamicTypeBuilderFactory::set_preprocessor
virtual FASTDDS_EXPORTED_API void set_preprocessor(const std::string &preprocessor)=0
Sets the path to the preprocessor executable to be used when parsing type descriptions.
eprosima::fastdds::dds::xtypes::TypeObject
This class represents the union TypeObject defined by the user in the IDL file.
Definition dds_xtypes_typeobject.hpp:23463
eprosima::fastdds::dds::xtypes
Definition QosPolicies.hpp:2491
eprosima::fastdds::dds
Definition BuiltinTopicKey.hpp:26
eprosima::fastdds::dds::IncludePathSeq
std::vector< std::string > IncludePathSeq
Definition dynamic_language_binding.hpp:64
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::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