|
byteme
C++ wrappers for buffered inputs
|
Serial buffering to wrap a Writer.
More...
#include <BufferedWriter.hpp>


Public Member Functions | |
| SerialBufferedWriter (Pointer_ writer, std::size_t buffer_size) | |
Public Member Functions inherited from byteme::BufferedWriter< Type_, WriterPointer_ > | |
| unsigned long long | number () |
| void | write (Type_ input) |
| void | write (const Type_ *input, std::size_t number) |
| void | flush () |
| virtual void | finish ()=0 |
Serial buffering to wrap a Writer.
| Type_ | Type of the output bytes, usually char for text or unsigned char for binary. |
| Pointer_ | Pointer to a class that serves as a source of input bytes. The pointed-to class should satisfy the Writer interface; it may also be a concrete Writer subclass to enable devirtualization. Either a smart or raw pointer may be supplied depending on how the caller wants to manage the lifetime of the pointed-to object. |
This is a subclass of BufferedWriter that calls Writer::write() on the main thread.
|
inline |
| writer | Pointer to a source of input bytes. |
| buffer_size | Size of the internal buffer in which to store bytes that have been passed to write() but not yet flushed to the writer. Larger values reduce the number of write calls at the cost of greater memory usage. Should be positive. |