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

Refactor TrapezoidProfile API #5457

Merged
merged 7 commits into from
Jul 20, 2023

Conversation

Gold856
Copy link
Contributor

@Gold856 Gold856 commented Jul 18, 2023

ctor args were moved to calculate, all examples were updated, command and subsystem updated as well, and anything else that made it not compile was updated. Fixes #5453.

@Gold856 Gold856 requested review from a team as code owners July 18, 2023 04:55
@calcmogul calcmogul added breaking Introduces a breaking change. component: wpimath Math library labels Jul 18, 2023
@PeterJohnson
Copy link
Member

Is there a way to make this less immediately breaking from a user perspective, eg with deprecated functions? Or is a hard break required?

@calcmogul
Copy link
Member

calcmogul commented Jul 18, 2023

I think we can have separate constructor and calculate() overloads, though using the new ctor overload with the old calculate() will have undefined behavior.

@Gold856
Copy link
Contributor Author

Gold856 commented Jul 18, 2023

How about a boolean variable, m_newAPI, that is true when using the new ctor, and false with the old ctor. If the old calculate is called, and m_newAPI is true, throw a RuntimeException. Then old ctors and calculate are deprecated.

@calcmogul
Copy link
Member

That'll work.

@Gold856
Copy link
Contributor Author

Gold856 commented Jul 18, 2023

Do we still need that "breaking" tag if we only deprecated functions?

@PeterJohnson PeterJohnson removed the breaking Introduces a breaking change. label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor TrapezoidProfile API to match primary use case better
3 participants