How do I extend IntegralType properly?

David Nolden david.nolden.kdevelop at art-master.de
Sat Apr 11 08:55:00 UTC 2009


Am Samstag 11 April 2009 00:08:34 schrieb Milian Wolff:
> On Friday 10 April 2009, David Nolden wrote:
> > You have to make sure the type has a unique "Identity", and register it
> > to the duchain type register.
> >
> > See the custom cpp types to see how to do that stuff.
>
> Ah, ok.
>
> Further questions: Do I have to
>
> - implement the hash function? If so, is something like you did for
> CppClassType (for example 3 * base-class-hash) enough?
Yes, to reduce the probability of hash-clashes

Most importantly: Implement the equals(..) function, it must only return true 
when the items are exactly equal, including the type AbstractType based type.

> - implement that fastCast stuff?
That's just for speedup, doesn't matter.

> - introduce my own Data-Class for that type, even if the Data itself
> doesn't change at all?
No, not needed I think.

Greetings, David





More information about the KDevelop-devel mailing list