Re: [sigc] conditions in libsigc



Aristid Breitkreuz wrote:
> Am Freitag, den 30.06.2006, 20:58 +0300 schrieb Paul Pogonyshev:
> > Hi,
> > 
> > I would like to propose conditions in libsigc.  A condition is basically
> > a boolean vairable plus signal which is emitted each time the variable
> > state is changed (from true to false or vice versa.)
> 
> Sounds useful but I do not think they belong in sigc++. This sounds to
> me like a special case of a variable that whenever changed emits a
> signal. Why restrict yourself to bool?

It is weird to create a separate library with such a small functionality and
I thought sigc++ fitted it best.  (I.e. it is probably a better fit than e.g.
Glibmm.)

> >   They are useful in
> > e.g. GUI design because you can specify a boolean expression, e.g.
> > sensitivity or visibility, only once and not track when its state changes,
> > which can be difficult at times.
> 
> Are there exception guarantees?

Well, I didn't think about it :)  That depends on implementation, right?

> >   In other words, the condition itself
> > and its state tracking are no longer separated and chances of programming
> > error are significantly smaller.
> > 
> > I volunteer to implement this if you are interested.
> 
> I have written a library that does something similar but does NOT track
> when the state changes. But this is nothing but syntactic sugar anyways.
> You might want to take a look though:
> 
> http://gott.snip-a-lot.de/autodoc/namespacegott_1_1properties.html
> (documentation only, includes a tutorial but not necessarily in the best
> style)

Yeah, but GOTT is heavy, it seems.

Anyway, if you don't think it is good for sigc++, let's not continue this
discussion.

Paul



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