AwaiterBase Class Referenceabstract

#include <Pt/Coroutine.h>

Defines the cancellation interface for a pending awaitable. More...

Inherited by Awaiter, Generator< T >, Generator< T >::NextAwaiter, and Task< T >.

Public Member Functions

virtual void cancel ()=0
 Cancels the pending operation.
 

Protected Member Functions

 AwaiterBase ()=default
 Constructor.
 
 AwaiterBase (const AwaiterBase &)=delete
 No copy constructor.
 
AwaiterBaseoperator= (const AwaiterBase &)=delete
 No copy assignment.
 
virtual ~AwaiterBase ()=default
 Destructor.
 

Detailed Description

Task, Awaiter and Generator derive from this class so a single AwaiterBase::cancel() can abort whichever operation is in flight. Application code uses those derived types rather than AwaiterBase directly.