23 template <
typename... Args>
26 std::forward<Args>(args)...))
45 return std::exchange(raw,
nullptr);
53 std::shared_ptr<close_ptr<T>> internal;
63 template <
typename... Args>
70 return internal.get()->raw;
77 return internal ==
nullptr;
82 template <
typename handle_type>
100 if (uv_is_closing(
reinterpret_cast<uv_handle_t*
>(&
uv_handle)) == 0)
102 uv_close(
reinterpret_cast<uv_handle_t*
>(&
uv_handle), on_close);
107 static void on_close(uv_handle_t* handle)
close_ptr(Args &&... args)
Definition proxy.h:24
T * operator->()
Definition proxy.h:38
~close_ptr()
Definition proxy.h:30
T * release()
Definition proxy.h:43
close_ptr(T *that)
Definition proxy.h:28
proxy_ptr(const proxy_ptr< T > &that)
Definition proxy.h:57
bool is_null()
Definition proxy.h:75
proxy_ptr(T *that)
Definition proxy.h:61
proxy_ptr(proxy_ptr< T > &&that) noexcept
Definition proxy.h:58
proxy_ptr(Args &&... args)
Definition proxy.h:64
proxy_ptr(proxy_ptr< T > &that)
Definition proxy.h:56
proxy_ptr< T > & operator=(const proxy_ptr< T > &that)=default
T * operator->()
Definition proxy.h:68
proxy_ptr(std::nullptr_t that)
Definition proxy.h:60
with_uv_handle(with_uv_handle< handle_type > &&that)=delete
void close()
Definition proxy.h:98
virtual ~with_uv_handle()=default
with_uv_handle(const with_uv_handle< handle_type > &that)=delete
handle_type uv_handle
Definition proxy.h:90