This example shows how to use a member function as a callback
| 63 | |
| 64 | // This example shows how to use a member function as a callback |
| 65 | void callMemberFunction() |
| 66 | { |
| 67 | // A non-static member function must be called with an object. |
| 68 | // That is, it always implicitly passes "this" pointer as its argument. |
| 69 | auto b = TimerDelegate(&Task::callbackMemberFunction, this); |
| 70 | taskTimer.initializeMs(taskInterval, b).start(); |
| 71 | } |
| 72 | |
| 73 | void callbackMemberFunction() |
| 74 | { |