[Libreoffice] sw: serial numbers
Lubos Lunak
l.lunak at suse.cz
Wed Nov 23 06:03:56 PST 2011
On Wednesday 23 of November 2011, Michael Stahl wrote:
> hi all,
>
> i am currently wondering:
> in sw, a bunch of classes define serial numbers, e.g. SwIndex, SwNode, etc.
>
> in a DBG_UTIL build, there is a global counter, and the ctor increments
> the counter and assigns its value to a member, so every instance has a
> unique serial.
>
> what is the point of this? how would this help in debugging, given that
> the pointer values of the instances ought to be unique as long as they
> live?
That is not the case with multiple inheritance, e.g. SwCntntNode does not
have SwNode as its first base class (and trying to change that goes horribly
wrong). But I myself wouldn't consider that a good reason for keeping the
serials.
--
Lubos Lunak
l.lunak at suse.cz
More information about the LibreOffice
mailing list