octave-maintainers
[Top][All Lists]
Advanced

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

Re: Signal/slot paradigm in graphics code, libsigc++ dependency


From: Michael Goffioul
Subject: Re: Signal/slot paradigm in graphics code, libsigc++ dependency
Date: Thu, 28 Aug 2008 21:57:56 +0200

On Thu, Aug 28, 2008 at 3:15 PM, John W. Eaton <address@hidden> wrote:
> I don't object to the additional dependency, but can you briefly
> explain what this library provides and how it helps?

This library provides a C++ framework implementing signal/slot
mechanism, useful in an event-driven system. It's template-based
using compile-time type checking. Callback functions can be simple
functions as well as class methods. It also provides an automatic
disconnection when on referred object is destroyed.

After I implemented listeners, I thought it would be better to
merge the concept of listeners and internal updaters, the latter
being viewed as builtin listeners. Both would then be 2 kind of
slots that can be connected to signals provided by properties
(pre-/post-set pre-/post-get) and objects (object created/destroyed).
I also have other type of slot in mind, related to cache clean-up
or even backend notification. In the end, there wouldn't be any
need for different piece of code to call listeners, call internal
updaters, notify the backend...

I'm thinking about this for a while and one tricky thing I found
is when object starts to listen for changes in other objects: in
that case, these objects must notify each other when one gets
destroyed to remove the connection. Another thing is to be able
to use class methods as callback. Libsigc++ seems to provide
an elegant way to handle these.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]