Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::HttpIncomingMessage::BodyStream Struct Reference
Inheritance diagram for SC::HttpIncomingMessage::BodyStream:
SC::AsyncReadableStream

Public Member Functions

Result begin (AsyncBuffersPool &buffersPool, Function< Result()> &&onReadRequest)
 
bool pushBodyData (AsyncBufferView::ID bufferID, size_t sizeInBytes)
 
void finishBody ()
 
void failBody (Result result)
 
- Public Member Functions inherited from SC::AsyncReadableStream
Result init (AsyncBuffersPool &buffersPool)
 Emitted when the underlying resource has been closed.
 
Result start ()
 Starts the readable stream, that will emit eventData.
 
void pause ()
 Pauses the readable stream (that can be later resumed)
 
void resumeReading ()
 Resumes the readable stream paused by AsyncReadableStream::pause.
 
void destroy ()
 Forcefully destroys the readable stream before calling end event releasing all resources.
 
bool isEnded () const
 Returns true if the stream is ended (AsyncReadableStream::end has been called)
 
bool hasBeenDestroyed () const
 Returns true if the stream has been already destroyed (asynchronously through destroy())
 
bool canStart () const
 Returns true when start() is currently valid for this stream.
 
AsyncBuffersPoolgetBuffersPool ()
 Obtains the AsyncBuffersPool to request more buffers.
 
constexpr void setReadQueue (Span< Request > requests)
 Sets the read queue for this readable stream.
 
size_t getReadQueueSize () const
 Returns the size of read queue.
 
bool push (AsyncBufferView::ID bufferID, size_t newSize)
 Use push from inside AsyncReadableStream::asyncRead function to queue received data.
 
Result unshift (AsyncBufferView::ID bufferID)
 Push back a buffer to the front of the read queue (e.g. for un-consumed data)
 
void pushEnd ()
 Use pushEnd from inside AsyncReadableStream::asyncRead to signal production end.
 
void reactivate (bool doReactivate)
 Use reactivate(true) from inside AsyncReadableStream::asyncRead function to ask the state machine to invoke asyncRead again.
 
void emitError (Result error)
 Signals an async error received.
 
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.
 
void setAutoDestroy (bool value)
 If set to true will automatically call .destroy() when Ended state is reached.
 
bool getAutoDestroy () const
 Returns true if stream will automatically call .destroy() when Ended state is reached.
 

Public Attributes

Function< Result()> onReadRequest
 
Request queue [4]
 
- Public Attributes inherited from SC::AsyncReadableStream
Event< MaxListeners, ResulteventError
 
Event< MaxListeners, AsyncBufferView::IDeventData
 Emitted when an error occurs.
 
Event< MaxListeners > eventEnd
 Emitted when a new buffer has been read.
 
Event< MaxListeners > eventClose
 Emitted when there is no more data.
 

Additional Inherited Members

- Public Types inherited from SC::AsyncReadableStream
using BufferViewID = AsyncBufferView::ID
 
using BuffersPool = AsyncBuffersPool
 
- Static Public Attributes inherited from SC::AsyncReadableStream
static constexpr int MaxListeners = 8
 
- Protected Member Functions inherited from SC::AsyncReadableStream
virtual Result asyncDestroyReadable ()
 Function that a readable stream can re-implement to release its internal resources.
 
Result finishedDestroyingReadable ()
 Called from inside asyncDestroy to transition from Destroying to Destroyed state (emitting eventClose)
 

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