B3n30 / tunnler

GNU General Public License v2.0
1 stars 0 forks source link

Callbacks #28

Open B3n30 opened 7 years ago

B3n30 commented 7 years ago

this implements Event handling in tunnler.

B3n30 commented 7 years ago

I refactored the callbacks for our tunnler. I looked in the boost::signal2 code and used that as a template for our signal handling.

I tested it and it works. So I'm happy with it now. It is thread safes, allows for multiple callbacks for one event type, and you only need to connect to it with std::bind().

A later commit will be to add all the Connect'EventType'(std::function<void()>) for every EventType which will internally just link to Connect(std::function<void()>, EventType) as @JayFoxRox suggested.

So all in all I would love if this goes from RFC to a full PR

JayFoxRox commented 7 years ago

I don't even know which commits to review, please squash and tell us which code to review or which code might be from other branches [do we still have to review? do we have to merge another PR first?]

B3n30 commented 7 years ago

Sorry the commits got a bit messy. I removed all the prior attempts for signals and only put the most recent design in this PR