This repository has been archived by the owner on May 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Does the const/non const thing make sense here, @renemilk? Or how do I default implement the const variant using the non-const variant in this case?
- Loading branch information
1 parent
f651cb6
commit 0179341
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0179341
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.
TBH I see no reason at all to the GridProvider. It has no state besides the actual grid. The way that copy is implemented it just copies the shread_ptr to the grid, not the grid. I think it is not obvious what the right thing to do here is in general, since the interface does not prescribe grid storage. The derived classes are really all just factories anyway, right?
0179341
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.
We had the case where the grid got lost in the python bindings, and the first crude hack was to keep a copy of the grid provider. Unfortunately, the interface class does not store the grid_ptr, but each implementor does (e.g.,
Cube
), since accessing the ptr is not part of the interface (only the reference is). By addingcopy()
, I could allow the one provider I was using to be copyable.I am aware that this is not something we would want to have generally, and this is only inside the paper branch. My question was actually really concerned with the actual lines of code in
interface.hh
, where I am unsure if I can suitably default implement the const method using the other.0179341
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.
Ok, the way you've set this up should work for now. I wouldn't really want it outside the paper branch though.