uvco 0.1
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
uvco::Coroutine< void > Class Reference

#include <promise.h>

Collaboration diagram for uvco::Coroutine< void >:
Collaboration graph
[legend]

Public Member Functions

 Coroutine ()
 
 Coroutine (Coroutine< void > &&other) noexcept=delete
 
Coroutineoperator= (const Coroutine< void > &other)=delete
 
Coroutineoperator= (Coroutine< void > &&other)=delete
 
 Coroutine (const Coroutine< void > &other)=delete
 
 ~Coroutine ()
 
Promise< void > get_return_object ()
 Part of the coroutine protocol.
 
std::suspend_never initial_suspend () noexcept
 
std::suspend_never final_suspend () noexcept
 
void return_void ()
 
void unhandled_exception ()
 

Private Types

using PromiseCore_ = PromiseCore<void>
 
using SharedCore_ = PromiseCore_ *
 

Private Attributes

SharedCore_ core_
 

Member Typedef Documentation

◆ PromiseCore_

using uvco::Coroutine< void >::PromiseCore_ = PromiseCore<void>
private

◆ SharedCore_

using uvco::Coroutine< void >::SharedCore_ = PromiseCore_ *
private

Constructor & Destructor Documentation

◆ Coroutine() [1/3]

uvco::Coroutine< void >::Coroutine ( )
inline
353: core_{makeRefCounted<PromiseCore_>()} {}
SharedCore_ core_
Definition promise.h:382

◆ Coroutine() [2/3]

uvco::Coroutine< void >::Coroutine ( Coroutine< void > &&  other)
deletenoexcept

◆ Coroutine() [3/3]

uvco::Coroutine< void >::Coroutine ( const Coroutine< void > &  other)
delete

◆ ~Coroutine()

uvco::Coroutine< void >::~Coroutine ( )
inline
359 {
360 if (core_ != nullptr) {
361 core_->delRef();
362 }
363 }
virtual void delRef()
Definition internal_utils.h:117

Member Function Documentation

◆ final_suspend()

std::suspend_never uvco::Coroutine< void >::final_suspend ( )
inlinenoexcept

Part of the coroutine protocol: nothing happens upon the final suspension point (after co_return).

372{ return {}; }

◆ get_return_object()

Promise< void > uvco::Coroutine< void >::get_return_object ( )
inline

Part of the coroutine protocol.

366{ return Promise<void>{core_}; }

◆ initial_suspend()

std::suspend_never uvco::Coroutine< void >::initial_suspend ( )
inlinenoexcept

Part of the coroutine protocol: uvco coroutines always run until the first suspension point.

369{ return {}; }

◆ operator=() [1/2]

Coroutine & uvco::Coroutine< void >::operator= ( const Coroutine< void > &  other)
delete

◆ operator=() [2/2]

Coroutine & uvco::Coroutine< void >::operator= ( Coroutine< void > &&  other)
delete

◆ return_void()

void uvco::Coroutine< void >::return_void ( )

Part of the coroutine protocol: resumes an awaiting coroutine, if there is one.

101 {
102 core_->ready_ = true;
103 core_->resume();
104}
void resume()
See PromiseCore::resume.
Definition promise_core.cc:32
bool ready_
Definition promise_core.h:226

◆ unhandled_exception()

void uvco::Coroutine< void >::unhandled_exception ( )

Part of the coroutine protocol: store exception in core and resume awaiting coroutine.

106 {
107 core_->except(std::current_exception());
108 core_->resume();
109}
void except(std::exception_ptr exc)
See PromiseCore::except.
Definition promise_core.cc:56

Member Data Documentation

◆ core_

SharedCore_ uvco::Coroutine< void >::core_
private

The documentation for this class was generated from the following files: