From: Hoa Nguyen Date: Thu, 20 Aug 2020 20:31:49 +0000 (-0700) Subject: base: Tag API methods in coroutine.hh X-Git-Tag: v20.1.0.0~103 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f484d17031e75ca92d9d6b10b80c63f68f5606d7;p=gem5.git base: Tag API methods in coroutine.hh Change-Id: Ifd0aade13b0979d8f8433577be7f019d83406e6a Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32963 Maintainer: Bobby R. Bruce Maintainer: Giacomo Travaglini Tested-by: kokoro Reviewed-by: Giacomo Travaglini --- diff --git a/src/base/coroutine.hh b/src/base/coroutine.hh index 4ac1a65e3..b4c347488 100644 --- a/src/base/coroutine.hh +++ b/src/base/coroutine.hh @@ -93,6 +93,8 @@ class Coroutine : public Fiber * * This method is generated only if the coroutine returns * a value (Ret != void) + * + * @ingroup api_coroutine */ template CallerType& @@ -109,6 +111,8 @@ class Coroutine : public Fiber * * This method is generated only if the coroutine doesn't * return a value (Ret = void) + * + * @ingroup api_coroutine */ template typename std::enable_if::value, @@ -128,6 +132,8 @@ class Coroutine : public Fiber * from the caller. * * @return arg coroutine argument + * + * @ingroup api_coroutine */ template typename std::enable_if::value, T>::type @@ -149,9 +155,14 @@ class Coroutine : public Fiber RetChannel retChannel; }; + /** + * @ingroup api_coroutine + * @{ + */ Coroutine() = delete; Coroutine(const Coroutine& rhs) = delete; Coroutine& operator=(const Coroutine& rhs) = delete; + /** @} */ // end of api_coroutine /** * Coroutine constructor. @@ -167,6 +178,8 @@ class Coroutine : public Fiber * @param f task run by the coroutine * @param run_coroutine set to false to disable running the coroutine * immediately after it is created + * + * @ingroup api_coroutine */ Coroutine(std::function f, bool run_coroutine = true) : Fiber(), task(f), caller(*this) @@ -176,6 +189,9 @@ class Coroutine : public Fiber this->call(); } + /** + * @ingroup api_coroutine + */ virtual ~Coroutine() {} public: @@ -187,6 +203,8 @@ class Coroutine : public Fiber * * This method is generated only if the coroutine takes * arguments (Arg != void) + * + * @ingroup api_coroutine */ template Coroutine& @@ -203,6 +221,8 @@ class Coroutine : public Fiber * * This method is generated only if the coroutine takes * no arguments. (Arg = void) + * + * @ingroup api_coroutine */ template typename std::enable_if::value, Coroutine>::type& @@ -221,6 +241,8 @@ class Coroutine : public Fiber * from the coroutine. * * @return ret yielded value + * + * @ingroup api_coroutine */ template typename std::enable_if::value, T>::type @@ -236,7 +258,11 @@ class Coroutine : public Fiber return ret; } - /** Check if coroutine is still running */ + /** + * Check if coroutine is still running + * + * @ingroup api_coroutine + */ operator bool() const { return !this->finished(); } private: