MCPcopy Create free account
hub / github.com/SmingHub/Sming / callMemberFunction

Method callMemberFunction

samples/Basic_Delegates/app/application.cpp:65–71  ·  view source on GitHub ↗

This example shows how to use a member function as a callback

Source from the content-addressed store, hash-verified

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 {

Callers 1

initFunction · 0.80

Calls 1

startMethod · 0.45

Tested by

no test coverage detected