Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
dart::bin::OverlappedBuffer Class Reference

#include <eventhandler_win.h>

Public Types

enum  Operation {
  kAccept , kRead , kRecvFrom , kWrite ,
  kSendTo , kDisconnect , kConnect
}
 

Public Member Functions

int Read (void *buffer, int num_bytes)
 
int Write (const void *buffer, int num_bytes)
 
int GetRemainingLength ()
 
bool IsEmpty ()
 
Operation operation () const
 
SOCKET client () const
 
char * GetBufferStart ()
 
int GetBufferSize () const
 
struct sockaddr * from () const
 
socklen_t * from_len_addr () const
 
socklen_t from_len () const
 
OVERLAPPEDGetCleanOverlapped ()
 
WSABUF * GetWASBUF ()
 
void set_data_length (int data_length)
 
void operator delete (void *buffer)
 

Static Public Member Functions

static OverlappedBufferAllocateAcceptBuffer (int buffer_size)
 
static OverlappedBufferAllocateReadBuffer (int buffer_size)
 
static OverlappedBufferAllocateRecvFromBuffer (int buffer_size)
 
static OverlappedBufferAllocateWriteBuffer (int buffer_size)
 
static OverlappedBufferAllocateSendToBuffer (int buffer_size)
 
static OverlappedBufferAllocateDisconnectBuffer ()
 
static OverlappedBufferAllocateConnectBuffer ()
 
static void DisposeBuffer (OverlappedBuffer *buffer)
 
static OverlappedBufferGetFromOverlapped (OVERLAPPED *overlapped)
 

Detailed Description

Definition at line 37 of file eventhandler_win.h.

Member Enumeration Documentation

◆ Operation

Member Function Documentation

◆ AllocateAcceptBuffer()

static OverlappedBuffer * dart::bin::OverlappedBuffer::AllocateAcceptBuffer ( int  buffer_size)
static

◆ AllocateConnectBuffer()

static OverlappedBuffer * dart::bin::OverlappedBuffer::AllocateConnectBuffer ( )
static

◆ AllocateDisconnectBuffer()

static OverlappedBuffer * dart::bin::OverlappedBuffer::AllocateDisconnectBuffer ( )
static

◆ AllocateReadBuffer()

static OverlappedBuffer * dart::bin::OverlappedBuffer::AllocateReadBuffer ( int  buffer_size)
static

◆ AllocateRecvFromBuffer()

static OverlappedBuffer * dart::bin::OverlappedBuffer::AllocateRecvFromBuffer ( int  buffer_size)
static

◆ AllocateSendToBuffer()

static OverlappedBuffer * dart::bin::OverlappedBuffer::AllocateSendToBuffer ( int  buffer_size)
static

◆ AllocateWriteBuffer()

static OverlappedBuffer * dart::bin::OverlappedBuffer::AllocateWriteBuffer ( int  buffer_size)
static

◆ client()

SOCKET dart::bin::OverlappedBuffer::client ( ) const
inline

Definition at line 78 of file eventhandler_win.h.

78{ return client_; }

◆ DisposeBuffer()

static void dart::bin::OverlappedBuffer::DisposeBuffer ( OverlappedBuffer buffer)
static

◆ from()

struct sockaddr * dart::bin::OverlappedBuffer::from ( ) const
inline

Definition at line 81 of file eventhandler_win.h.

81{ return from_; }

◆ from_len()

socklen_t dart::bin::OverlappedBuffer::from_len ( ) const
inline

Definition at line 83 of file eventhandler_win.h.

83{ return from_ == nullptr ? 0 : *from_len_addr_; }

◆ from_len_addr()

socklen_t * dart::bin::OverlappedBuffer::from_len_addr ( ) const
inline

Definition at line 82 of file eventhandler_win.h.

82{ return from_len_addr_; }

◆ GetBufferSize()

int dart::bin::OverlappedBuffer::GetBufferSize ( ) const
inline

Definition at line 80 of file eventhandler_win.h.

80{ return buflen_; }

◆ GetBufferStart()

char * dart::bin::OverlappedBuffer::GetBufferStart ( )
inline

Definition at line 79 of file eventhandler_win.h.

79{ return reinterpret_cast<char*>(&buffer_data_); }

◆ GetCleanOverlapped()

OVERLAPPED * dart::bin::OverlappedBuffer::GetCleanOverlapped ( )
inline

Definition at line 87 of file eventhandler_win.h.

87 {
88 memset(&overlapped_, 0, sizeof(overlapped_));
89 return &overlapped_;
90 }

◆ GetFromOverlapped()

static OverlappedBuffer * dart::bin::OverlappedBuffer::GetFromOverlapped ( OVERLAPPED overlapped)
static

◆ GetRemainingLength()

int dart::bin::OverlappedBuffer::GetRemainingLength ( )

◆ GetWASBUF()

WSABUF * dart::bin::OverlappedBuffer::GetWASBUF ( )
inline

Definition at line 93 of file eventhandler_win.h.

93 {
94 wbuf_.buf = GetBufferStart();
95 wbuf_.len = GetBufferSize();
96 return &wbuf_;
97 }

◆ IsEmpty()

bool dart::bin::OverlappedBuffer::IsEmpty ( )
inline

Definition at line 75 of file eventhandler_win.h.

75{ return GetRemainingLength() == 0; }

◆ operation()

Operation dart::bin::OverlappedBuffer::operation ( ) const
inline

Definition at line 77 of file eventhandler_win.h.

77{ return operation_; }

◆ operator delete()

void dart::bin::OverlappedBuffer::operator delete ( void *  buffer)
inline

Definition at line 101 of file eventhandler_win.h.

101{ free(buffer); }
static const uint8_t buffer[]

◆ Read()

int dart::bin::OverlappedBuffer::Read ( void *  buffer,
int  num_bytes 
)

◆ set_data_length()

void dart::bin::OverlappedBuffer::set_data_length ( int  data_length)
inline

Definition at line 99 of file eventhandler_win.h.

99{ data_length_ = data_length; }

◆ Write()

int dart::bin::OverlappedBuffer::Write ( const void *  buffer,
int  num_bytes 
)

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