lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


QT signal/slot system does not only need a preprocessor, but also uses
string message parsing, with causes a lot of overhead. Any decent template
based C++ callback system should be able to outperform the signal/slot
system and also provide more type safety (which is essentially for free on a
template system).

For infos about C++ callbacks look at the following site:

http://sunsite.dk/lgdc/articles.php3?mode=body&articleid=5


I did extend the system so that I am able to bind a Lua function to a
callback, so that when the C++ object calls the callback it can jump
seamless into Lua (without even knowing about Lua in the system).  Very nice
feature, when you don't know beforehand, what parts of your code will be
written in Lua and what in C++ (sometimes we got to switch from Lua to C++
for performance reasons, etc.)


Dirk

-----Ursprungliche Nachricht-----
Von: owner-lua-l@tecgraf.puc-rio.br
[mailto:owner-lua-l@tecgraf.puc-rio.br]Im Auftrag von Christian Vogler
Gesendet: Freitag, 12. Januar 2001 10:25
An: Multiple recipients of list
Betreff: Re: tolua, c++, garbagecollection and memory management


On Fri, Jan 12, 2001 at 03:27:56AM -0000, Sebby  wrote:
> This could easily be done with a C++ functor template to define the
> stub functions. Here is a link to an example of functors
>
> http://www.bestweb.net/~rhickey/

Yor ideas remind me a lot of the Qt library's signal/slot
mechanism. Have you taken a look at it? Your approach, however, has
the advantage that it does not rely on any kind of extensions to the
C++ language, whereas with Qt you need a special preprocessor (moc).

- Christian