Best practices for boost:signal
What is the best practice for using boost::signal? Should the signal be
a public field? Should an accessor method be used? Should there be some
special connection methods for every signal, like the following:
private:
signal
2006/11/15, Memfis
What is the best practice for using boost::signal? Should the signal be a public field? Should an accessor method be used? Should there be some special connection methods for every signal, like the following:
private: signal
x; public: void connectX(const signal ::slot_type& slot); void disconnectX(const signal ::slot_type& slot); If you use boost:signal, how do you do it?
I used public signals in my project (http://vaca.sf.net), but I would like to known what people think about it. Personally, I don't like the idea to have two methods to connect and disconnect slots.
On Wed, 15 Nov 2006, David Capello wrote:
2006/11/15, Memfis
: What is the best practice for using boost::signal? Should the signal be a public field? Should an accessor method be used? Should there be some special connection methods for every signal, like the following:
private: signal
x; public: void connectX(const signal ::slot_type& slot); void disconnectX(const signal ::slot_type& slot); If you use boost:signal, how do you do it?
I used public signals in my project (http://vaca.sf.net), but I would like to known what people think about it.
Personally, I don't like the idea to have two methods to connect and disconnect slots.
Another practice is to use proxies. This is what they do in gtkmm, albeit with libsigc++ instead of boost::signal, but it's quite similar. -- François Duranleau LIGUM, Université de Montréal
"Memfis" wrote:
What is the best practice for using boost::signal? Should the signal be a public field? Should an accessor method be used?
I hardly know what "best practises" to use.
I submitted something recently for comments. It tries to be somewhat
thread-safe.
See [Boost.Signals] in Multithreaded Environment, submitted on Nov 11.
(I don't know how to put a link here, sorry).
terry
begin 666 [Boost.Signals] in Multithreaded Environment.nws
M4&%T:#H@;F5W
participants (4)
-
David Capello
-
François Duranleau
-
Memfis
-
Terry G