Chromium Code Reviews| Index: native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h |
| diff --git a/native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h b/native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..34566026093d0bc1421fb7ac9296e6f331a60126 |
| --- /dev/null |
| +++ b/native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h |
| @@ -0,0 +1,42 @@ |
| +// 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_UDP_H_ |
| +#define LIBRARIES_NACL_IO_EVENT_EMITTER_UDP_H_ |
| + |
| +#include "nacl_io/event_emitter_stream.h" |
| +#include "nacl_io/fifo_packet.h" |
| + |
| +#include "sdk_util/macros.h" |
| +#include "sdk_util/scoped_ref.h" |
| + |
| +namespace nacl_io { |
| + |
| +class EventEmitterUDP; |
| +typedef sdk_util::ScopedRef<EventEmitterUDP> ScopedEventEmitterUDP; |
| + |
| +class EventEmitterUDP : public EventEmitterStream { |
| + public: |
| + EventEmitterUDP(size_t rsize, size_t wsize); |
| + |
| + // Takes or gives away ownwership of the packet. |
|
binji
2013/09/15 22:18:58
sp: ownership
noelallen1
2013/09/17 21:21:54
Done.
|
| + Packet* ReadRXPacket_Locked(); |
| + void WriteRXPacket_Locked(Packet* packet); |
| + |
| + Packet* ReadTXPacket_Locked(); |
| + void WriteTXPacket_Locked(Packet* packet); |
| + |
| + virtual FIFOInterface* rx_fifo() { return &rx_fifo_; } |
| + virtual FIFOInterface* tx_fifo() { return &tx_fifo_; } |
| + |
| +protected: |
| + FIFOPacket rx_fifo_; |
| + FIFOPacket tx_fifo_; |
| + DISALLOW_COPY_AND_ASSIGN(EventEmitterUDP); |
| +}; |
| + |
| +} // namespace nacl_io |
| + |
| +#endif // LIBRARIES_NACL_IO_EVENT_EMITTER_UDP_H_ |
| + |