Re: [PATCH 19/22] Class-ify ui_out_impl

Pedro Alves
2016-11-30T22:58:00Z

On 11/30/2016 10:38 PM, Simon Marchi wrote:

> I'll consider working on merging ui_out and ui_out_impl_* in a single
> class hierarchy. My first question is: what is a good pattern for the
> overlapping methods. For example, table_begin. We'll want to execute
> the version of the base class, which will then call the specialization.
> So we can't use the same name for both. So, keep table_begin for the
> base class, and table_begin_impl for the derived classes?

Yes. I think gold's convention is to use $method for public methods, and
do_$method for protected virtual methods that implementations
override/provide. I've seen "do_" used for the same purpose in other
projects too. (IIRC, gold is even stricter and requires that virtual
methods must be protected, thus mandating that design everywhere.
Grep for "this->do_".)

>> I'd like to post the gnulib namespace patch this week,
>> but I'm not sure I'll be able to.
>
> And I guess it happens to work anyway for me because both the
> declaration, definition and usages get replaced?

Yeah, unistd.h is included in defs.h, so it most probably
won't be an issue in practice.

>
> Should I wait for your patch to get in (I'm not particularly in a
> hurry), or we can get it in despite "close" getting replaced?

Given the above, no need to wait.

Thanks,
Pedro Alves