Event System in C++

Started by
2 comments, last by ApEk 11 years, 5 months ago
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!
Advertisement
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!

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. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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

This topic is closed to new replies.

Advertisement