471,066 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Best practises 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<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
3 2523
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
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
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.

Similar topics

1 post views Thread by James Mastro | last post: by
4 posts views Thread by Steven T. Hatton | last post: by
2 posts views Thread by lpw | last post: by
reply views Thread by Arnaud Debaene | last post: by
3 posts views Thread by Matthias Kaeppler | last post: by
9 posts views Thread by atomik.fungus | last post: by
7 posts views Thread by myfavdepo | last post: by
3 posts views Thread by Chris Jones | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.