On 07/08/2014 07:00, Alex Peshkoff wrote:
> On 08/06/14 22:11, Adriano dos Santos Fernandes wrote:
>> Alex and All,
>>
>> Based on Alex code, I did some changes (attached) to support:
>> - Avoid runtime crash if a method is missed in an implementation
>> - Avoid need to manually initialize the vTable
>> - Avoid preprocessor tricks
>
> OK for all this. very nice.
> I've just added default for
> typename Base = IVersionedImpl<Name, IRefCounted>
>
> This makes simpler primary interface implementation (IMO 98% of cases).
> class RefCounted : public IRefCountedImpl<RefCounted>
>

Agreed.

> If we anyway need different ways to call different types of methods
> why have all this underlines?
> May be better do
>
> void RefCounted::addRefCaller()
> {
>     IRefCounted::addRef();
> }
>
> and let the rest of code look _much_ better?
>
I disagree here. This is very unnatural:

    IRefCounted::addRef();

Here you just mean to call the current (possibly inherited) addRef
method, but you need to prefix it with the interface name. And if you
don't, someone inheriting the implementation will have problems
difficult to understand. And it's a much more common case than calling a
super method.

Underlines may be bad, and we may switch to something better. Maybe:

void RefCounted2::addRefImpl()
{
    RefCounted::addRefImpl();    // super
}


Adriano


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to