Fast DDS  Version 3.0.1
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
27namespace eprosima {
28namespace fastdds {
29namespace dds {
30
31namespace xtypes {
32class TypeObject;
33} // namespace xtypes
34
35class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTypeBuilderFactory>
36{
37public:
38
40
47
54 FASTDDS_EXPORTED_API static ReturnCode_t delete_instance();
55
62 TypeKind kind) = 0;
63
71
79
86 const xtypes::TypeObject& type_object) = 0;
87
95 uint32_t bound) = 0;
96
104 uint32_t bound) = 0;
105
115 uint32_t bound) = 0;
116
125 const BoundSeq& bound) = 0;
126
136 traits<DynamicType>::ref_type key_element_type,
138 uint32_t bound) = 0;
139
146 uint32_t bound) = 0;
147
158 const std::string& document_url,
159 const std::string& type_name,
160 const IncludePathSeq& include_paths) = 0;
161
172 const std::string& document,
173 const std::string& type_name,
174 const IncludePathSeq& include_paths) = 0;
175
182 FASTDDS_EXPORTED_API virtual ReturnCode_t delete_type(
184
185protected:
186
188
189 virtual ~DynamicTypeBuilderFactory() = default;
190
192
193private:
194
196 const DynamicTypeBuilderFactory&) = delete;
197
199 DynamicTypeBuilderFactory&&) = delete;
200
201 DynamicTypeBuilderFactory& operator =(
202 const DynamicTypeBuilderFactory&) = delete;
203
204 DynamicTypeBuilderFactory& operator =(
205 DynamicTypeBuilderFactory&&) = delete;
206
207};
208
209} // namespace dds
210} // namespace fastdds
211} // namespace eprosima
212
213#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICTYPEBUILDERFACTORY_HPP
Definition DynamicTypeBuilderFactory.hpp:36
virtual FASTDDS_EXPORTED_API traits< DynamicTypeBuilder >::ref_type create_bitmask_type(uint32_t bound)=0
Creates a new DynamicTypeBuilder reference representing a bitmask.
traits< DynamicTypeBuilderFactory >::ref_type _this()
virtual FASTDDS_EXPORTED_API traits< DynamicType >::ref_type get_primitive_type(TypeKind kind)=0
Retrieves the cached DynamicType reference associated to a given primitive.
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.
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.
typename traits< DynamicTypeBuilderFactory >::ref_type _ref_type
Definition DynamicTypeBuilderFactory.hpp:39
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.
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.
static FASTDDS_EXPORTED_API ReturnCode_t delete_instance()
Resets the singleton reference.
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.
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.
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.
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 xtypes::TypeObject instance.
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...
virtual FASTDDS_EXPORTED_API ReturnCode_t delete_type(traits< DynamicType >::ref_type &type)=0
Resets the internal reference if it is cached.
static FASTDDS_EXPORTED_API traits< DynamicTypeBuilderFactory >::ref_type get_instance()
Returns the singleton factory object.
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.
This class represents the union TypeObject defined by the user in the IDL file.
Definition dds_xtypes_typeobject.hpp:23290
Definition DomainParticipant.hpp:45
std::vector< std::string > IncludePathSeq
Definition dynamic_language_binding.hpp:64
std::vector< uint32_t > BoundSeq
Definition dynamic_language_binding.hpp:68
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
uint8_t TypeKind
Definition dynamic_language_binding.hpp:70
eProsima namespace.
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29