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

[wpiutil] Struct: Add info template parameter pack #6086

Merged
merged 7 commits into from
Dec 27, 2023

Conversation

PeterJohnson
Copy link
Member

@PeterJohnson PeterJohnson commented Dec 23, 2023

This allows using Struct in a dynamically typed environment by passing additional information to the Struct serialization functions.

Fixes #5964.

@PeterJohnson PeterJohnson requested a review from a team as a code owner December 23, 2023 18:32
This allows using Struct in a dynamically typed environment by passing
additional information to the Struct serialization functions.
@PeterJohnson
Copy link
Member Author

/format

@virtuald
Copy link
Member

StructPublisher isn't movable because you can't move std::atomic. Looks like your operator= does a store/load thing, the move constructor needs to do the same thing. Here's what I did:

  StructPublisher(StructPublisher&& rhs)
      : Publisher{std::move(rhs)},
        m_info{std::move(rhs.m_info)} {
    m_schemaPublished.store(
        rhs.m_schemaPublished.load(std::memory_order_relaxed),
        std::memory_order_relaxed);
  }

@PeterJohnson
Copy link
Member Author

Fixed.

Copy link
Member

@virtuald virtuald left a comment

Choose a reason for hiding this comment

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

LGTM

@PeterJohnson PeterJohnson merged commit 6a2d3c3 into wpilibsuite:main Dec 27, 2023
27 checks passed
@PeterJohnson PeterJohnson deleted the add-struct-info branch December 27, 2023 15:52
r4stered pushed a commit to r4stered/allwpilib that referenced this pull request Dec 28, 2023
This allows using Struct in a dynamically typed environment by passing
additional information to the Struct serialization functions.
Oblarg pushed a commit to Oblarg/allwpilib that referenced this pull request Dec 30, 2023
This allows using Struct in a dynamically typed environment by passing
additional information to the Struct serialization functions.
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.

[wpiutil] need to support dynamic serialization object for robotpy
3 participants