Skip to content

Commit

Permalink
Structure DynamicType inheritance from TypeObject (#4712)
Browse files Browse the repository at this point in the history
* Hotfix: Struct DynamicType inheritance from TypeObject

Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>

* Apply review suggestion

Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>

---------

Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>
  • Loading branch information
JLBuenoLopez authored Apr 24, 2024
1 parent 3c91d03 commit 4f44922
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,22 +607,24 @@ traits<DynamicTypeBuilder>::ref_type DynamicTypeBuilderFactoryImpl::create_struc
type_descriptor.extensibility_kind(struct_type.struct_flags() & xtypes::IS_FINAL ? ExtensibilityKind::FINAL :
(struct_type.struct_flags() &
xtypes::IS_MUTABLE ? ExtensibilityKind::MUTABLE : ExtensibilityKind::APPENDABLE));

ret_val = std::make_shared<DynamicTypeBuilderImpl>(type_descriptor);

bool inheritance_correct {true};
if (xtypes::TK_NONE != struct_type.header().base_type()._d())
{
traits<DynamicType>::ref_type base_type = base_type_from_type_identifier(struct_type.header().base_type());
if (base_type)
{
ret_val->get_descriptor().base_type(base_type);
type_descriptor.base_type(base_type);
}
else
{
EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent base TypeIdentifier");
ret_val.reset();
inheritance_correct = false;
}
}
if (inheritance_correct)
{
ret_val = std::make_shared<DynamicTypeBuilderImpl>(type_descriptor);
}

if (ret_val)
{
Expand Down

0 comments on commit 4f44922

Please sign in to comment.