|
Boost : |
From: Søren Frank Andersen (sfa_at_[hidden])
Date: 2002-02-25 15:59:06
Signal Review
First, I vote to accept the library.
I have only read the documentation and tried some of the examples,
So I don't really have any comments about the implementation.
My biggest complaint is: Why support return values for signals?
The problems I see with return values are as follows:
1) What is the return value, if you call a empty signal?
2) I like signal0 better then signal0< void >
3) They are not needed.
I have been using signals for some years now and
have never need return values. If needed they can be
emulated by having a pointer in the signal arguments.
4) Implementation and use will be simpler without then.
Don't take this complaint to seriously, there are probably
good reasons for including return values. The only
real argument I have against them is: They are not needed!
Some comments for the documentation:
1) I believe the slots is signalled in the sequence defined
by the SlotNameCompare function. But I could not find answers
for the following questions?
a) Is the signals with 'low' names called first?
b) What about unnamed connections or connections with the
same name, are they signalled as first connected first
signalled, last connected last signalled, or is the
sequence undefined?
2) I have guessed that the default Combiner is last_value, but
I could not find it in the documentation.
3) What happens if you disconnect while in a signal-loop?
Is it safe?
4) What happens if you connect while in a signal-loop?
Will the new slot be called?
5) I believe the documentation for ~Connection should be:
Effect: if ( this->is_controlling() ) this->disconnect();
6) In the tutorial I would like to see a example where the slot
is a member function.
7) I would like to have the Complexity of more functions documentated.
It is surprising that the complexity of signal::empty()
is O(n), where n is the number of slots in the signal.
Maybe it would be better to have a signal::size() function.
Last, I will like to say that I am really impressed with the
signal library. I just hope it wont crash my compiler (MSVC)
too often.
Søren
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk