[odb-users] Issue in derived class callback

Domenico Di Iorio ddiorio at jmawireless.com
Mon Mar 29 10:34:27 EDT 2021


It’s (2).
I agree it seems logical and flexible, (user can always define cb2 to call cb1).
I just wanted to make sure it was known because I didn’t find on manual.

Thanks for reply,

Regards,
Di Iorio Domenico

> Il giorno 29 mar 2021, alle ore 16:16, Boris Kolpackov <boris at codesynthesis.com> ha scritto:
> 
> Domenico Di Iorio <ddiorio at jmawireless.com> writes:
> 
>> Issue has been found when registering callback in derived class.
>> Apparently it overrides the one registered in base class.
>> Is it already known?
>> 
>> e.g.
>> #pragma db callback(cb1)
>> class Base {
>> ...
>> }
>> 
>> #pragma db callback(cb2)
>> class Derived : public Base {
>> ...
>> }
>> 
>> cb1 gets overridden by cb2.
> 
> Hm, which one of the two cases is this:
> 
> 1. cb2 is now called for instances of the Base class.
> 
> 2. cb2 is now called for instances of the Derived class.
> 
> If it's (1), then that would definitely be a bug. If it's (2), then
> that seems like a fairly logical and flexible behavior.




More information about the odb-users mailing list