src: replace naive search in Buffer::IndexOf
[platform/upstream/nodejs.git] / src / pipe_wrap.h
1 #ifndef SRC_PIPE_WRAP_H_
2 #define SRC_PIPE_WRAP_H_
3
4 #include "async-wrap.h"
5 #include "env.h"
6 #include "stream_wrap.h"
7
8 namespace node {
9
10 class PipeWrap : public StreamWrap {
11  public:
12   uv_pipe_t* UVHandle();
13
14   static v8::Local<v8::Object> Instantiate(Environment* env, AsyncWrap* parent);
15   static void Initialize(v8::Local<v8::Object> target,
16                          v8::Local<v8::Value> unused,
17                          v8::Local<v8::Context> context);
18
19   size_t self_size() const override { return sizeof(*this); }
20
21  private:
22   PipeWrap(Environment* env,
23            v8::Local<v8::Object> object,
24            bool ipc,
25            AsyncWrap* parent);
26
27   static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
28   static void Bind(const v8::FunctionCallbackInfo<v8::Value>& args);
29   static void Listen(const v8::FunctionCallbackInfo<v8::Value>& args);
30   static void Connect(const v8::FunctionCallbackInfo<v8::Value>& args);
31   static void Open(const v8::FunctionCallbackInfo<v8::Value>& args);
32
33 #ifdef _WIN32
34   static void SetPendingInstances(
35       const v8::FunctionCallbackInfo<v8::Value>& args);
36 #endif
37
38   static void OnConnection(uv_stream_t* handle, int status);
39   static void AfterConnect(uv_connect_t* req, int status);
40
41   uv_pipe_t handle_;
42 };
43
44
45 }  // namespace node
46
47
48 #endif  // SRC_PIPE_WRAP_H_