-
Notifications
You must be signed in to change notification settings - Fork 206
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
Fix ExecutableNode::Task comparison functions #865
Comments
I tried the first suggestion and all my tests still passed, so that seems like a simple change. It turns out the reason we need |
About making it all const, I've ran into a few issues:
So my questions is, do you have a quick solution for me? If it'll take a bit of thought, I think I'd rather leave the immutable part as a todo, and consider the other comparison function changes enough to close this issue. |
First off, I realise I didn't specify this in the todo, but I would assume that as part of making the Task immutable, we'd also explicitly store the hash as a member variable, computing it only once at construction time. That would avoid potentially expensive recomputing every time So, given that we want to compute the hash once on construction, we also want to ensure that the Context and node we store don't change afterwards, because that would invalidate the hash - that's where the necessity for constness comes in. Sorry if that's all obvious - I felt that I should clarify things given that I'd omitted to specify that I think the hash should be stored as a member as well. If we make Task.context Boost::Python doesn't let you return I think you can bind properties as read-only simply by omitting the set argument to the I don't mind deferring the immutability question for now, in the interests of getting dispatchers out there in the wild, but I'd like it to be addressed before we consider this milestone complete. Perhaps for now we should at least remove the setter from the Python property, since it's not in use - that would at least stop us introducing new code that might be affected by later changes. |
I could probably bash out the private ConstPtr version with public accessors. That way python |
Can I do the same copy trick for the |
…cess. All members are now private, with public accessors to the const values. The hash is defined at construction by the node's executionHash, and Operator == and < use the hash directly. Fixes GafferHQ#865.
…cess. All members are now private, with public accessors to the const values. The hash is defined at construction by the node's executionHash, and Operator == and < use the hash directly. Fixes GafferHQ#865.
I'm migrating this from #109. See #838 as well for more discussion.
The text was updated successfully, but these errors were encountered: