Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
dart::bin::Handle Class Referenceabstract

#include <eventhandler_win.h>

Inheritance diagram for dart::bin::Handle:
dart::bin::ReferenceCounted< Handle > dart::bin::DescriptorInfoBase dart::bin::DescriptorInfoSingleMixin< Handle > dart::bin::SocketHandle dart::bin::DirectoryWatchHandle dart::bin::FileHandle dart::bin::DescriptorInfoMultipleMixin< SocketHandle > dart::bin::DescriptorInfoSingleMixin< SocketHandle > dart::bin::StdHandle dart::bin::ListenSocket dart::bin::ClientSocket dart::bin::DatagramSocket

Public Types

enum  Type {
  kFile , kStd , kDirectoryWatch , kClientSocket ,
  kListenSocket , kDatagramSocket
}
 

Public Member Functions

intptr_t Available ()
 
bool DataReady ()
 
intptr_t Read (void *buffer, intptr_t num_bytes)
 
intptr_t RecvFrom (void *buffer, intptr_t num_bytes, struct sockaddr *sa, socklen_t addr_len)
 
virtual intptr_t Write (const void *buffer, intptr_t num_bytes)
 
virtual intptr_t SendTo (const void *buffer, intptr_t num_bytes, struct sockaddr *sa, socklen_t sa_len)
 
virtual bool IssueRead ()
 
virtual bool IssueRecvFrom ()
 
virtual bool IssueWrite ()
 
virtual bool IssueSendTo (struct sockaddr *sa, socklen_t sa_len)
 
bool HasPendingRead ()
 
bool HasPendingWrite ()
 
void ReadComplete (OverlappedBuffer *buffer)
 
void RecvFromComplete (OverlappedBuffer *buffer)
 
void WriteComplete (OverlappedBuffer *buffer)
 
bool IsClosing ()
 
bool IsClosedRead ()
 
bool IsClosedWrite ()
 
bool IsError ()
 
void MarkClosing ()
 
void MarkClosedRead ()
 
void MarkClosedWrite ()
 
void MarkError ()
 
virtual void EnsureInitialized (EventHandlerImplementation *event_handler)=0
 
HANDLE handle ()
 
bool CreateCompletionPort (HANDLE completion_port)
 
void Close ()
 
virtual void DoClose ()
 
virtual bool IsClosed ()=0
 
bool IsHandleClosed () const
 
Type type ()
 
bool is_file ()
 
bool is_socket ()
 
bool is_listen_socket ()
 
bool is_client_socket ()
 
bool is_datagram_socket ()
 
void MarkDoesNotSupportOverlappedIO ()
 
bool SupportsOverlappedIO ()
 
void ReadSyncCompleteAsync ()
 
DWORD last_error ()
 
void set_last_error (DWORD last_error)
 
void set_completion_port (HANDLE completion_port)
 
void set_event_handler (EventHandlerImplementation *event_handler)
 
- Public Member Functions inherited from dart::bin::ReferenceCounted< Handle >
 ReferenceCounted ()
 
virtual ~ReferenceCounted ()
 
void Retain ()
 
void Release ()
 
- Public Member Functions inherited from dart::bin::DescriptorInfoBase
 DescriptorInfoBase (intptr_t fd)
 
virtual ~DescriptorInfoBase ()
 
intptr_t fd ()
 
virtual bool IsListeningSocket () const =0
 
virtual void SetPortAndMask (Dart_Port port, intptr_t mask)=0
 
virtual void RemovePort (Dart_Port port)=0
 
virtual void RemoveAllPorts ()=0
 
virtual Dart_Port NextNotifyDartPort (intptr_t events_ready)=0
 
virtual void NotifyAllDartPorts (uintptr_t events)=0
 
virtual void ReturnTokens (Dart_Port port, int count)=0
 
virtual intptr_t Mask ()=0
 
virtual void Close ()=0
 

Protected Types

enum  Flags {
  kClosing = 0 , kCloseRead = 1 , kCloseWrite = 2 , kDoesNotSupportOverlappedIO = 3 ,
  kError = 4
}
 

Protected Member Functions

 Handle (intptr_t handle)
 
virtual ~Handle ()
 
virtual void HandleIssueError ()
 

Protected Attributes

Monitor monitor_
 
Type type_
 
HANDLE handle_
 
HANDLE completion_port_
 
EventHandlerImplementationevent_handler_
 
std::unique_ptr< OverlappedBufferdata_ready_
 
OverlappedBufferpending_read_
 
OverlappedBufferpending_write_
 
DWORD last_error_
 
ThreadId read_thread_id_
 
HANDLE read_thread_handle_
 
bool read_thread_starting_
 
bool read_thread_finished_
 
- Protected Attributes inherited from dart::bin::DescriptorInfoBase
intptr_t fd_
 

Friends

class EventHandlerImplementation
 
class ReferenceCounted< Handle >
 

Detailed Description

Definition at line 163 of file eventhandler_win.h.

Member Enumeration Documentation

◆ Flags

enum dart::bin::Handle::Flags
protected
Enumerator
kClosing 
kCloseRead 
kCloseWrite 
kDoesNotSupportOverlappedIO 
kError 

Definition at line 254 of file eventhandler_win.h.

◆ Type

Enumerator
kFile 
kStd 
kDirectoryWatch 
kClientSocket 
kListenSocket 
kDatagramSocket 

Definition at line 165 of file eventhandler_win.h.

Constructor & Destructor Documentation

◆ Handle()

dart::bin::Handle::Handle ( intptr_t  handle)
explicitprotected

◆ ~Handle()

virtual dart::bin::Handle::~Handle ( )
protectedvirtual

Member Function Documentation

◆ Available()

intptr_t dart::bin::Handle::Available ( )

◆ Close()

void dart::bin::Handle::Close ( )
virtual

◆ CreateCompletionPort()

bool dart::bin::Handle::CreateCompletionPort ( HANDLE  completion_port)

◆ DataReady()

bool dart::bin::Handle::DataReady ( )

◆ DoClose()

virtual void dart::bin::Handle::DoClose ( )
virtual

◆ EnsureInitialized()

virtual void dart::bin::Handle::EnsureInitialized ( EventHandlerImplementation event_handler)
pure virtual

◆ handle()

HANDLE dart::bin::Handle::handle ( )
inline

Definition at line 210 of file eventhandler_win.h.

210{ return handle_; }

◆ HandleIssueError()

virtual void dart::bin::Handle::HandleIssueError ( )
protectedvirtual

Reimplemented in dart::bin::SocketHandle.

◆ HasPendingRead()

bool dart::bin::Handle::HasPendingRead ( )

◆ HasPendingWrite()

bool dart::bin::Handle::HasPendingWrite ( )

◆ is_client_socket()

bool dart::bin::Handle::is_client_socket ( )
inline

Definition at line 227 of file eventhandler_win.h.

227{ return type_ == kClientSocket; }

◆ is_datagram_socket()

bool dart::bin::Handle::is_datagram_socket ( )
inline

Definition at line 228 of file eventhandler_win.h.

228{ return type_ == kDatagramSocket; }

◆ is_file()

bool dart::bin::Handle::is_file ( )
inline

Definition at line 221 of file eventhandler_win.h.

221{ return type_ == kFile; }

◆ is_listen_socket()

bool dart::bin::Handle::is_listen_socket ( )
inline

Definition at line 226 of file eventhandler_win.h.

226{ return type_ == kListenSocket; }

◆ is_socket()

bool dart::bin::Handle::is_socket ( )
inline

Definition at line 222 of file eventhandler_win.h.

222 {
223 return type_ == kListenSocket || type_ == kClientSocket ||
225 }

◆ IsClosed()

virtual bool dart::bin::Handle::IsClosed ( )
pure virtual

◆ IsClosedRead()

bool dart::bin::Handle::IsClosedRead ( )
inline

Definition at line 200 of file eventhandler_win.h.

200{ return (flags_ & (1 << kCloseRead)) != 0; }

◆ IsClosedWrite()

bool dart::bin::Handle::IsClosedWrite ( )
inline

Definition at line 201 of file eventhandler_win.h.

201{ return (flags_ & (1 << kCloseWrite)) != 0; }

◆ IsClosing()

bool dart::bin::Handle::IsClosing ( )
inline

Definition at line 199 of file eventhandler_win.h.

199{ return (flags_ & (1 << kClosing)) != 0; }

◆ IsError()

bool dart::bin::Handle::IsError ( )
inline

Definition at line 202 of file eventhandler_win.h.

202{ return (flags_ & (1 << kError)) != 0; }

◆ IsHandleClosed()

bool dart::bin::Handle::IsHandleClosed ( ) const
inline

Definition at line 218 of file eventhandler_win.h.

218{ return handle_ == INVALID_HANDLE_VALUE; }
#define INVALID_HANDLE_VALUE

◆ IssueRead()

virtual bool dart::bin::Handle::IssueRead ( )
virtual

◆ IssueRecvFrom()

virtual bool dart::bin::Handle::IssueRecvFrom ( )
virtual

Reimplemented in dart::bin::DatagramSocket.

◆ IssueSendTo()

virtual bool dart::bin::Handle::IssueSendTo ( struct sockaddr *  sa,
socklen_t  sa_len 
)
virtual

Reimplemented in dart::bin::DatagramSocket.

◆ IssueWrite()

virtual bool dart::bin::Handle::IssueWrite ( )
virtual

Reimplemented in dart::bin::ClientSocket.

◆ last_error()

DWORD dart::bin::Handle::last_error ( )
inline

Definition at line 239 of file eventhandler_win.h.

239{ return last_error_; }

◆ MarkClosedRead()

void dart::bin::Handle::MarkClosedRead ( )
inline

Definition at line 204 of file eventhandler_win.h.

204{ flags_ |= (1 << kCloseRead); }

◆ MarkClosedWrite()

void dart::bin::Handle::MarkClosedWrite ( )
inline

Definition at line 205 of file eventhandler_win.h.

205{ flags_ |= (1 << kCloseWrite); }

◆ MarkClosing()

void dart::bin::Handle::MarkClosing ( )
inline

Definition at line 203 of file eventhandler_win.h.

203{ flags_ |= (1 << kClosing); }

◆ MarkDoesNotSupportOverlappedIO()

void dart::bin::Handle::MarkDoesNotSupportOverlappedIO ( )
inline

Definition at line 230 of file eventhandler_win.h.

230 {
231 flags_ |= (1 << kDoesNotSupportOverlappedIO);
232 }

◆ MarkError()

void dart::bin::Handle::MarkError ( )
inline

Definition at line 206 of file eventhandler_win.h.

206{ flags_ |= (1 << kError); }

◆ Read()

intptr_t dart::bin::Handle::Read ( void *  buffer,
intptr_t  num_bytes 
)

◆ ReadComplete()

void dart::bin::Handle::ReadComplete ( OverlappedBuffer buffer)

◆ ReadSyncCompleteAsync()

void dart::bin::Handle::ReadSyncCompleteAsync ( )

◆ RecvFrom()

intptr_t dart::bin::Handle::RecvFrom ( void *  buffer,
intptr_t  num_bytes,
struct sockaddr *  sa,
socklen_t  addr_len 
)

◆ RecvFromComplete()

void dart::bin::Handle::RecvFromComplete ( OverlappedBuffer buffer)

◆ SendTo()

virtual intptr_t dart::bin::Handle::SendTo ( const void *  buffer,
intptr_t  num_bytes,
struct sockaddr *  sa,
socklen_t  sa_len 
)
virtual

◆ set_completion_port()

void dart::bin::Handle::set_completion_port ( HANDLE  completion_port)
inline

Definition at line 242 of file eventhandler_win.h.

242 {
243 completion_port_ = completion_port;
244 }

◆ set_event_handler()

void dart::bin::Handle::set_event_handler ( EventHandlerImplementation event_handler)
inline

Definition at line 246 of file eventhandler_win.h.

246 {
248 }
EventHandlerImplementation * event_handler_
static EventHandler * event_handler
Definition: eventhandler.cc:18

◆ set_last_error()

void dart::bin::Handle::set_last_error ( DWORD  last_error)
inline

Definition at line 240 of file eventhandler_win.h.

◆ SupportsOverlappedIO()

bool dart::bin::Handle::SupportsOverlappedIO ( )
inline

Definition at line 233 of file eventhandler_win.h.

233 {
234 return (flags_ & (1 << kDoesNotSupportOverlappedIO)) == 0;
235 }

◆ type()

Type dart::bin::Handle::type ( )
inline

Definition at line 220 of file eventhandler_win.h.

220{ return type_; }

◆ Write()

virtual intptr_t dart::bin::Handle::Write ( const void *  buffer,
intptr_t  num_bytes 
)
virtual

Reimplemented in dart::bin::StdHandle.

◆ WriteComplete()

void dart::bin::Handle::WriteComplete ( OverlappedBuffer buffer)

Friends And Related Function Documentation

◆ EventHandlerImplementation

friend class EventHandlerImplementation
friend

Definition at line 252 of file eventhandler_win.h.

◆ ReferenceCounted< Handle >

friend class ReferenceCounted< Handle >
friend

Definition at line 291 of file eventhandler_win.h.

Member Data Documentation

◆ completion_port_

HANDLE dart::bin::Handle::completion_port_
protected

Definition at line 270 of file eventhandler_win.h.

◆ data_ready_

std::unique_ptr<OverlappedBuffer> dart::bin::Handle::data_ready_
protected

Definition at line 274 of file eventhandler_win.h.

◆ event_handler_

EventHandlerImplementation* dart::bin::Handle::event_handler_
protected

Definition at line 271 of file eventhandler_win.h.

◆ handle_

HANDLE dart::bin::Handle::handle_
protected

Definition at line 269 of file eventhandler_win.h.

◆ last_error_

DWORD dart::bin::Handle::last_error_
protected

Definition at line 278 of file eventhandler_win.h.

◆ monitor_

Monitor dart::bin::Handle::monitor_
protected

Definition at line 267 of file eventhandler_win.h.

◆ pending_read_

OverlappedBuffer* dart::bin::Handle::pending_read_
protected

Definition at line 275 of file eventhandler_win.h.

◆ pending_write_

OverlappedBuffer* dart::bin::Handle::pending_write_
protected

Definition at line 276 of file eventhandler_win.h.

◆ read_thread_finished_

bool dart::bin::Handle::read_thread_finished_
protected

Definition at line 283 of file eventhandler_win.h.

◆ read_thread_handle_

HANDLE dart::bin::Handle::read_thread_handle_
protected

Definition at line 281 of file eventhandler_win.h.

◆ read_thread_id_

ThreadId dart::bin::Handle::read_thread_id_
protected

Definition at line 280 of file eventhandler_win.h.

◆ read_thread_starting_

bool dart::bin::Handle::read_thread_starting_
protected

Definition at line 282 of file eventhandler_win.h.

◆ type_

Type dart::bin::Handle::type_
protected

Definition at line 268 of file eventhandler_win.h.


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