MCPcopy Create free account
hub / github.com/cameron314/readerwriterqueue / CallbackWrapper

Class CallbackWrapper

tests/common/simplethread.h:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59 template<typename TCallback, typename TArgs>
60 struct CallbackWrapper
61 {
62 template<typename U>
63 CallbackWrapper(TCallback&& callback, U&& args)
64 : callback(std::forward<TCallback>(callback)), args(std::forward<U>(args))
65 {
66 }
67
68 static void callAndDelete(void* wrapper)
69 {
70 auto typedWrapper = static_cast<CallbackWrapper*>(wrapper);
71 typedWrapper->args.callCallback(std::move(typedWrapper->callback));
72 delete typedWrapper;
73 }
74
75 typename std::decay<TCallback>::type callback;
76 TArgs args;
77 };
78
79 typedef void (*CallbackFunc)(void*);
80

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected