AWS SDK for C++  1.9.68
AWS SDK for C++
EventStreamDecoder.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 #include <aws/core/utils/Array.h>
11 #include <aws/event-stream/event_stream.h>
12 
13 namespace Aws
14 {
15  namespace Utils
16  {
17  namespace Event
18  {
20  {
21  public:
24 
28  inline explicit operator bool() const { return *m_eventStreamHandler; }
29 
34  void Pump(const ByteBuffer& data);
35  void Pump(const ByteBuffer& data, size_t length);
36 
40  void Reset();
41 
46 
47  protected:
55  static void onPayloadSegment(
56  aws_event_stream_streaming_decoder* decoder,
57  aws_byte_buf* payload,
58  int8_t isFinalSegment,
59  void* context);
60 
67  static void onPreludeReceived(
68  aws_event_stream_streaming_decoder* decoder,
69  aws_event_stream_message_prelude* prelude,
70  void* context);
71 
79  static void onHeaderReceived(
80  aws_event_stream_streaming_decoder* decoder,
81  aws_event_stream_message_prelude* prelude,
82  aws_event_stream_header_value_pair* header,
83  void* context);
84 
93  static void onError(
94  aws_event_stream_streaming_decoder* decoder,
95  aws_event_stream_message_prelude* prelude,
96  int errorCode,
97  const char* message,
98  void* context);
99 
104  aws_event_stream_streaming_decoder m_decoder;
106  };
107  }
108  }
109 }
AWS_CORE_API
#define AWS_CORE_API
Definition: Core_EXPORTS.h:25
Aws::IoTWireless::Model::Event
Event
Definition: Event.h:17
Aws::Utils::Event::EventStreamDecoder::Pump
void Pump(const ByteBuffer &data)
Aws::Utils::Event::EventStreamDecoder::onHeaderReceived
static void onHeaderReceived(aws_event_stream_streaming_decoder *decoder, aws_event_stream_message_prelude *prelude, aws_event_stream_header_value_pair *header, void *context)
Aws::Utils::Event::EventStreamDecoder::ResetEventStreamHandler
void ResetEventStreamHandler(EventStreamHandler *handler)
Aws::Utils::Event::EventStreamDecoder::Reset
void Reset()
Aws::Utils::Event::EventStreamDecoder::onError
static void onError(aws_event_stream_streaming_decoder *decoder, aws_event_stream_message_prelude *prelude, int errorCode, const char *message, void *context)
Aws::Utils::Event::EventStreamDecoder::onPreludeReceived
static void onPreludeReceived(aws_event_stream_streaming_decoder *decoder, aws_event_stream_message_prelude *prelude, void *context)
Aws::Utils::Event::EventStreamDecoder::~EventStreamDecoder
~EventStreamDecoder()
Aws::Utils::Event::EventStreamDecoder::EventStreamDecoder
EventStreamDecoder(EventStreamHandler *handler)
Aws::Utils::Event::EventStreamHandler
Definition: EventStreamHandler.h:29
Aws::Utils::Array< unsigned char >
Aws::Utils::Event::EventStreamDecoder::Pump
void Pump(const ByteBuffer &data, size_t length)
Core_EXPORTS.h
Aws::Utils::Event::EventStreamDecoder
Definition: EventStreamDecoder.h:20
Aws::Utils::Event::EventStreamDecoder::onPayloadSegment
static void onPayloadSegment(aws_event_stream_streaming_decoder *decoder, aws_byte_buf *payload, int8_t isFinalSegment, void *context)
Aws
Definition: AccessManagementClient.h:15
length
char const int length
Definition: cJSON.h:174
Array.h
EventStreamHandler.h
Aws::Utils::Event::EventStreamDecoder::m_decoder
aws_event_stream_streaming_decoder m_decoder
Definition: EventStreamDecoder.h:104
Aws::Utils::Event::EventStreamDecoder::m_eventStreamHandler
EventStreamHandler * m_eventStreamHandler
Definition: EventStreamDecoder.h:105