diff options
Diffstat (limited to 'Source/cmUVHandlePtr.cxx')
-rw-r--r-- | Source/cmUVHandlePtr.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx index 34e6a70..951ef3b 100644 --- a/Source/cmUVHandlePtr.cxx +++ b/Source/cmUVHandlePtr.cxx @@ -44,7 +44,7 @@ void uv_loop_ptr::reset() this->loop.reset(); } -uv_loop_ptr::operator uv_loop_t*() +uv_loop_ptr::operator uv_loop_t*() const { return this->loop.get(); } @@ -97,13 +97,19 @@ void uv_handle_ptr_base_<T>::allocate(void* data) } template <typename T> +uv_handle_ptr_base_<T>::operator bool() const +{ + return this->handle.get(); +} + +template <typename T> void uv_handle_ptr_base_<T>::reset() { this->handle.reset(); } template <typename T> -uv_handle_ptr_base_<T>::operator uv_handle_t*() +uv_handle_ptr_base_<T>::operator uv_handle_t*() const { return reinterpret_cast<uv_handle_t*>(this->handle.get()); } @@ -248,12 +254,20 @@ int uv_tty_ptr::init(uv_loop_t& loop, int fd, int readable, void* data) } #endif +int uv_idle_ptr::init(uv_loop_t& loop, void* data) +{ + this->allocate(data); + return uv_idle_init(&loop, *this); +} + template class uv_handle_ptr_base_<uv_handle_t>; #define UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(NAME) \ template class uv_handle_ptr_base_<uv_##NAME##_t>; \ template class uv_handle_ptr_<uv_##NAME##_t>; +UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(idle) + UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(signal) UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(pipe) |