Describes an abstract (binary) data sink. More...
#include <sink.hpp>
Public Member Functions | |
virtual void | write (size_t buf_size, const void *buf)=0 |
virtual void | flush ()=0 |
virtual int | flush_hint () const |
Describes an abstract (binary) data sink.
virtual void hamcast::util::sink::flush | ( | ) | [pure virtual] |
Force the data sink to flush any buffers.
Any | exception that might be thrown by write(). |
Implemented in hamcast::util::buffered_sink< block_size, maximum_size >, and hamcast::util::write_buffer< block_size, maximum_size >.
int hamcast::util::sink::flush_hint | ( | ) | const [virtual] |
Return the optimal block size for write operations.
Reimplemented in hamcast::util::buffered_sink< block_size, maximum_size >.
virtual void hamcast::util::sink::write | ( | size_t | buf_size, | |
const void * | buf | |||
) | [pure virtual] |
Writes buf_size
bytes from buf
to the sink.
buf_size | The number of bytes that should be written from buf . | |
buf | The buffer. |
ios_base::failure | on errors (e.g. if the sink is closed) |
Implemented in hamcast::util::buffered_sink< block_size, maximum_size >, and hamcast::util::write_buffer< block_size, maximum_size >.