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

ExecutableNode improvements #838

Merged
merged 5 commits into from
May 15, 2014

Conversation

johnhaddon
Copy link
Member

This is a bit of a tidy up of the Executable code so it's in slightly better shape for someone to take on #109. The meat of it is backing out of an awkward multiple inheritance setup where any Node subclass could inherit an additional Executable interface class to become Executable - I forget why I pushed for it at the time but it's since become clear that it wasn't the right way to go, hence I'm tidying up my mess. There is now a single ExecutableNode base class which sits nicely with the DependencyNode and ComputeNode classes, and things are simpler all round.

My final commit outlines some work that I believe is pretty critical in the ExecutableNode::Task class - Lucio and I talked about it briefly via mail but rather than implement it I've left it as a todo item for now. We should discuss further and implement early on when doing #109.

The base class didn't provide any useful functionality as far as abstraction was concerned - it was just a place where we put utility functions the derived classes needed for talking to renderers. Since that functionality could be useful elsewhere, it makes more sense to provide it in a namespace available to all.

There is similar functionality buried in SceneProcedural that we should move to RendererAlgo.h at a later date. For now we're just moving the code from the Render class, because we need to move the Render class out of the way to do implement some needed refactoring of the Executable code.
I originally suggested to Lucio that he develop the Executable nodes using multiple inheritance of an Executable interface class, so that nodes could be both say a SceneNode and also Executable. That turned out to be a bad idea because the class hierarchy was rather confusing and it put the onus on developers to remember to call various methods to add plugs, test inputs were accepted etc. This led to problems like the crash bug in GafferHQ#681, and was just generally a bit more awkward than necessary.

This commit simplifies things so there is now just a single ExecutableNode base class which fits in nicely with the DependencyNode and ComputeNode base classes. The implementations for the various derived classes are now a fair bit simpler, and the bindings are performed with a new ExecutableNodeClass which matches nicely with the NodeClass and DependencyNodeClass we already have.
@johnhaddon
Copy link
Member Author

This wouldn't merge after the sets merge, but I've rebased it now so it should be good to go.

andrewkaufman added a commit that referenced this pull request May 15, 2014
@andrewkaufman andrewkaufman merged commit 4d7d837 into GafferHQ:master May 15, 2014
@johnhaddon johnhaddon deleted the executableImprovements branch May 16, 2014 08:42
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.

2 participants