Jump to content

  • Log In with Google      Sign In   
  • Create Account


Event System in C++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 kuda   Members   -  Reputation: 105

Like
0Likes
Like

Posted 09 November 2012 - 04:05 PM

Hi

I was wondering if anyone can recommend a good library that allows me to pass events from object to object. I am used to using the one in Objective C or as3 so I am not sure if there is something similar to that is c++ already available.

Thanks!

Sponsor:

#2 Radikalizm   Crossbones+   -  Reputation: 2793

Like
0Likes
Like

Posted 09 November 2012 - 04:18 PM

What will this event system be used for? I'm not familiar with either Objective-C or AS3 so I don't know which event systems they provide out of the box.

You might want to take a look at the Observer Pattern which is a robust and popular way of handling events. This pattern is used in Model-View-Controller systems, which are often used for user interfaces, but they are applicable in other fields as well.

I gets all your texture budgets!


#3 swiftcoder   Senior Moderators   -  Reputation: 9731

Like
1Likes
Like

Posted 09 November 2012 - 04:57 PM

I'd take a look at boost::signals - it's sort of the standard for signal/slots event setups in C++. There are a couple of other similar libraries if boost is too heavyweight for your tastes.

However, Objective-C has a messaging system that is very different from C++ function calls. You may have to describe in more detail what you are trying to achieve, and we can suggest other alternatives.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#4 ApEk   Members   -  Reputation: 439

Like
0Likes
Like

Posted 09 November 2012 - 06:53 PM

If you are looking for libraries that implement signals and slots you have many options. You have a whole range of options from heavy, feature rich boost::signals its thread safe sibling boost::signals2, libsigc++, sigslot, cpp-events, and ting. I've actually released an extremely lightweight implementation that uses c++11 called nano-signal-slot. It all boils down to what you estimate you will need. I would not recommend an old or dead implementation as maintainability could become an issue. I would suggest boost::signals2 as that is the thread safe version of boost::signals, and performance between the two is similar. http://www.boost.org/doc/libs/1_52_0/doc/html/signals2.html

Edited by ApEk, 09 November 2012 - 06:53 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS