-
Notifications
You must be signed in to change notification settings - Fork 176
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
feat(util): Grid type-erased output and comparisons #3469
feat(util): Grid type-erased output and comparisons #3469
Conversation
fix: Axis output gave wrong information fix(util): Axis output typo
fix(util): TestAxis::toStream added
fix(util): Axis switches need to be exhaustive
fix(util): Grid variable shadowing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 left two minor comments
📊: Physics performance monitoring for 6403bc9physmon summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
The new code looks all tested, so I guess |
@asalzburger I can add some more test for the output and equality code. Doesn't hurt anyway. |
b5d9ffc
|
Axis
instances get an outstream operatorIAxis
adds atoStream
virtual method overriden by derived classes, soIAxis
instances become printable without downcasting.IGrid
also gets atoStream
virtual method + an outstream operator to allow printing a whole grid.IAxis
gets an equality operatorIGrid
gets an equality operator working with theIAxis
interface instead of dedicated virtual methods. This only checks the axes for equivalence, not the grid contentsAxisConcept
class, that just checks if a type inherits fromIAxis
.IAxis
gets avisit
function accepting a generic callable. This function will use runtime control flow to call the callable with the concrete axis type. This allows dispatching into code with the correct concrete axis type, without having to copy the downcasting logic everywhere:I think this functionality is somewhat related, which is why I grouped it like this. If there's disagreement, I'm happy to split this up further.