diff --git a/server/robotserver/coroutine.cc b/server/robotserver/coroutine.cc index 9b048f6c..dd072ae6 100644 --- a/server/robotserver/coroutine.cc +++ b/server/robotserver/coroutine.cc @@ -10,6 +10,11 @@ void Awaiter::Await(std::shared_ptr parent) } +void Promise::Await(std::shared_ptr parent) +{ + +} + Coroutine::Coroutine(std::function cb) { INIT_LIST_HEAD(&co_entry_); @@ -101,3 +106,8 @@ void Coroutine::CallExit(boost::coroutines2::coroutine::push_type& sink) { sink_ = nullptr; } + +void Coroutine::Await(std::shared_ptr parent) +{ + +} diff --git a/server/robotserver/coroutine.h b/server/robotserver/coroutine.h index f40e9ee9..9f6ac2d9 100644 --- a/server/robotserver/coroutine.h +++ b/server/robotserver/coroutine.h @@ -37,7 +37,6 @@ protected: virtual void Await(std::shared_ptr parent); private: - std::shared_ptr parent_; bool done_ = false; std::shared_ptr results_; std::function cb_; @@ -46,7 +45,12 @@ protected: class Promise : public Awaiter { +protected: + virtual void Await(std::shared_ptr parent) override; + + private: + std::shared_ptr parent_; }; class Coroutine : public Awaiter @@ -67,6 +71,7 @@ class Coroutine : public Awaiter void Deatch(); void CallEnter(boost::coroutines2::coroutine::push_type& sink); void CallExit(boost::coroutines2::coroutine::push_type& sink); + virtual void Await(std::shared_ptr parent) override; private: list_head co_entry_;