Class template coroutineN
hamigaki::coroutines::coroutineN —
Synopsis
template<typename R, typename T1, typename T2, ..., typename TN>
class coroutineN {
public:
// types
typedef selfN<R, T1, T2, ..., TN> self;
// construct/copy/destruct
coroutineN();
coroutineN(coroutineN&);
template<typename Functor> coroutineN(const Functor&, std::ptrdiff_t = -1);
// queries
bool exited() const;
bool empty() const;
// modifiers
void exit();
// invocations
R operator()(T1, T2, ..., TN);
boost::optional<R> operator()(std::nothrow_t, T1, T2, ..., TN);
};
Description
coroutineN
construct/copy/destruct
-
coroutineN();
Effects: |
ファンクタを保持していない空のコルーチンを生成する。 |
Postconditions: |
empty()
|
-
coroutineN(coroutineN& x);
Effects: |
x の保持するコルーチンの所有権を引き取る。 |
Postconditions: |
x.empty()
|
-
template<typename Functor>
coroutineN(const Functor& f, std::ptrdiff_t stack_size = -1);
Effects: |
スタックサイズがstack_size のコルーチンを生成する。ファンクタf のコピーがコルーチンのエントリポイントに設定される。 |
Postconditions: |
!empty()
|
coroutineN
queries
-
bool exited() const;
Returns: |
コルーチンの保持するファンクタが終了していれば、true |
-
bool empty() const;
Returns: |
コルーチンがコンテキストを保持していない場合、true |
coroutineN
modifiers
-
void exit();
Effects: |
コルーチンの実行を中断し、終了させる。 |
Postconditions: |
exited()
|
coroutineN
invocations
-
R operator()(T1 a1, T2 a2, ..., TN aN);
-
boost::optional<R> operator()(std::nothrow_t, T1 a1, T2 a2, ..., TN aN);