Best practises for boost:signal

M

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<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)
 
M

mlimber

Memfis said:
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-lite/how-to-post.html#faq-5.9).

Cheers! --M
 
M

Memfis

mlimber said:
> 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-lite/how-to-post.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.
 
M

mlimber

Memfis said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top