hamcast
Version 0.7
|
#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 |
![]() | |
virtual void | close ()=0 |
virtual bool | closed () const =0 |
![]() | |
long | ref_count () |
Additional Inherited Members | |
![]() | |
static void | add_ref (ref_counted *rc) |
static void | release (ref_counted *rc) |
![]() | |
ref_counted () | |
void | ref () |
bool | deref () |
Describes an abstract (binary) data sink.
|
pure virtual |
Force the data sink to flush any buffers.
Any | exception that might be thrown by write(). |
Implemented in hamcast::util::write_buffer< block_size, maximum_size >, and hamcast::util::buffered_sink< block_size, maximum_size >.
|
virtual |
Return the optimal block size for write operations.
Reimplemented in hamcast::util::buffered_sink< block_size, maximum_size >.
|
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::write_buffer< block_size, maximum_size >, and hamcast::util::buffered_sink< block_size, maximum_size >.