cmUVHandlePtr: Add uv_process_ptr

This commit is contained in:
Brad King 2017-11-30 11:26:25 -05:00
parent dd700e9bfb
commit 3bcaa87007
3 changed files with 20 additions and 0 deletions

View File

@ -172,6 +172,13 @@ uv_pipe_ptr::operator uv_stream_t*() const
}
#ifdef CMAKE_BUILD_WITH_CMAKE
int uv_process_ptr::spawn(uv_loop_t& loop, uv_process_options_t const& options,
void* data)
{
allocate(data);
return uv_spawn(&loop, *this, &options);
}
int uv_timer_ptr::init(uv_loop_t& loop, void* data)
{
allocate(data);
@ -211,6 +218,8 @@ UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(stream)
#ifdef CMAKE_BUILD_WITH_CMAKE
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(async)
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(process)
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(timer)
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(tty)

View File

@ -165,6 +165,14 @@ struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
int init(uv_loop_t& loop, int ipc, void* data = nullptr);
};
struct uv_process_ptr : public uv_handle_ptr_<uv_process_t>
{
CM_PERFECT_FWD_CTOR(uv_process_ptr, uv_handle_ptr_<uv_process_t>);
int spawn(uv_loop_t& loop, uv_process_options_t const& options,
void* data = nullptr);
};
struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
{
CM_PERFECT_FWD_CTOR(uv_timer_ptr, uv_handle_ptr_<uv_timer_t>);
@ -200,6 +208,8 @@ UV_HANDLE_PTR_INSTANTIATE_EXTERN(signal)
UV_HANDLE_PTR_INSTANTIATE_EXTERN(pipe)
UV_HANDLE_PTR_INSTANTIATE_EXTERN(process)
UV_HANDLE_PTR_INSTANTIATE_EXTERN(stream)
UV_HANDLE_PTR_INSTANTIATE_EXTERN(timer)

View File

@ -157,6 +157,7 @@ static bool testAllMoves()
uv_stream_ptr _7;
uv_timer_ptr _8;
uv_tty_ptr _9;
uv_process_ptr _11;
uv_pipe_ptr _12;
uv_async_ptr _13;
uv_signal_ptr _14;