Chromium Code Reviews| Index: native_client_sdk/src/libraries/nacl_io/event_emitter_pipe.h |
| diff --git a/native_client_sdk/src/libraries/nacl_io/event_emitter_pipe.h b/native_client_sdk/src/libraries/nacl_io/event_emitter_pipe.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2dfa5648ec149af2ab40e3bb591b24aa46d95295 |
| --- /dev/null |
| +++ b/native_client_sdk/src/libraries/nacl_io/event_emitter_pipe.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef LIBRARIES_NACL_IO_EVENT_EMITTER_PIPE_H_ |
| +#define LIBRARIES_NACL_IO_EVENT_EMITTER_PIPE_H_ |
| + |
| +#include <poll.h> |
| +#include <stdint.h> |
| +#include <stdlib.h> |
| + |
| +#include "nacl_io/event_emitter_stream.h" |
| +#include "nacl_io/fifo_char.h" |
| + |
| +#include "sdk_util/auto_lock.h" |
| +#include "sdk_util/macros.h" |
| + |
| +namespace nacl_io { |
| + |
| +class EventEmitterPipe; |
| +typedef sdk_util::ScopedRef<EventEmitterPipe> ScopedEventEmitterPipe; |
| + |
| +class EventEmitterPipe : public EventEmitterStream { |
| + public: |
| + EventEmitterPipe(size_t size); |
| + |
| + size_t Read_Locked(char* data, size_t len); |
| + size_t Write_Locked(const char* data, size_t len); |
| + |
| + virtual FIFOInterface* rx_fifo() { return &fifo_; } |
|
binji
2013/09/15 22:18:58
I don't really like rx/tx. How about read_fifo/wri
noelallen1
2013/09/17 21:21:54
Done.
|
| + virtual FIFOInterface* tx_fifo() { return &fifo_; } |
|
binji
2013/09/15 22:18:58
You can use covariant return types for all of thes
noelallen1
2013/09/17 21:21:54
Done.
|
| + |
| +private: |
| + FIFOChar fifo_; |
| + DISALLOW_COPY_AND_ASSIGN(EventEmitterPipe); |
| +}; |
| + |
| +} // namespace nacl_io |
| + |
| +#endif // LIBRARIES_NACL_IO_EVENT_EMITTER_PIPE_H_ |
| + |