uvw  2.1.0
Public Member Functions | List of all members
uvw::BaseHandle Struct Referenceabstract

Untyped handle class. More...

#include <loop.hpp>

Inheritance diagram for uvw::BaseHandle:
Inheritance graph
[legend]

Public Member Functions

virtual HandleCategory category () const noexcept=0
 Gets the category of the handle. More...
 
virtual HandleType type () const noexcept=0
 Gets the type of the handle. More...
 
virtual bool active () const noexcept=0
 Checks if the handle is active. More...
 
virtual bool closing () const noexcept=0
 Checks if a handle is closing or closed. More...
 
virtual void reference () noexcept=0
 Reference the given handle. More...
 
virtual void unreference () noexcept=0
 Unreference the given handle. More...
 
virtual bool referenced () const noexcept=0
 Checks if the given handle referenced. More...
 
virtual void close () noexcept=0
 Request handle to be closed. More...
 

Detailed Description

Untyped handle class.

Handles' types are unknown from the point of view of the loop.
Anyway, a loop maintains a list of all the associated handles and let the users walk them as untyped instances.
This can help to end all the pending requests by closing the handles.

Definition at line 47 of file loop.hpp.

Member Function Documentation

◆ active()

virtual bool uvw::BaseHandle::active ( ) const
pure virtualnoexcept

Checks if the handle is active.

What active means depends on the type of handle:

  • An AsyncHandle handle is always active and cannot be deactivated, except by closing it with uv_close().
  • A PipeHandle, TCPHandle, UDPHandle, etc. handle - basically any handle that deals with I/O - is active when it is doing something that involves I/O, like reading, writing, connecting, accepting new connections, etc.
  • A CheckHandle, IdleHandle, TimerHandle, etc. handle is active when it has been started with a call to start().

Rule of thumb: if a handle of type FooHandle has a start() member method, then it’s active from the moment that method is called. Likewise, stop() deactivates the handle again.

Returns
True if the handle is active, false otherwise.

Implemented in uvw::Handle< T, U >, uvw::Handle< PollHandle, uv_poll_t >, uvw::Handle< CheckHandle, uv_check_t >, uvw::Handle< FsPollHandle, uv_fs_poll_t >, uvw::Handle< PrepareHandle, uv_prepare_t >, uvw::Handle< IdleHandle, uv_idle_t >, uvw::Handle< UDPHandle, uv_udp_t >, uvw::Handle< TimerHandle, uv_timer_t >, uvw::Handle< AsyncHandle, uv_async_t >, uvw::Handle< SignalHandle, uv_signal_t >, uvw::Handle< TCPHandle, uv_tcp_t >, uvw::Handle< FsEventHandle, uv_fs_event_t >, uvw::Handle< TTYHandle, uv_tty_t >, uvw::Handle< PipeHandle, uv_pipe_t >, and uvw::Handle< ProcessHandle, uv_process_t >.

◆ category()

virtual HandleCategory uvw::BaseHandle::category ( ) const
pure virtualnoexcept

◆ close()

virtual void uvw::BaseHandle::close ( )
pure virtualnoexcept

◆ closing()

virtual bool uvw::BaseHandle::closing ( ) const
pure virtualnoexcept

◆ reference()

virtual void uvw::BaseHandle::reference ( )
pure virtualnoexcept

◆ referenced()

virtual bool uvw::BaseHandle::referenced ( ) const
pure virtualnoexcept

◆ type()

virtual HandleType uvw::BaseHandle::type ( ) const
pure virtualnoexcept

◆ unreference()

virtual void uvw::BaseHandle::unreference ( )
pure virtualnoexcept

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