AWS SDK for C++  1.8.95
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 
45  void ResetEventStreamHandler(EventStreamHandler* handler);
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_event_stream_streaming_decoder m_decoder
char const int length
Definition: cJSON.h:164
#define AWS_CORE_API
Definition: Core_EXPORTS.h:25