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

Aaron J. Seigo aseigo at kde.org
Sun Jan 6 20:39:31 CET 2008


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.

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?

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20080106/f61f388c/attachment.pgp 


More information about the kde-games-devel mailing list