-
Notifications
You must be signed in to change notification settings - Fork 28
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
pimpl IBuilder #40
pimpl IBuilder #40
Conversation
… improve abi compatibility
I don't understand. This adds another level of indirection, but why? What problem is it solving that simple virtual class inheritance and a |
Additions to the pure virtual interface would break the abi. These I-classes in |
Before we merge any PRs related to stabilizing the ABI, I think we need to come up with guidelines potentially rename/relocate some of the |
I agree we need to organize and rename them, but that shouldn't block this update. Otherwise it will just be code rot. |
The problem with this update is it's not consistent with the other PIMPL interfaces:
So which way should we be doing it? Without guidelines this is hard to say what it should be. Looking at this PR in more detail, I think things would be a lot clearer if the PIMPL object was separated from the backend object so the pattern used for |
Builder is the unqiue one of the bunch. Executor, Pipeline, segment::Definition are all objects that the user is expected to construct and take ownership of. The public Both pimpl and an abstract interface provide a compilation barrier so all the template headers do no propagate. the pimpl model allows for additions while the abstract interface does not. Plus, it was a little ugly to inherit from IBuilder and also accept a reference to an IBuilder, then have builder implement the interface by forwarding to the reference. The pimpl idiom does the same thing, but it's hidden away in a compilation unit.
|
The other are all pimpl'd with a single pure virtual destructor to forbid construction without inheritance. |
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 fine; one include ordering typo.
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.
I'd actually missed that the internal and public classes have the same name.
This gets really confusing, and I'd like to take a look at naming conventions, or isolation conventions between public and detail interfaces.
@gpucibot merge |
replacing the virtual interface of IBuilder with a pimpl interface to improve abi compatibility