Hello. Can somebody please show me example how I can do this ? Basically I am talking about callback functions.
Let's say Class A is moving some object. Class B needs to know when the moving is finished. I need to pass some method from class B to A. And that method will be called when Class A finish the movement.
Thanks for answer.
asked Mar 06 '15 at 04:29 PM in C++ Programming
There is a delegate macro for that.
Than in the class you want to hold that reference you add :
To add/remove listeners:
To call that delegate:
There is other macros to declare delegates with parameters, here is an example:
Hope this helps!
It works only if everything is in class A.
CLASS B .h
CLASS B .cpp
CLASS A .h
CLASS A .cpp
So In this case __onSetLocation.IsBound() Returns always 0. So __onSetLocation.Broadcast(); Do nothing :( As I said everything works only if everything is in one class.
Thanks for answer
answered Mar 07 '15 at 08:25 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here