Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::AsyncRequestReadableStream< AsyncRequestType > Struct Template Reference
Inheritance diagram for SC::AsyncRequestReadableStream< AsyncRequestType >:
SC::AsyncReadableStream

Public Member Functions

template<typename DescriptorType >
Result init (AsyncBuffersPool &buffersPool, Span< Request > requests, AsyncEventLoop &loop, const DescriptorType &descriptor)
 
Result registerAutoCloseDescriptor (bool value)
 Registers or unregisters a listener to AsyncReadableStream::eventEnd to close descriptor. More...
 
- Public Member Functions inherited from SC::AsyncReadableStream
Result init (AsyncBuffersPool &buffersPool, Span< Request > requests)
 Emitted when the underlying resource has been closed. More...
 
Result start ()
 Starts the readable stream, that will emit eventData. More...
 
void pause ()
 Pauses the readable stream (that can be later resumed) More...
 
void resumeReading ()
 Resumes the readable stream paused by AsyncReadableStream::pause. More...
 
void destroy ()
 Forcefully destroys the readable stream before it's end event releasing all resources. More...
 
bool isEnded () const
 Returns true if the stream is ended (AsyncReadableStream::end has been called) More...
 
AsyncBuffersPoolgetBuffersPool ()
 Obtains the AsyncBuffersPool to request more buffers. More...
 
void push (AsyncBufferView::ID bufferID, size_t newSize)
 Use push from inside AsyncReadableStream::asyncRead function to queue received data. More...
 
void pushEnd ()
 Use pushEnd from inside AsyncReadableStream::asyncRead to signal production end. More...
 
void reactivate (bool doReactivate)
 Use reactivate(true) from inside AsyncReadableStream::asyncRead function to ask the state machine to invoke asyncRead again. More...
 
void emitError (Result error)
 Signals an async error received. More...
 
bool getBufferOrPause (size_t minumumSizeInBytes, AsyncBufferView::ID &bufferID, Span< char > &data)
 Returns an unused buffer from pool or pauses the stream if none is available. More...
 

Public Attributes

AsyncRequestType request
 
- Public Attributes inherited from SC::AsyncReadableStream
Function< Result()> asyncRead
 Function that every stream must define to implement its custom read operation. More...
 
Event< MaxListeners, ResulteventError
 
Event< MaxListeners, AsyncBufferView::IDeventData
 Emitted when an error occurs. More...
 
Event< MaxListeners > eventEnd
 Emitted when a new buffer has been read. More...
 
Event< MaxListeners > eventClose
 Emitted when there is no more data. More...
 

Protected Member Functions

Result read ()
 
void afterRead (typename AsyncRequestType::Result &result, AsyncBufferView::ID bufferID)
 
void onEndCloseDescriptor ()
 

Additional Inherited Members

- Static Public Attributes inherited from SC::AsyncReadableStream
static constexpr int MaxListeners = 8
 

Member Function Documentation

◆ registerAutoCloseDescriptor()

template<typename AsyncRequestType >
Result SC::AsyncRequestReadableStream< AsyncRequestType >::registerAutoCloseDescriptor ( bool  value)

Registers or unregisters a listener to AsyncReadableStream::eventEnd to close descriptor.


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