9#include <aws/io/channel.h>
106 bool freeScarceResourcesImmediately) = 0;
132 struct aws_channel_handler *SeatForCInterop(
const std::shared_ptr<ChannelHandler> &selfRef);
137 bool ChannelsThreadIsCallersThread()
const;
144 void ShutDownChannel(
int errorCode);
150 void ScheduleTask(std::function<
void(
TaskStatus)> &&task);
157 void ScheduleTask(std::function<
void(
TaskStatus)> &&task, std::chrono::nanoseconds run_in);
165 struct aws_io_message *AcquireMessageFromPool(
MessageType messageType,
size_t sizeHint);
172 struct aws_io_message *AcquireMaxSizeMessageForWrite();
179 bool SendMessage(
struct aws_io_message *message,
ChannelDirection direction);
185 bool IncrementUpstreamReadWindow(
size_t windowUpdateSize);
191 void OnShutdownComplete(
ChannelDirection direction,
int errorCode,
bool freeScarceResourcesImmediately);
198 size_t DownstreamReadWindow()
const;
204 size_t UpstreamMessageOverhead()
const;
206 struct aws_channel_slot *GetSlot()
const;
208 struct aws_channel_handler m_handler;
212 std::shared_ptr<ChannelHandler> m_selfReference;
213 static struct aws_channel_handler_vtable s_vtable;
215 static void s_Destroy(
struct aws_channel_handler *handler);
216 static int s_ProcessReadMessage(
217 struct aws_channel_handler *,
218 struct aws_channel_slot *,
219 struct aws_io_message *);
220 static int s_ProcessWriteMessage(
221 struct aws_channel_handler *,
222 struct aws_channel_slot *,
223 struct aws_io_message *);
224 static int s_IncrementReadWindow(
struct aws_channel_handler *,
struct aws_channel_slot *,
size_t size);
225 static int s_ProcessShutdown(
226 struct aws_channel_handler *,
227 struct aws_channel_slot *,
228 enum aws_channel_direction,
230 bool freeScarceResourcesImmediately);
231 static size_t s_InitialWindowSize(
struct aws_channel_handler *);
232 static size_t s_MessageOverhead(
struct aws_channel_handler *);
233 static void s_ResetStatistics(
struct aws_channel_handler *);
234 static void s_GatherStatistics(
struct aws_channel_handler *,
struct aws_array_list *statsList);
#define AWS_CRT_CPP_API
Definition: Exports.h:37
Definition: ChannelHandler.h:47
virtual void ProcessShutdown(ChannelDirection dir, int errorCode, bool freeScarceResourcesImmediately)=0
virtual int ProcessWriteMessage(struct aws_io_message *message)=0
virtual size_t MessageOverhead()=0
virtual void GatherStatistics(struct aws_array_list *)
Definition: ChannelHandler.h:128
ChannelHandler(const ChannelHandler &)=delete
virtual int ProcessReadMessage(struct aws_io_message *message)=0
virtual void ResetStatistics()
Definition: ChannelHandler.h:122
Allocator * m_allocator
Definition: ChannelHandler.h:209
virtual int IncrementReadWindow(size_t size)=0
virtual ~ChannelHandler()=default
ChannelHandler & operator=(const ChannelHandler &)=delete
virtual size_t InitialWindowSize()=0
ChannelDirection
Definition: ChannelHandler.h:24
MessageType
Definition: ChannelHandler.h:30
TaskStatus
Definition: ChannelHandler.h:35
aws_allocator Allocator
Definition: StlAllocator.h:17
AWS_CRT_CPP_API Allocator * g_allocator
Definition: Api.cpp:23