Usethisclasslikethis: aInstanceOfAsynchronousCall.Post( ::std::bind( ::std::mem_fun(&DrawViewShell::SwitchPage), pDrawViewShell, 11));
*/ class AsynchronousCall
{ public: /** Create a new asynchronous call. Each object of this class processes one(semantical)typeofcall.
*/
AsynchronousCall();
~AsynchronousCall();
/** Post a function object that is to be executed asynchronously. When thismethodiscalledwhilethecurrentfunctionobjecthasnotbeen executedthenthelatterisdestroyedandonlythegivenfunction objectwillbeexecuted. @paramrFunction Thefunctionobjectthatmaybecalledasynchronouslyinthe nearfuture.
*/ typedef ::std::function<void()> AsynchronousFunction; void Post(const AsynchronousFunction& rFunction);
private:
Timer maTimer; /** The function object that will be executed when the TimerCallback functioniscalledthenexttime.ThispointermaybeNULL.
*/
::std::unique_ptr<AsynchronousFunction> mpFunction;
DECL_LINK(TimerCallback, Timer*, void);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.