uvcc
libuv C++ bindings
uv::request Class Reference

The base class for the libuv requests. More...

#include "request-base.hpp"

Inheritance diagram for uv::request:
uv::connect uv::fs uv::getaddrinfo uv::getnameinfo uv::output uv::shutdown uv::udp_send uv::work< _Result_ > uv::write

Public Types

using uv_t = ::uv_req_t
 
using on_destroy_t = std::function< void(void *_data) >
 The function type of the callback called when the request object is about to be destroyed.
 

Public Member Functions

 request (const request &_that)
 
requestoperator= (const request &_that)
 
 request (request &&_that) noexcept
 
requestoperator= (request &&_that) noexcept
 
void swap (request &_that) noexcept
 
std::uintptr_t id () const noexcept
 
long nrefs () const noexcept
 The current number of existing references to the same object as this request variable refers to.
 
int uv_status () const noexcept
 The status value returned by the last executed libuv API function on this request.
 
on_destroy_ton_destroy () const noexcept
 
::uv_req_type type () const noexcept
 The tag indicating a libuv type of the request. More...
 
const char * type_name () const noexcept
 A string containing the name of the request type.
 
void *const & data () const noexcept
 The pointer to the user-defined arbitrary data. libuv and uvcc does not use this field.
 
void *& data () noexcept
 
int cancel () noexcept
 Cancel a pending request. More...
 
 operator const uv_t * () const noexcept
 
 operator uv_t * () noexcept
 
 operator bool () const noexcept
 Equivalent to (uv_status() >= 0).
 

Detailed Description

The base class for the libuv requests.

Derived classes conceptually are just interfaces to the data stored in the base class, so there are no any virtual member functions.

See also
libuv API documentation: uv_req_t — Base request.

Definition at line 27 of file request-base.hpp.

Member Function Documentation

◆ type()

::uv_req_type uv::request::type ( ) const
inlinenoexcept

The tag indicating a libuv type of the request.

See also
libuv API documentation: uv_req_t.type.

Definition at line 191 of file request-base.hpp.

◆ cancel()

int uv::request::cancel ( )
inlinenoexcept

Cancel a pending request.

See also
libuv API documentation: uv_cancel().

Definition at line 213 of file request-base.hpp.


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