Loading system/gd/module.h +2 −3 Original line number Diff line number Diff line Loading @@ -102,13 +102,12 @@ class Module { template <typename Functor, typename... Args> void Call(Functor&& functor, Args&&... args) { GetHandler()->Post(common::BindOnce(std::forward<Functor>(functor), std::forward<Args>(args)...)); GetHandler()->Call(std::forward<Functor>(functor), std::forward<Args>(args)...); } template <typename T, typename Functor, typename... Args> void CallOn(T* obj, Functor&& functor, Args&&... args) { GetHandler()->Post( common::BindOnce(std::forward<Functor>(functor), common::Unretained(obj), std::forward<Args>(args)...)); GetHandler()->CallOn(obj, std::forward<Functor>(functor), std::forward<Args>(args)...); } private: Loading system/gd/os/handler.h +10 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,16 @@ class Handler : public common::IPostableContext { // Die if the current reactable doesn't stop before the timeout. Must be called after Clear() void WaitUntilStopped(std::chrono::milliseconds timeout); template <typename Functor, typename... Args> void Call(Functor&& functor, Args&&... args) { Post(common::BindOnce(std::forward<Functor>(functor), std::forward<Args>(args)...)); } template <typename T, typename Functor, typename... Args> void CallOn(T* obj, Functor&& functor, Args&&... args) { Post(common::BindOnce(std::forward<Functor>(functor), common::Unretained(obj), std::forward<Args>(args)...)); } template <typename Functor, typename... Args> common::ContextualOnceCallback<common::MakeUnboundRunType<Functor, Args...>> BindOnce( Functor&& functor, Args&&... args) { Loading Loading
system/gd/module.h +2 −3 Original line number Diff line number Diff line Loading @@ -102,13 +102,12 @@ class Module { template <typename Functor, typename... Args> void Call(Functor&& functor, Args&&... args) { GetHandler()->Post(common::BindOnce(std::forward<Functor>(functor), std::forward<Args>(args)...)); GetHandler()->Call(std::forward<Functor>(functor), std::forward<Args>(args)...); } template <typename T, typename Functor, typename... Args> void CallOn(T* obj, Functor&& functor, Args&&... args) { GetHandler()->Post( common::BindOnce(std::forward<Functor>(functor), common::Unretained(obj), std::forward<Args>(args)...)); GetHandler()->CallOn(obj, std::forward<Functor>(functor), std::forward<Args>(args)...); } private: Loading
system/gd/os/handler.h +10 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,16 @@ class Handler : public common::IPostableContext { // Die if the current reactable doesn't stop before the timeout. Must be called after Clear() void WaitUntilStopped(std::chrono::milliseconds timeout); template <typename Functor, typename... Args> void Call(Functor&& functor, Args&&... args) { Post(common::BindOnce(std::forward<Functor>(functor), std::forward<Args>(args)...)); } template <typename T, typename Functor, typename... Args> void CallOn(T* obj, Functor&& functor, Args&&... args) { Post(common::BindOnce(std::forward<Functor>(functor), common::Unretained(obj), std::forward<Args>(args)...)); } template <typename Functor, typename... Args> common::ContextualOnceCallback<common::MakeUnboundRunType<Functor, Args...>> BindOnce( Functor&& functor, Args&&... args) { Loading