class StreamBuffer
Defined at line 17 of file ../../src/developer/debug/shared/stream_buffer.h
This class is a buffer that sits between an asynchronous OS read/write source and producers and
consumer of stream data.
It is used by the BufferedStream and its implementations to do the actual buffering.
Public Methods
void StreamBuffer ()
You must call set_writer before using.
Defined at line 15 of file ../../src/developer/debug/shared/stream_buffer.cc
void ~StreamBuffer ()
Defined at line 16 of file ../../src/developer/debug/shared/stream_buffer.cc
void AddReadData (std::vector<char> data)
Provides data from the OS source for reading.
Defined at line 18 of file ../../src/developer/debug/shared/stream_buffer.cc
void SetWritable ()
Notification from the OS that data can be written.
Defined at line 20 of file ../../src/developer/debug/shared/stream_buffer.cc
bool IsAvailable (size_t count)
Returns true if the given number of bytes are available for reading.
Defined at line 25 of file ../../src/developer/debug/shared/stream_buffer.cc
void set_writer (Writer * writer)
Sets the writer which flushes write data to the OS.
Defined at line 36 of file ../../src/developer/debug/shared/stream_buffer.h
size_t Read (char * buffer, size_t buffer_len)
Copies up to |buffer_len| bytes to the given |buffer|. If there is not enough data available it
will do a partial read (check IsAvailable() if you need to know in advance). Returns the number
of bytes actually read.
Defined at line 40 of file ../../src/developer/debug/shared/stream_buffer.cc
size_t Peek (char * buffer, size_t buffer_len)
Like Read() but does not actually consume the data. The same data will be supplied for a
subsequent Peek() or Read() call.
Defined at line 44 of file ../../src/developer/debug/shared/stream_buffer.cc
void Write (std::vector<char> data)
Writes the data to the OS sink.
Defined at line 48 of file ../../src/developer/debug/shared/stream_buffer.cc