Question about the interface classes

Håvard Wall haavardw at ifi.uio.no
Fri Jun 22 16:00:30 CEST 2007


Hi,

What's the reasoning behind the BACKEND_GET macros (and friends) in 
phonondefs_p.h? Wouldn't it be better to just add these functions as virtual 
functions to the interface classes? They could have a trivial default 
implementation returning true (or whatever makes sense).

Benefits: 

- Easier to understand and write a backend (you don't have to search the 
phonon code to find out what slots to implement).

- Efficiency: it's faster to call a virtual function than to use 
QMetaObject::invokeMethod. (Important on embedded systems! And even if it 
should be "fast enough" on some devices, every extra CPU cycle consumes 
battery which is expensive on a cell phone).

- Library size: Gets rid of some slots which blows up the compiled code. (Lots 
of strings in tables generated in the moc-files, and strings in the source 
code when invoking the methods). (I'm very concerned about the library size 
for embedded systems. Currently the core phonon libraries are near 600kB 
stripped in release mode compiled for ARM. This is a lot if you only have 
16MB of storage, or less...).

Or am I missing something?

I'm volunteering to write a patch if it makes sense.

--
hw


More information about the Phonon-backends mailing list