Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21397] Parse IDL string for xtypes #4943

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if(MSVC OR MSVC_IDE)
# C4715: 'Test': not all control paths return a value
# C5038 data member 'member1' will be initialized after data member 'member2'
# C4100 'identifier' : unreferenced formal parameter (matches clang -Wunused-lambda-capture)
add_compile_options(/w34101 /w34189 /w34555 /w34715 /w35038 /w44100)
add_compile_options(/w34101 /w34189 /w34555 /w34715 /w35038 /w44100 /bigobj)

if(EPROSIMA_BUILD)
string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <fastdds/xtypes/type_representation/TypeObjectRegistry.hpp>
#include <rtps/RTPSDomainImpl.hpp>

#include "idl_parser/Idl.hpp"

namespace eprosima {
namespace fastdds {
namespace dds {
Expand Down Expand Up @@ -65,11 +67,20 @@ traits<DynamicTypeBuilder>::ref_type DynamicTypeBuilderFactoryImpl::create_type_
const std::string& type_name,
const IncludePathSeq& include_paths) noexcept
{
traits<DynamicTypeBuilder>::ref_type nil;
static_cast<void>(document);
static_cast<void>(type_name);
static_cast<void>(include_paths);
return nil;
traits<DynamicTypeBuilder>::ref_type ret_val;

try
{
idlparser::Context context = idlparser::parse_file(document, type_name, include_paths);
ret_val = context.builder;
}
catch (const std::exception& e)
{
EPROSIMA_LOG_ERROR(IDLPARSER, e.what());
ret_val.reset();
}

return ret_val;
}

traits<DynamicTypeBuilder>::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_type_object(
Expand Down
362 changes: 362 additions & 0 deletions src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlGrammar.hpp

Large diffs are not rendered by default.

Loading