10 #include <aws/io/channel.h>
15 struct aws_array_list;
16 struct aws_io_message;
63 virtual int ProcessReadMessage(
struct aws_io_message *message) = 0;
74 virtual int ProcessWriteMessage(
struct aws_io_message *message) = 0;
84 virtual int IncrementReadWindow(
size_t size) = 0;
98 virtual void ProcessShutdown(
101 bool freeScarceResourcesImmediately) = 0;
106 virtual size_t InitialWindowSize() = 0;
112 virtual size_t MessageOverhead() = 0;
127 struct aws_channel_handler *SeatForCInterop(
const std::shared_ptr<ChannelHandler> &selfRef);
132 bool ChannelsThreadIsCallersThread()
const;
139 void ShutDownChannel(
int errorCode);
145 void ScheduleTask(std::function<
void(
TaskStatus)> &&task);
152 void ScheduleTask(std::function<
void(
TaskStatus)> &&task, std::chrono::nanoseconds run_in);
160 struct aws_io_message *AcquireMessageFromPool(
MessageType messageType,
size_t sizeHint);
167 struct aws_io_message *AcquireMaxSizeMessageForWrite();
174 bool SendMessage(
struct aws_io_message *message,
ChannelDirection direction);
180 bool IncrementUpstreamReadWindow(
size_t windowUpdateSize);
186 void OnShutdownComplete(
ChannelDirection direction,
int errorCode,
bool freeScarceResourcesImmediately);
193 size_t DownstreamReadWindow()
const;
199 size_t UpstreamMessageOverhead()
const;
201 struct aws_channel_slot *GetSlot()
const;
203 struct aws_channel_handler m_handler;
207 std::shared_ptr<ChannelHandler> m_selfReference;
208 static struct aws_channel_handler_vtable s_vtable;
210 static void s_Destroy(
struct aws_channel_handler *handler);
211 static int s_ProcessReadMessage(
212 struct aws_channel_handler *,
213 struct aws_channel_slot *,
214 struct aws_io_message *);
215 static int s_ProcessWriteMessage(
216 struct aws_channel_handler *,
217 struct aws_channel_slot *,
218 struct aws_io_message *);
219 static int s_IncrementReadWindow(
struct aws_channel_handler *,
struct aws_channel_slot *,
size_t size);
220 static int s_ProcessShutdown(
221 struct aws_channel_handler *,
222 struct aws_channel_slot *,
223 enum aws_channel_direction,
225 bool freeScarceResourcesImmediately);
226 static size_t s_InitialWindowSize(
struct aws_channel_handler *);
227 static size_t s_MessageOverhead(
struct aws_channel_handler *);
228 static void s_ResetStatistics(
struct aws_channel_handler *);
229 static void s_GatherStatistics(
struct aws_channel_handler *,
struct aws_array_list *statsList);
Definition: ChannelHandler.h:41
#define AWS_CRT_CPP_API
Definition: Exports.h:36
ChannelDirection
Definition: ChannelHandler.h:24
aws_allocator Allocator
Definition: Allocator.h:14
Allocator * m_allocator
Definition: ChannelHandler.h:204
MessageType
Definition: ChannelHandler.h:30
TaskStatus
Definition: EventLoopGroup.h:24
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition: Allocator.cpp:24
virtual void ResetStatistics()
Definition: ChannelHandler.h:117
virtual void GatherStatistics(struct aws_array_list *)
Definition: ChannelHandler.h:123
Definition: Allocator.h:10