Skip to content

#268: Fix deserialization of polymorphic types when base class is specified as a template parameter.#362

Open
thearusable wants to merge 14 commits intodevelopfrom
268-deserialize-polymorphic-type
Open

#268: Fix deserialization of polymorphic types when base class is specified as a template parameter.#362
thearusable wants to merge 14 commits intodevelopfrom
268-deserialize-polymorphic-type

Conversation

@thearusable
Copy link
Contributor

Fixes #268

@thearusable thearusable self-assigned this Jul 23, 2024
@thearusable thearusable force-pushed the 268-deserialize-polymorphic-type branch from 842ae6f to 32264fe Compare July 23, 2024 14:05
@thearusable thearusable marked this pull request as draft July 23, 2024 14:29
@PhilMiller
Copy link
Member

I'll wait to look deeper at the implementation until the tests are passing.

@thearusable thearusable marked this pull request as ready for review July 24, 2024 19:38
@thearusable thearusable changed the title #268: Fix deserialization of polymorphic types when base class is specified. #268: Fix deserialization of polymorphic types when base class is specified as a template parameter. Jul 24, 2024
@thearusable thearusable force-pushed the 268-deserialize-polymorphic-type branch from 4c4027c to 9c50fab Compare September 24, 2024 14:05
auto ret = checkpoint::serialize(*task);
auto out = checkpoint::deserialize<Base>(std::move(ret));

EXPECT_TRUE(nullptr != out);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should probably include an ID check here to ensure we are getting the right type instead of just checking that it's not null and the output value is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the check for typeid.

@thearusable thearusable force-pushed the 268-deserialize-polymorphic-type branch from 9bd0905 to 6fec221 Compare September 30, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

This code fails when T is polymorphic

3 participants