COROIO: NNet::NDetail::TOperationState Struct Reference
COROIO
Loading...
Searching...
No Matches
NNet::NDetail::TOperationState Struct Reference

State of one operation of a completion-based poller (TUring, TIOCp). More...

#include <completions.hpp>

Inheritance diagram for NNet::NDetail::TOperationState:
NNet::TIOCp::TOperation

Public Member Functions

 TOperationState (const TOperationState &)=delete
TOperationState & operator= (const TOperationState &)=delete

Public Attributes

THandle Handle
 Coroutine to resume, set by the caller before posting. Cleared when posting fails, the completion is delivered or the operation is cancelled, so it is set while the operation is pending.
int Result = 0
 Result of the completion, e.g. the number of bytes transferred.
unsigned Index = 0
 Position of the completion in TCompletions once taken; before that, whatever the poller keeps there.

Detailed Description

State of one operation of a completion-based poller (TUring, TIOCp).

It lives in the operation's awaitable, inside the waiting coroutine's frame. The poller refers to it from posting until the completion is delivered or Cancel() returns, and the awaitable cancels the operation in its destructor, so it outlives every reference. Index lets Cancel() find it in O(1). The poller and the system keep its address, so it can be neither copied nor moved.


The documentation for this struct was generated from the following file: