22 #ifndef SRC_NODE_WRAP_H_ 23 #define SRC_NODE_WRAP_H_ 25 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 41 #define WITH_GENERIC_UV_STREAM(env, obj, BODY, ELSE) \ 43 if (env->tcp_constructor_template().IsEmpty() == false && \ 44 env->tcp_constructor_template()->HasInstance(obj)) { \ 45 TCPWrap* const wrap = Unwrap<TCPWrap>(obj); \ 47 } else if (env->tty_constructor_template().IsEmpty() == false && \ 48 env->tty_constructor_template()->HasInstance(obj)) { \ 49 TTYWrap* const wrap = Unwrap<TTYWrap>(obj); \ 51 } else if (env->pipe_constructor_template().IsEmpty() == false && \ 52 env->pipe_constructor_template()->HasInstance(obj)) { \ 53 PipeWrap* const wrap = Unwrap<PipeWrap>(obj); \ 60 inline uv_stream_t* HandleToStream(Environment* env,
61 v8::Local<v8::Object> obj) {
62 v8::HandleScope scope(env->isolate());
64 WITH_GENERIC_UV_STREAM(env, obj, {
67 return reinterpret_cast<uv_stream_t*
>(
wrap->UVHandle());
75 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 77 #endif // SRC_NODE_WRAP_H_