Skip to content

Commit de5b3d3

Browse files
committed
Move idl parser implementation to create_type_w_uri
Signed-off-by: Yangbo Long <[email protected]>
1 parent d8229c5 commit de5b3d3

File tree

4 files changed

+289
-289
lines changed

4 files changed

+289
-289
lines changed

include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
154154

155155
/*!
156156
* Creates a new @ref DynamicTypeBuilder reference by parsing the type description at the given URL.
157-
* @remark Not implemented yet.
158157
* @param [in] document_url pointing to the url containing the type description.
159158
* @param [in] type_name Fully qualified name of the type to be loaded from the document.
160159
* @param [in] include_paths A collection of URLs to directories to be searched for additional type description

src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,11 @@ traits<DynamicTypeBuilder>::ref_type DynamicTypeBuilderFactoryImpl::create_type_
7777
const std::string& type_name,
7878
const IncludePathSeq& include_paths) noexcept
7979
{
80-
traits<DynamicTypeBuilder>::ref_type ret_val;
81-
82-
try
83-
{
84-
idlparser::Context context = idlparser::parse_file(document, type_name, include_paths, preprocessor_);
85-
ret_val = context.builder;
86-
}
87-
catch (const std::exception& e)
88-
{
89-
EPROSIMA_LOG_ERROR(IDLPARSER, e.what());
90-
ret_val.reset();
91-
}
92-
93-
return ret_val;
80+
traits<DynamicTypeBuilder>::ref_type nil;
81+
static_cast<void>(document);
82+
static_cast<void>(type_name);
83+
static_cast<void>(include_paths);
84+
return nil;
9485
}
9586

9687
traits<DynamicTypeBuilder>::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_type_object(
@@ -196,11 +187,20 @@ traits<DynamicTypeBuilder>::ref_type DynamicTypeBuilderFactoryImpl::create_type_
196187
const std::string& type_name,
197188
const IncludePathSeq& include_paths) noexcept
198189
{
199-
traits<DynamicTypeBuilder>::ref_type nil;
200-
static_cast<void>(document_url);
201-
static_cast<void>(type_name);
202-
static_cast<void>(include_paths);
203-
return nil;
190+
traits<DynamicTypeBuilder>::ref_type ret_val;
191+
192+
try
193+
{
194+
idlparser::Context context = idlparser::parse_file(document_url, type_name, include_paths, preprocessor_);
195+
ret_val = context.builder;
196+
}
197+
catch (const std::exception& e)
198+
{
199+
EPROSIMA_LOG_ERROR(IDLPARSER, e.what());
200+
ret_val.reset();
201+
}
202+
203+
return ret_val;
204204
}
205205

206206
//}}}

0 commit comments

Comments
 (0)