By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,617 Members | 1,896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,617 IT Pros & Developers. It's quick & easy.

Best practises for boost:signal

P: n/a
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<void()x;
public:
void connectX(const signal<void()>::slot_type& slot);
void disconnectX(const signal<void()>::slot_type& slot);

If you use boost:signal, how do you do it?

(Okay, actually connectX should return a connection object and
disconnectX should take the it as its parameter, but it's about the
general idea)

--
Memfis

Nov 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Memfis wrote:
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<void()x;
public:
void connectX(const signal<void()>::slot_type& slot);
void disconnectX(const signal<void()>::slot_type& slot);

If you use boost:signal, how do you do it?

(Okay, actually connectX should return a connection object and
disconnectX should take the it as its parameter, but it's about the
general idea)
You should ask this on the Boost User list
(http://boost.org/more/mailing_lists.htm#users) or on a group dedicated
to OO/program design (comp.object, etc.). This group deals with the
Standard C++ language and libraries and their planned extensions
(http://www.parashift.com/c++-faq-lit....html#faq-5.9).

Cheers! --M

Nov 14 '06 #2

P: n/a
mlimber wrote:
You should ask this on the Boost User list
(http://boost.org/more/mailing_lists.htm#users) or on a group dedicated
to OO/program design (comp.object, etc.). This group deals with the
Standard C++ language and libraries and their planned extensions
(http://www.parashift.com/c++-faq-lit....html#faq-5.9).
Ok, I'm sorry. When reading the faq I got the feeling that it also
covers OO design to some extent (as in: using the right language
constructs, which isn't far from what I asked) so I assumed I could ask
this. But your right, again sorry, I'm on my way to more appropriate places.

--
Memfis
Nov 14 '06 #3

P: n/a
Memfis wrote:
mlimber wrote:
You should ask this on the Boost User list
(http://boost.org/more/mailing_lists.htm#users) or on a group dedicated
to OO/program design (comp.object, etc.). This group deals with the
Standard C++ language and libraries and their planned extensions
(http://www.parashift.com/c++-faq-lit....html#faq-5.9).

Ok, I'm sorry. When reading the faq I got the feeling that it also
covers OO design to some extent (as in: using the right language
constructs, which isn't far from what I asked) so I assumed I could ask
this. But your right, again sorry, I'm on my way to more appropriate places.
There's plenty of gray area here, but this seemed outside of the
boundaries to me. If you can rephrase your question more in terms of
the language, we'd be happy to take a whack at it.

Cheers! --M

Nov 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.