[Kde-games-devel] Unify pixmap caching across card games

Andreas Pakulat apaku at gmx.de
Mon Jan 7 20:08:50 CET 2008


On 06.01.08 12:39:31, Aaron J. Seigo wrote:
> On Sunday 06 January 2008, Andreas Pakulat wrote:
> > On 06.01.08 16:52:44, Dmitry Suzdalev wrote:
> > > Looks nice!
> > >
> > > Minor thing is: how about adding "const" modifier to "get" methods? :)
> >
> > Not possible, because getXXX might modify data as the requested card
> > might not yet have been in the cache.
> 
> if the members are in the dptr then you have nothing to worry about: members 
> of the dptr can be modified at will; you can also put methods in the private 
> class that need to access non-const methods and call those from your const 
> methods. dirty little tricks, but often perfect for keeping the API clean.

Indeed. Thanks for that hint.

> and i don't know if it matters any to the kdegames devel style, but usually we 
> don't use the get prefix for getters. so getBackground would just be 
> background and getCard would just be card. perhaps the kdegames libs are full 
> of get* methods though (haven't looked) and so without the get prefix it 
> would be out of sync?

I wonder how the get crept in there :) I guess I did too much java code
the last 2 years...

Andreas

-- 
Another good night not to sleep in a eucalyptus tree.


More information about the kde-games-devel mailing list