473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 2647
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Mastro | last post by:
This one has been driving me nuts all day. In a function I have the following: std::list< boost::shared_ptr<MyObject> > * objectList; When debugging my code, the debugger (gdb) dies upon...
4
by: Steven T. Hatton | last post by:
I'm trying to create an baseclass that will serve as a parent for reference counted objects handled by boost::intrusive_ptr<>. The documentation didn't provide much in the way of describing what...
2
by: lpw | last post by:
I have dilligently reviewed FAQ-lite Section 3.2, "How do I pass a pointer-to-member-function to a signal handler, X event callback, system call that starts a thread/task, etc." The only...
0
by: Arnaud Debaene | last post by:
Hello all. I've got a bunch of existing, non managed, C++ DLLs that export types with, among other things, public events implemented using the boost::signals library. Now, I need to have...
0
by: Arnaud Debaene | last post by:
Could someone explain why the following code works when compiled without /clr but fails at runtime with a boost::bad_function_call exception when compiled with /clr? #include <iostream> using...
3
by: Matthias Kaeppler | last post by:
Hi, it might be a stupid question, but i'll take the chance and ask: void connect() { std::string str; // ...
9
by: atomik.fungus | last post by:
g++ wont let me compile boost signals, not even the example that comes in the documentation. I have the libboost_signals.a binary but im not sure if im using it correctly. Here is the code ...
7
by: myfavdepo | last post by:
Hi all, I have a query regarding the exchanging of a boost::shared_ptr beween different threads. In my program i've two threads both of which having their own internal queues for storing the...
3
by: Chris Jones | last post by:
Hi, I've experimenting with using boost::pool_allocator with std::vector and gcc (4.1)., and I am having problems with segmentation violations. Below I give a simple example of one way I am...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.