Ask Your Question

Add personal parameters at topic-subscriber callback

asked 2013-06-10 04:11:54 -0500

mateo_7_7 gravatar image

updated 2014-04-20 14:09:28 -0500

ngrennan gravatar image

Is it possible to add a personal parameter (or more than 1) at the normal subscribe function? ..(for example passing an integer that i'd like to use in the callback) how?

edit retag flag offensive close merge delete


Whats the use-case for that?

Ben_S gravatar image Ben_S  ( 2013-06-10 04:17:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-10 04:27:24 -0500

Philip gravatar image

Hi, please see this answer for almost exactly the same use-case :-)

edit flag offensive delete link more


thanks!!! this is exactly what i need!.....but,sincerely it's not completely clear: a small explanation would be really appreciated :)

mateo_7_7 gravatar image mateo_7_7  ( 2013-06-10 05:02:47 -0500 )edit

Glad to help! .....but,sincerely your comment is not completely clear: a small explanation of what you don't understand would be really appreciated ;-) Just have a look at boost::bind and tell us what is not clear.

Philip gravatar image Philip  ( 2013-06-10 05:13:35 -0500 )edit

i'm not a computer scientist and so not an expert of programming stuff: i read the documentation but is not clear (at least for me). i'd like to understand what this function does and how i can use it for my purposes

mateo_7_7 gravatar image mateo_7_7  ( 2013-06-10 05:59:58 -0500 )edit

(i have to declare n subscriber (with a for cycle for instance) that writes the data in a vector (of size n) i have to pass an integer to the same callback to increment the position in the vector

mateo_7_7 gravatar image mateo_7_7  ( 2013-06-10 06:03:03 -0500 )edit

my problem is explained better here:

mateo_7_7 gravatar image mateo_7_7  ( 2013-06-10 22:16:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-06-10 04:11:54 -0500

Seen: 6,759 times

Last updated: Jun 10 '13