Skip to content

Commit 8a9336a

Browse files
authored
Removing Reader::read (#319)
1 parent 1a6942a commit 8a9336a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+121
-249
lines changed

include/libp2p/basic/reader.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,6 @@ namespace libp2p::basic {
2020

2121
virtual ~Reader() = default;
2222

23-
/**
24-
* @brief Reads exactly {@code} min(out.size(), bytes) {@nocode} bytes to
25-
* the buffer.
26-
* @param out output argument. Read data will be written to this buffer.
27-
* @param bytes number of bytes to read
28-
* @param cb callback with result of operation
29-
*
30-
* @note caller should maintain validity of an output buffer until callback
31-
* is executed. It is usually done with either wrapping buffer as shared
32-
* pointer, or having buffer as part of some class/struct, and using
33-
* enable_shared_from_this()
34-
*/
35-
virtual void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) = 0;
36-
3723
/**
3824
* @brief Reads up to {@code} min(out.size(), bytes) {@nocode} bytes to the
3925
* buffer.

include/libp2p/connection/loopback_stream.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ namespace libp2p::connection {
4040
const override;
4141

4242
protected:
43-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
44-
4543
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
4644

4745
void writeSome(BytesIn in, size_t bytes, WriteCallbackFunc cb) override;

include/libp2p/layer/websocket/ssl_connection.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ namespace libp2p::connection {
3232
outcome::result<void> close() override;
3333
bool isClosed() const override;
3434

35-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
3635
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
3736
void deferReadCallback(outcome::result<size_t> res,
3837
ReadCallbackFunc cb) override;

include/libp2p/layer/websocket/ws_connection.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ namespace libp2p::connection {
6868

6969
bool isClosed() const override;
7070

71-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
72-
7371
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
7472

7573
void deferReadCallback(outcome::result<size_t> res,

include/libp2p/muxer/mplex/mplex_stream.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ namespace libp2p::connection {
5050

5151
~MplexStream() override = default;
5252

53-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
54-
5553
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
5654

5755
void deferReadCallback(outcome::result<size_t> res,

include/libp2p/muxer/mplex/mplexed_connection.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ namespace libp2p::connection {
6464

6565
/// usage of these four methods is highly not recommended or even forbidden:
6666
/// use stream over this connection instead
67-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
6867
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
6968
void writeSome(BytesIn in, size_t bytes, WriteCallbackFunc cb) override;
7069

include/libp2p/muxer/yamux/yamux_stream.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ namespace libp2p::connection {
5454
size_t maximum_window_size,
5555
size_t write_queue_limit);
5656

57-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
58-
5957
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
6058

6159
void deferReadCallback(outcome::result<size_t> res,

include/libp2p/muxer/yamux/yamuxed_connection.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ namespace libp2p::connection {
111111

112112
/// usage of these four methods is highly not recommended or even forbidden:
113113
/// use stream over this connection instead
114-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
115114
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
116115
void writeSome(BytesIn in, size_t bytes, WriteCallbackFunc cb) override;
117116

include/libp2p/security/noise/noise_connection.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ namespace libp2p::connection {
3838

3939
outcome::result<void> close() override;
4040

41-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
42-
4341
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
4442

4543
void deferReadCallback(outcome::result<size_t> res,

include/libp2p/security/plaintext/plaintext_connection.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ namespace libp2p::connection {
3535

3636
outcome::result<multi::Multiaddress> remoteMultiaddr() override;
3737

38-
void read(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
39-
4038
void readSome(BytesOut out, size_t bytes, ReadCallbackFunc cb) override;
4139

4240
void deferReadCallback(outcome::result<size_t> res,

0 commit comments

Comments
 (0)