AWS SDK for C++  1.8.95
AWS SDK for C++
Public Member Functions | List of all members
Aws::Utils::Event::EventStreamHandler Class Referenceabstract

#include <EventStreamHandler.h>

+ Inheritance diagram for Aws::Utils::Event::EventStreamHandler:

Public Member Functions

 EventStreamHandler ()
 
virtual ~EventStreamHandler ()=default
 
 operator bool () const
 
void SetFailure ()
 
virtual void Reset ()
 
void SetInternalError (int errorCode=0)
 
EventStreamErrors GetInternalError ()
 
virtual bool IsMessageCompleted ()
 
virtual void SetMessageMetadata (size_t totalLength, size_t headersLength, size_t payloadLength)
 
virtual void WriteMessageEventPayload (const unsigned char *data, size_t dataLength)
 
virtual Aws::Vector< unsigned char > && GetEventPayloadWithOwnership ()
 
virtual Aws::String GetEventPayloadAsString ()
 
virtual void InsertMessageEventHeader (const String &eventHeaderName, size_t eventHeaderLength, const Aws::Utils::Event::EventHeaderValue &eventHeaderValue)
 
virtual const Aws::Utils::Event::EventHeaderValueCollectionGetEventHeaders ()
 
virtual void OnEvent ()=0
 

Detailed Description

Handler of event stream. Includes context and callback function while scanning the event stream.

Definition at line 28 of file EventStreamHandler.h.

Constructor & Destructor Documentation

◆ EventStreamHandler()

Aws::Utils::Event::EventStreamHandler::EventStreamHandler ( )
inline

Definition at line 31 of file EventStreamHandler.h.

◆ ~EventStreamHandler()

virtual Aws::Utils::Event::EventStreamHandler::~EventStreamHandler ( )
virtualdefault

Member Function Documentation

◆ GetEventHeaders()

virtual const Aws::Utils::Event::EventHeaderValueCollection& Aws::Utils::Event::EventStreamHandler::GetEventHeaders ( )
inlinevirtual

Definition at line 130 of file EventStreamHandler.h.

◆ GetEventPayloadAsString()

virtual Aws::String Aws::Utils::Event::EventStreamHandler::GetEventPayloadAsString ( )
inlinevirtual

Convert underlying byte array to string without transferring ownership.

Definition at line 119 of file EventStreamHandler.h.

◆ GetEventPayloadWithOwnership()

virtual Aws::Vector<unsigned char>&& Aws::Utils::Event::EventStreamHandler::GetEventPayloadWithOwnership ( )
inlinevirtual

Get underlying byte array of the message just received.

Definition at line 114 of file EventStreamHandler.h.

◆ GetInternalError()

EventStreamErrors Aws::Utils::Event::EventStreamHandler::GetInternalError ( )
inline

Get internal Event Stream Errors.

Definition at line 71 of file EventStreamHandler.h.

◆ InsertMessageEventHeader()

virtual void Aws::Utils::Event::EventStreamHandler::InsertMessageEventHeader ( const String eventHeaderName,
size_t  eventHeaderLength,
const Aws::Utils::Event::EventHeaderValue eventHeaderValue 
)
inlinevirtual

Insert event header to a underlying event header value map, and update headers bytes received.

Definition at line 124 of file EventStreamHandler.h.

◆ IsMessageCompleted()

virtual bool Aws::Utils::Event::EventStreamHandler::IsMessageCompleted ( )
inlinevirtual

The message is considered to completed with the following scenarios:

  1. Message doesn't have headers or payloads. Or
  2. Message has headers but doesn't have payloads. Or
  3. Message has both headers and payloads.

Definition at line 82 of file EventStreamHandler.h.

◆ OnEvent()

virtual void Aws::Utils::Event::EventStreamHandler::OnEvent ( )
pure virtual

◆ operator bool()

Aws::Utils::Event::EventStreamHandler::operator bool ( ) const
inline

Whether or not flow handler is in a good state. Return false if handler encounters errors.

Definition at line 40 of file EventStreamHandler.h.

◆ Reset()

virtual void Aws::Utils::Event::EventStreamHandler::Reset ( )
inlinevirtual

Clean up current bytes of data received, as well as the latest message.

Definition at line 50 of file EventStreamHandler.h.

◆ SetFailure()

void Aws::Utils::Event::EventStreamHandler::SetFailure ( )
inline

Fail the handler from outside.

Definition at line 45 of file EventStreamHandler.h.

◆ SetInternalError()

void Aws::Utils::Event::EventStreamHandler::SetInternalError ( int  errorCode = 0)
inline

Set internal Event Stream Errors, which is associated with errors in aws-c-event-stream library.

Definition at line 63 of file EventStreamHandler.h.

◆ SetMessageMetadata()

virtual void Aws::Utils::Event::EventStreamHandler::SetMessageMetadata ( size_t  totalLength,
size_t  headersLength,
size_t  payloadLength 
)
inlinevirtual

Set message metadata, including total message length, headers length and payload length.

Definition at line 90 of file EventStreamHandler.h.

◆ WriteMessageEventPayload()

virtual void Aws::Utils::Event::EventStreamHandler::WriteMessageEventPayload ( const unsigned char *  data,
size_t  dataLength 
)
inlinevirtual

Write data to underlying stream, and update payload bytes received.

Definition at line 105 of file EventStreamHandler.h.


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