23 template <
typename... Args>
26 raw =
new T(std::forward<Args>(args)...);
45 return std::exchange(raw,
nullptr);
53 std::shared_ptr<close_ptr<T>> internal;
62 template <
typename... Args>
69 return internal.get()->raw;
76 return internal ==
nullptr;
80 template <
typename handle_type>
98 if (!uv_is_closing((uv_handle_t*)&
uv_handle))
100 uv_close((uv_handle_t*)&
uv_handle, on_close);
105 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
proxy_ptr(proxy_ptr< T > &&that)
Definition proxy.h:58
bool is_null()
Definition proxy.h:74
proxy_ptr(T *that)
Definition proxy.h:60
proxy_ptr(Args &&... args)
Definition proxy.h:63
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:67
proxy_ptr(std::nullptr_t that)
Definition proxy.h:59
with_uv_handle(with_uv_handle< handle_type > &&that)=delete
void close()
Definition proxy.h:96
virtual ~with_uv_handle()=default
with_uv_handle(const with_uv_handle< handle_type > &that)=delete
handle_type uv_handle
Definition proxy.h:84
with_uv_handle()
Definition proxy.h:86